Find out if our bee is already in the hive.

@param object|array $bee
The object or array we want to check for recursion.

@return bool
Boolean which shows whether we are facing a recursion.
328078
public function isInHive($bee)
    {
        // Check objects.
        if (is_object($bee) === true) {
            return $this->recursionHive->contains($bee);
        }

        // Check arrays (only the $GLOBAL array may apply).
        if (isset($bee[$this->recursionMarker]) === true) {
            // We render the $GLOBALS only once.
            if ($this->globalsWereRendered === true) {
                return true;
            }

            $this->globalsWereRendered = true;
        }

        // Should be a normal array. We do not track these, because we can not
        // resolve them via JS recursion handling.
        return false;
    }
387382
public function isEqual(array $instance_array)
    {
        $this->rewind();
        while (!empty($this->current())) {
            if ($this->hasEqualArrays($this->current()->toArray(), $instance_array)) {
                return true;
            }
            $this->next();
        }
        $this->rewind();
        return false;
    }
172186
protected function checkIfBot() {
    if($this->nodb) {
      return;
    }

    // BLP 2018-07-02 -- replace old logic with 'isMe()'
    if($this->isMe()) {
      return;
    }

    $this->query("select count(*) from information_schema.tables ".
                 "where (table_schema = '$this->masterdb') and (table_name = 'bots')");

    list($ok) = $this->fetchrow('num');

    if($ok == 1) {
      $agent = $this->escape($this->agent);

      $this->isBot = preg_match("~\+*https?://|Googlebot-Image|python|java|wget|nutch|perl|libwww|lwp-trivial|curl|PHP/|urllib|".
                                "GT::WWW|Snoopy|MFC_Tear_Sample|HTTP::Lite|PHPCrawl|URI::Fetch|Zend_Http_Client|".
                                "http client|PECL::HTTP~i", $this->agent)
                     || ($this->query("select ip from $this->masterdb.bots where ip='$this->ip'")) ? true : false;          
    }
  }
351538
public function has_result($bucket = self::DEFAULT_BUCKET)
	{
		// check for additional results
		$this->post_results($bucket);

		return (!empty($this->results[$bucket]));
	}
529907
public function setBoard(array $board)
    {
        if (empty($board)) {
            return false;
        }

        // is not associative array and total size of array is not the same as board size then invalidate board
        if (($boardSize = count($board, COUNT_RECURSIVE)) == count($board) && $boardSize != pow($this->size, 2)) {
            return false;
        }

        // if not associative then set the boar as one
        if (count($board, COUNT_RECURSIVE) == count($board)) {
            $this->board = array_chunk($board, $this->size);
        } else {
            $this->board = $board;
        }

        // if distinct values is greater than 2 then invalidate board
        $boardDistinctValues = array_unique(array_filter(array_reduce($this->board, 'array_merge', [])));
        if (count($boardDistinctValues) > 2) {
            return false;
        }

        return $this->board;
    }
619011
private static function keyExists($key)
    {
        $apiKeyCount = self::where('key', '=', $key)->limit(1)->count();

        if ($apiKeyCount > 0) return true;

        return false;
    }
50253
public function isRobot($key = null)
    {
        if ( ! $this->isRobot) {
            return false;
        }

        // No need to be specific, it's a robot
        if ($key === null) {
            return true;
        }

        // Check for a specific robot
        return (isset(static::$robots[ $key ]) && $this->robot === static::$robots[ $key ]);
    }
108832
public static function has($name, $range = null)
    {
        static::_init();
        
        $range = $range ?: self::$range;
        
        $exists = isset(self::$data[$range][$name]) ? true : false;
        
        if (!$exists) {
            $names = explode('.', $name, 3);
            $count = count($names);
            if ($count >= 1) {
                $exists = array_key_exists($names[0], array_keys(self::$data[$range]));
                
                if ($count >= 2 && $exists) {
                    $exists = isset(self::$data[$range][$names[0]]) && array_key_exists($names[1], array_keys(self::$data[$range][$names[0]]));
                }
                
                if ($count >= 3 && $exists) {
                    $exists = isset(self::$data[$range][$names[0]][$names[1]]) && array_key_exists($names[2], array_keys(self::$data[$range][$names[0]][$names[1]]));
                }
            }
        }
        
        return $exists;
    }
1128774
public function offsetExists($offset)
    {
        if (!is_int($offset)) {
            $offset = array_search($offset, self::$reverseLookup);
        }

        return isset(self::$references[$offset]);
    }
638677
public function isSequential(bool $recursive = false): bool
    {

        // recursive

        if ($recursive === true) {
            return $this->array_keys_recursive($this->getArray())
                   ===
                   \range(0, \count($this->getArray(), \COUNT_RECURSIVE) - 1);
        }

        // non recursive

        return \array_keys($this->getArray())
               ===
               \range(0, \count($this->getArray(), \COUNT_NORMAL) - 1);
    }
1291995
public function incr($by = 1)
    {
        return (bool)$this->resque->getClient()->incrby($this->getKey(), $by);
    }
598205
public function offsetExists($offset)
    {
        $val = $this->registry->getEntry($offset, null);
        if (empty($val)) {
            $val = $this->_getFallbackMethod($offset, array(), false, 'get');
        }
        return (bool) null!==$val;
    }
90827
public function hasMethodCall($method)
    {
        foreach ($this->calls as $call) {
            if ($call[0] === $method) {
                return true;
            }
        }

        return false;
    }
523233
public function has($name)
    {
        $found = false;
        $this->elements->rewind();

        /** @var ElementInterface $element*/
        foreach ($this->elements as $element) {
            if ($element->getName() == $name) {
                $found = true;
                break;
            }
        }
        return $found;
    }
1227722
public function isActive($recursive = false)
        {
            if (!$this->_active && $recursive) {
                foreach ($this->_pages as $page) {
                    if ($page->isActive(true)) {
                        return true;
                    }
                }

                return false;
            }

            return $this->_active;
        }
727210
public function isSequentialArray($array)
    {
        $counter = 0;
        foreach ($array as $key => $value) {
            if ($counter !== $key) {
                return false;
            }
            $counter++;
        }

        return true;
    }
1062651
public function has($name)
    {
        if (isset($this->names[$name])) {
            return true;
        }

        $normalized = $this->normalizeName($name);

        if (isset($this->names[$normalized])) {
            return true;
        }

        foreach ($this->entries as $key => $entry) {
            if ($entry['type'] === self::ENTRY_TYPE_ABSTRACT_FACTORY && $this->hasAbstract($name, $key, $entry)) {
                return true;
            }
        }

        return false;
    }