Run php's linter in one parallel task for the passed chunk

@param array $chunk
178682
protected function parallelLint(array $chunk)
	{
		$task = $this->taskParallelExec()
			->timeout(5)
			->printed(FALSE);

		foreach($chunk as $file)
		{
			$task = $task->process("php -l {$file}");
		}

		$task->run();
	}
1135655
private function validateResetRow(CellChunk $chunk)
    {
        $this->isError(
            $chunk->getResetRow() &&
            (
                $chunk->getRowKey() ||
                $chunk->getQualifier() ||
                $chunk->getValue() ||
                $chunk->getTimestampMicros() > 0
            ),
            'A reset should have no data.'
        );
    }
670082
public function flush(?string $chunk, bool $flushEmpty = false): void
	{
		if($this->isCGI)
		{
			if(!empty($chunk))
			{
				echo $chunk;

				flush();
			}
		}
		else
		{
			if(!empty($chunk) || $flushEmpty === true)
			{
				printf("%x\r\n%s\r\n", strlen($chunk), $chunk);

				flush();
			}
		}
	}
26331
function onSocketChunk(chunk) {
        var err = self.mach.handleChunk(chunk);
        if (err) {
            self.sendProtocolError('read', err);
        }
    }
576925
public function nextChunk($chunk = false)
  {
    if (false == $this->resumeUri) {
      $this->resumeUri = $this->getResumeUri();
    }

    if (false == $chunk) {
      $chunk = substr($this->data, $this->progress, $this->chunkSize);
    }

    $lastBytePos = $this->progress + strlen($chunk) - 1;
    $headers = array(
      'content-range' => "bytes $this->progress-$lastBytePos/$this->size",
      'content-type' => $this->request->getRequestHeader('content-type'),
      'content-length' => $this->chunkSize,
      'expect' => '',
    );

    $httpRequest = new Google_Http_Request(
        $this->resumeUri,
        'PUT',
        $headers,
        $chunk
    );

    if ($this->client->getClassConfig("Google_Http_Request", "enable_gzip_for_uploads")) {
      $httpRequest->enableGzip();
    } else {
      $httpRequest->disableGzip();
    }

    $response = $this->client->getIo()->makeRequest($httpRequest);
    $response->setExpectedClass($this->request->getExpectedClass());
    $code = $response->getResponseHttpCode();
    $this->httpResultCode = $code;

    if (308 == $code) {
      // Track the amount uploaded.
      $range = explode('-', $response->getResponseHeader('range'));
      $this->progress = $range[1] + 1;

      // Allow for changing upload URLs.
      $location = $response->getResponseHeader('location');
      if ($location) {
        $this->resumeUri = $location;
      }

      // No problems, but upload not complete.
      return false;
    } else {
      return Google_Http_REST::decodeHttpResponse($response, $this->client);
    }
  }
111032
protected function processLoop(string &$content): void
    {
        $paramsRexp = '\\$[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*';
        $pattern = $this->getTagPattern('loop\s+(.+?)\s+(' . $paramsRexp . ')(\s+(' . $paramsRexp . '))?');
        $content = preg_replace_callback($pattern, function ($match) {
            if (isset($match[4])) {
                return '<?php foreach(' . $match[1] . ' as ' . $match[2] . ' => ' . $match[4] . '){ ?>';
            } else {
                return '<?php foreach(' . $match[1] . ' as ' . $match[2] . '){ ?>';
            }
        }, $content);
    }
835769
private function mustSeparate($chunks)
    {
        $found = null;

        foreach ($chunks as $chunk) {
            if ($chunk !== '000') {
                break;
            }
        }

        if ($chunk < 100 || !($chunk % 100)) {
            return true;
        }

        return false;
    }
556144
private function _runParse( $path = NULL )
    {
        $startLevels  = $this->_getRealLevel( $this->_rootPath );
        $endLevels    = $startLevels + $this->levels;
        $currentLevel = 0;

        if ( NULL !== $path )
        {
            $this->_dirs[ ] = $path;
        }

        do
        {
            $dir          = array_shift( $this->_dirs );
            $currentLevel = $this->_getRealLevel( $dir );

            if ( $currentLevel < $endLevels )
            {
                $this->_parse( $dir );
            }
        } while ( count( $this->_dirs ) > 0 );
    }
1208538
private function send(array $thrifts)
    {
        foreach ($this->chunkSplit($thrifts) as $chunk) {
            /* @var $chunk ThriftSpan[] */
            $this->client->emitZipkinBatch($chunk);
        }
    }
825554
public function run($request)
    {
        $currentSite = Multisites::inst()->getCurrentSite();
        $folderName  = $currentSite->Host ? $currentSite->Host : "site-$currentSite->ID";
        $folder      = Folder::find_or_make($folderName);

        $files = File::get()->filter('ParentID', array(0))->exclude('ID', $folder->ID);

        if (!$files->count()) {
            return;
        }

        foreach ($files as $file) {
            if (file_exists($file->getFullPath())) {
                $file->ParentID = $folder->ID;
                $file->write();
                echo $file->Filename.' moved <br />';
            }
        }
    }
786592
public function run($tasks)
    {
        $tasks = is_array($tasks) ? $tasks : [$tasks];
        $queue = $this->builder->buildTasks($tasks);
        $pipeline = $this->buildPipeline($queue);

        // Wrap job in closure pipeline
        foreach ($pipeline as $key => $job) {
            $pipeline[$key] = function () use ($job) {
                return $this->executeJob($job);
            };
        }

        // Run the tasks and store the results
        if ($this->getOption('parallel')) {
            $pipeline = $this->runAsynchronously($pipeline);
        } else {
            $pipeline = $this->runSynchronously($pipeline);
        }

        return $pipeline;
    }
1226128
function chunk(int $numitems, bool $preserve_keys = false) {
        return (new self(\array_chunk($this->data, $numitems, $preserve_keys)));
    }
369625
private function findChunks(array $lines)
    {
        $arrayChunks = Utilities::pregSplitArray(
            $lines,
            '/^@@ -(\d+,\d+)|(\d+) \+(\d+,\d+)|(\d+) @@(.*)$/'
        );
        foreach ($arrayChunks as $chunkLines) {
            $this->chunks[] = new DiffChunk($chunkLines);
        }
    }
1041554
public function chunk($size)
    {
        $chunks = array_chunk($this->all(), $size);

        $chunks = array_map(function ($chunk) {
            return new static($chunk);
        }, $chunks);

        return $chunks;
    }
872579
protected function runChunk($chunkSize = 100)
    {
        for ($i = 0; $i < $chunkSize; $i++) {
            $r = $this->sendOne();
            if (!$r)
                return false;
        }
        return true;
    }
93866
public function onLoadDataContainer(string $table): void
    {
        if (!isset($GLOBALS['TL_DCA'][$table]['fields']) || !\is_array($GLOBALS['TL_DCA'][$table]['fields'])) {
            return;
        }

        $hasTagsFields = false;

        foreach ($GLOBALS['TL_DCA'][$table]['fields'] as $name => &$field) {
            if ('cfgTags' !== $field['inputType']) {
                continue;
            }

            $hasTagsFields = true;
            $manager = $this->registry->get($field['eval']['tagsManager']);

            if ($manager instanceof DcaAwareInterface) {
                $manager->updateDcaField($field);
            }
        }

        // Add assets for backend
        if (TL_MODE === 'BE' && $hasTagsFields) {
            $this->addAssets();
        }
    }
1309044
public function load(string $file, array $data = null): void
    {
        if ($data != null) {
            extract($data);
        }
        include $file;
    }