@param string $source

@return \SplFileInfo[]
512730
public function all(string $source): iterable
    {
        $this->consoleLogger
            ->debug("Task source path '<info>${source}</info>'");

        if (!\file_exists($source)) {
            return [];
        }

        $suffix = $this->configuration
            ->get('suffix')
        ;

        $this->consoleLogger
            ->debug("Task finder suffix: '<info>{$suffix}</info>'");

        $realPath = \realpath($source);
        if (false !== $realPath) {
            $this->consoleLogger
                ->verbose("Realpath for '<info>{$source}</info>' is '<info>{$realPath}</info>'");
        } else {
            $this->consoleLogger
                ->verbose("Realpath resolve for '<info>{$source}</info>' failed.");
        }

        $tasks = $this->finder
            ->find(Path::fromStrings($source), $suffix)
        ;
        $tasksCount = \count($tasks);

        $this->consoleLogger
            ->debug("Found <info>{$tasksCount}</info> task(s) at path '<info>{$source}</info>'");

        return $tasks;
    }
519469
public function joinToSql(string $source = null): array
    {
        if ($clause = $this->getJoinStrategy()) {
            return $clause->joinToSql($source);
        }

        return ['', []];
    }
1044999
public function readSource($source)
    {
        $document = new \DOMDocument();
        $errorToExceptionContext = new ErrorToExceptionContext(E_WARNING, function () use ($source, $document) {
            $document->loadXML($source);
        });
        $errorToExceptionContext->invoke();

        return $this->readDocument($document);
    }
655321
protected function toConfigArray($source, $nodeName)
    {
        $items = [];
        $config = $source->getElementsByTagName($nodeName);
        
        foreach($config as $configNode) {
            $item = [];
            foreach($configNode->attributes as $attribute) {
                $item[$attribute->name] = $attribute->value;
            }
            $items []= $item;
        }

        return $items;
    }
316823
private function sourcesToPatterns(string $sources): array
  {
    if (substr($sources, 0, 5)=='file:')
    {
      $patterns = $this->readPatterns(substr($sources, 5));
    }
    else
    {
      $patterns = [$sources];
    }

    return $patterns;
  }
751714
public function exportCookies( $source )
  {
    $cookies = array();

    if ( preg_match_all( '#Set-Cookie:\s*([^=]+)=([^;]+)#i', $source, $matches ) )
    {
      for ( $i = 0, $cnt = count( $matches[ 1 ] ); $i < $cnt; ++$i )
      {
        $cookies[ trim( $matches[ 1 ][ $i ] ) ] = trim( $matches[ 2 ][ $i ] );
      }
    }

    return $cookies;
  }
1085321
public function getAllFiles($sources)
    {
        $files = array();
        foreach ($sources as $source) {
            if (!is_dir($source)) {
                $files[] = $source;
                continue;
            }

            $recursiveFiles = new RecursiveIteratorIterator(
                new RecursiveDirectoryIterator($source)
            );
            foreach ($recursiveFiles as $file) {
                if ($file->isDir()) {
                    continue;
                }

                $path = $file->getPathname();
                $info = pathinfo(basename($path));

                if (array_key_exists('extension', $info) && $info['extension'] == 'php') {
                    $files[] = $path;
                }
            }
        }

        return $files;
    }
368062
private function reformatArray($source)
    {
        $result = array();

        foreach ($source as $data) {
            $result[$data[0]] = (isset($data[1])) ? $data[1] : '';
        }

        return $result;
    }
773652
public function convert($source)
    {
        $output = [];
        $xpath = new \DOMXPath($source);
        $this->metadata = [];

        /** @var $node \DOMNode */
        foreach ($xpath->query(implode(' | ', $this->nodeMap)) as $node) {
            $output = array_merge($output, $this->convertNode($node));
        }

        $result = ['data' => $output, 'metadata' => $this->metadata];

        return $result;
    }
776309
public function findSources(string $sources): array
  {
    $patterns = $this->sourcesToPatterns($sources);

    $sources = [];
    foreach ($patterns as $pattern)
    {
      $tmp     = $this->findSourcesInPattern($pattern);
      $sources = array_merge($sources, $tmp);
    }

    $sources = array_unique($sources);
    sort($sources);

    return $sources;
  }
164059
public function get_file_source_info($source) {
        global $USER;
        list($type, $fileid, $filename) = $this->split_part($source);
        return 'Box ('. fullname($USER) . '): ' . $filename;
    }
452169
public function getSourceChildPropertiesToBeConverted($source)
    {
        $gettableProperties = ObjectAccess::getGettableProperties($source);
        $propertiesToConvert = [];
        foreach ($gettableProperties as $propertyName => $gettableProperty) {
            if (is_object($gettableProperty)) {
                $propertiesToConvert[$propertyName] = $gettableProperty;
            }
        }

        return $propertiesToConvert;
    }
12162
public function read(string $filename): array
    {
        $lines = ['total' => 0, 'read' => 0];

        // Open file as SPL object
        $file = new \SplFileObject($filename);

        // Read line by line
        while (!$file->eof()) {
            $line = $file->fgets();
            // Save line only of not empty
            if ($this->isLine($line) && \strlen($line) > 1) {
                $line = trim(preg_replace('/\s+/', ' ', $line));
                $this->_lines[] = $line;
                $lines['read']++;
            }
            $lines['total']++;
        }
        return $lines;
    }
548134
protected function findDataSource($source)
    {
        foreach ($this->dataSources as $dataSource) {
            if ($dataSource->supports($source)) {
                return $dataSource;
            }
        }

        throw new \RuntimeException('Unknown source type');
    }
13961
protected function getSourceAsArray($source)
    {
        if (!is_array($source) && !($source instanceof ArrayAccess)) {
            user_error('$source passed in as invalid type', E_USER_ERROR);
        }
        
        if ($source instanceof SS_List || $source instanceof Map) {
            $source = $source->toArray();
        }
        
        return $source;
    }
1325402
public function getGpgInfo($version)
    {
        $phpRelease = preg_replace('~^(\d+\.\d+)\.\d+$~', '\1', $this->resolveVersion($version));

        if (!isset($this->gpgKeys[$phpRelease])) {
            return [];
        }

        return $this->gpgKeys[$phpRelease];
    }
76860
protected function extractSourceFilename($source)
    {
        $sourceFIle = preg_replace("/'/", "", $source[1]);
        if (preg_match('/\#/', $sourceFIle)) {
            $sourceFIle = explode("#", $sourceFIle);
            $sourceFIle = $sourceFIle[0];
        }
        if (preg_match('/\?/', $sourceFIle)) {
            $sourceFIle = explode("?", $sourceFIle);
            $sourceFIle = $sourceFIle[0];
            return $sourceFIle;
        }
        return $sourceFIle;
    }