Queue an indexing job

@link https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job

@param string $target

@return array
970020
public function queueIndexingJob(string $target): array
    {
        return $this->getApi()->request(sprintf('/staff/indexing_jobs'), Request::METHOD_POST, [
                'target' => $target
            ]);
    }
434522
protected function options($target)
    {
        $options = JSON_ERROR_NONE;

        if (isset($this->options[$target]))
        {
            foreach ($this->options[$target] as $option)
            {
                $options |= $option;
            }
        }

        return $options;
    }
672142
private function _getLevelAndTargetLoggers( $target )
    {
        $target = strpos($target, ':') !== false ? explode( ':' , $target ) : ['', '*'];
        list($level,$target_loggers) = $target;
        $target_loggers = explode( ',' , $target_loggers );
        $target_loggers = array_map( 'trim', $target_loggers );
        if (in_array('*',$target_loggers))
        {
            $target_loggers = array_keys($this->loggers);
        }
        return array( $level, $target_loggers );
    }
1118960
public function getOneToMany($target, $key = null, $target_key = null){
        $factory = $this->_db->factory($target);
        if(null === $key){
            $key = $this->getPK();
        }
        if(null === $target_key){
            $target_key = $key;
        }
        
        return $factory->findManyBy($target_key, $this->get($key));
    }
1297367
public function php(string $target)
    {
        $php = new PHP();
        $php->process($this->coverage, $target);
    }
868757
public function apply($target)
    {
        $filters = $this->getFilters();

        foreach ($filters as $filter) {
            $target = preg_replace($filter->search, $filter->replace, $target);
        }

        return $target;
    }
961641
protected function getNextAvailableJob($queue)
	{
		$this->database->beginTransaction();

		$job = $this->database->table($this->table)
					->lockForUpdate()
					->where('queue', $this->getQueue($queue))
					->where('reserved', 0)
					->where('available_at', '<=', $this->getTime())
					->orderBy('id', 'asc')
					->first();

		return $job ? (object) $job : null;
	}
427833
protected function getNextAvailableJob($queue)
    {
        $job = $this->database->table($this->table)
            ->lockForUpdate()
            ->where('queue', $this->getQueue($queue))
            ->where(function ($query)
            {
                $this->isAvailable($query);

                $this->isReservedButExpired($query);
            })
            ->orderBy('id', 'asc')
            ->first();

        if (! is_null($job)) {
            return (object) $job;
        }
    }
615041
public function getQueues(array $queueAlias): array
    {
        $queues = [];
        foreach ($queueAlias as $alias) {
            $queues[] = $this->getQueue($alias);
        }

        return $queues;
    }
1046520
public function reserveJob($queue, $timeout = null)
    {
        $this->migrate($queue);
        $keyReady = $this->getKeyReady($queue);
        $keyReserved = $this->getKeyReserved($queue);

        if ($this->isStop($queue)) {
            return null;
        }

        if ($timeout > 0) {
            $id = $this->getRedis()->blpop($keyReady, $timeout);
            /**
             *  return [
             *      '0' => queueName ,
             *      '1' => jobId
             *  ]
             */
            $id = (is_array($id)) ? $id[1] : null;
        } else {
            $id = $this->getRedis()->lpop($keyReady);
        }

        if (!is_null($id)) {
            $payload = self::buildPayload($queue, self::STATE_RESERVED);
            $this->getRedis()->hset($this->getRedisJobNamespace(), $id, $payload);
            $this->getRedis()->zadd($keyReserved, $this->getTime(), $id);

            return $id;
        }

        return null;
    }
1128555
public function getByTarget(Target $target, $limit = 50, $page = 0)
    {
        $dql = sprintf(self::DQL_BY_TARGET, Release::class);
        $params = ['target' => $target];

        return $this->getPaginator($dql, $limit, $page, $params);
    }
685136
public function hasDuplicates($target)
    {
        if ($this->exists($target)) {
            $duplicates = $this->getDuplicates();
            return (int) $duplicates[$target] > 1;

        } else {
            throw new RuntimeException(sprintf(
                'Attempted to read non-existing value %s', $target
            ));
        }
    }
1229931
private static function searchMdObject($multi, array $target): array
    {
        return array_map(
            function($element) use ($target) {
                $exist = true;
                foreach ($target as $skey => $svalue) {
                    $exist = $exist && isset($element->$skey) && ($element->$skey === $svalue);
                }
                return $exist ? $element : null;
            },
            (array) $multi
        );
    }
154563
public function copy($source, $target)
    {
        if (!is_dir($source)) {
            return copy($source, $target);
        }
        $it = new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS);
        /** @var RecursiveDirectoryIterator $ri */
        $ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::SELF_FIRST);
        $this->filesystem->ensureDirectoryExists($target);
        $result = true;
        foreach ($ri as $file) {
            $targetPath = $target . DIRECTORY_SEPARATOR . $ri->getSubPathName();
            if ($file->isDir()) {
                $this->filesystem->ensureDirectoryExists($targetPath);
            } else {
                $result = $result && copy($file->getPathname(), $targetPath);
            }
        }
        return $result;
    }
692381
public function appendTo($target)
    {
        $target_result = $this->getTargetResult($target);

        $target_result->append($this);
        $this->remove();

        return $target_result;
    }
310204
public function copy($target, $source)
    {
        $source_stream = $this->readStream($source);
        $result = $this->writeStream($target, $source_stream);

        fclose($source_stream);

        return $result;
    }
332939
public function peekQueue($queueName, $index = 0, $limit = 20)
    {
        if ($messages = $this->ironmq->peekMessages($queueName, $limit)) {
            return $this->pluck($messages, 'body');
        }

        return [];
    }