src/Datastructure/Maps/HashMap.php
public function containsKey($key): bool {
        /**
         * @var string $arrayIndex
         * @var SinglyLinkedList $list
         */
        foreach ($this->bucket as $arrayIndex => $list) {
            if (null === $list) {
                continue;
            }
            /* $list is the first element in the bucket. The bucket
             * can contain max $maxSize entries and each entry has zero
             * or one nodes which can have zero, one or multiple
             * successors.
             */
            if ($list->containsKey($key)) {
                return true;
            }
        }
        /*
         * If no bucket contains the value then return false because
         * the searched value is not in the list.
         */
        return false;
    }
public function containsKey($key): bool {
        /**
         * @var string $arrayIndex
         * @var SinglyLinkedList $list
         */
        foreach ($this->bucket as $arrayIndex => $list) {
            if (null === $list) {
                continue;
            }
            /* $list is the first element in the bucket. The bucket
             * can contain max $maxSize entries and each entry has zero
             * or one nodes which can have zero, one or multiple
             * successors.
             */
            if ($list->containsKey($key)) {
                return true;
            }
        }
        /*
         * If no bucket contains the value then return false because
         * the searched value is not in the list.
         */
        return false;
    }
public function containsKey ( $ key ) : bool { /**
         * @var string $arrayIndex
         * @var SinglyLinkedList $list
         */ foreach ( $ this -> bucket as $ arrayIndex => $ list ) { if ( null === $ list ) { continue ; } /* $list is the first element in the bucket. The bucket
             * can contain max $maxSize entries and each entry has zero
             * or one nodes which can have zero, one or multiple
             * successors.
             */ if ( $ list -> containsKey ( $ key ) ) { return true ; } } /*
         * If no bucket contains the value then return false because
         * the searched value is not in the list.
         */ return false ; }
determines whether the HashMap contains a key.

@param $key
@return bool
determines whether the HashMap contains a key .