@param string[] $paths

@return string
340725
private function getLongestPath($paths)
    {
        return array_reduce($paths, function ($a, $b) {
            return strlen($a) > strlen($b) ? $a : $b;
        });

//        return max(array_map('strlen', $paths));
    }
1311988
public function setPaths(array $paths)
    {
        foreach ($paths as $value) {
            $this->ensureString(
                $value,
                'All the elements from array must be strings'
            );
        }

        $this->paths = $paths;

        return $this;
    }
122708
private function configComposerRepositoryPaths(array $paths)
    {
        $paths = array_merge([''], $paths);

        array_map(function ($path, $index) {
            $command = sprintf(
                'config repositories.codeception%1$d \'{"type":"path","url":"%2$s","options":{"symlink":%3$s}}\'',
                $index,
                codecept_root_dir($path),
                $this->_getConfig('symlink')
            );

            $this->runComposerCommand($command);
        }, $paths, array_keys($paths));
    }
2546
protected function _isWriteable($paths)
    {
        foreach ((array)$paths as $path) {
            $result[$path] = is_writable_resursive($path);
        }

        return $result;
    }
311848
public static function create($paths)
    {
        $backends = array(
            new Backend\Inotifywait($paths),
            new Backend\Fswatch($paths),
            new Backend\Watchmedo($paths),
            new Backend\Inotify($paths),
            new Backend\Poll($paths),
        );
        foreach ($backends as $b) {
            if ($b->isAvailable()) {
                $backend = $b;
                break;
            }
        }
        return $backend;
    }
828905
protected function streamlineFilePaths(array $paths): array
    {
        $paths = \array_map(function ($url) {
            if (!GeneralUtility::isValidUrl($url) && ':' !== $url[0]) {
                $url = GeneralUtility::locationHeaderUrl($url);
            }

            return $url;
        }, $paths);

        $paths = \array_filter($paths, function ($path) {
            return GeneralUtility::isOnCurrentHost($path) && ':' !== $path[0];
        });

        $paths = \array_map(function ($url) {
            return '/' . \ltrim(\str_replace(GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST'), '', $url), '/');
        }, $paths);

        return $paths;
    }
550084
public function processMultiplePaths($paths)
    {
        $paths = $this->parseAsArray($paths);
        $paths = array_map([ $this, 'filterPath' ], $paths);
        $paths = array_filter($paths, [ $this, 'pathExists' ]);

        if ($paths === false) {
            throw new InvalidArgumentException('Received invalid paths.');
        }

        if (empty($paths)) {
            throw new InvalidArgumentException('Received empty paths.');
        }

        return $paths;
    }
1373586
public function delete($paths)
		{
			$paths = Arrays::is($paths) ? $paths : func_get_args();

			$success = true;

			foreach ($paths as $path) { if ( ! @unlink($path)) $success = false; }

			return $success;
		}
223042
public function controllersToRemove(array $paths): self
    {
        $absoluteGlobPaths = array_map(function ($globPath) {
            return $this->localProjectDir.DIRECTORY_SEPARATOR.$globPath;
        }, $paths);

        $localAbsolutePaths = [];
        foreach ($absoluteGlobPaths as $path) {
            $localAbsolutePaths = array_merge($localAbsolutePaths, glob($path));
        }

        $localRelativePaths = array_map(function ($absolutePath) {
            $relativePath = str_replace($this->localProjectDir, '', $absolutePath);
            $this->validatePathIsRelativeToProject($relativePath, 'controllersToRemove');

            return trim($relativePath, DIRECTORY_SEPARATOR);
        }, $localAbsolutePaths);

        $this->controllersToRemove = $localRelativePaths;

        return $this;
    }
252410
public function getMultipleChildren(array $paths)
    {
        $objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths);
        $children = [];
        foreach ($objs as $obj) {
            $obj['acl'] = $this->getChildACL();
            $children[] = new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
        }

        return $children;
    }
531927
private function determineMostCommonBaseAppPath($paths)
    {
        $paths = array_values($paths);

        $options = [];
        $options[] = Path::getLongestCommonBasePath($paths);
        if (isset($paths[1])) {
            $options[] = Path::getLongestCommonBasePath([$paths[0], $paths[1]]);
        }
        if (isset($paths[2])) {
            $options[] = Path::getLongestCommonBasePath([$paths[1], $paths[2]]);
            $options[] = Path::getLongestCommonBasePath([$paths[0], $paths[2]]);
        }
        rsort($options);

        return reset($options);
    }
1294885
public function createMap(...$paths)
    {
        $classes = [];

        $this->finder->files()
            ->ignoreUnreadableDirs()
            ->in($paths);

        foreach($this->excludePathPatterns as $exclude)
        {
            $this->finder->notPath($exclude);
        }

        foreach($this->inPathPatterns as $inPath)
        {
            $this->finder->path($inPath);
        }

        foreach($this->names as $name)
        {
            $this->finder->name($name);
        }

        /** @var SplFileInfo $file */
        foreach ($this->finder as $file) {
            $content = file_get_contents($file->getPathname());

            preg_match('^\s*class ([\S]*)\s*(extends|implements|{)^', $content, $match, PREG_OFFSET_CAPTURE);

            if (isset($match[1])) {
                $className = '\\'. trim($match[1][0]);
                $offset = $match[1][1];
            } else {
                continue;
            }

            preg_match('|\s*namespace\s*([\S]*)\s*;|', substr($content, 0 , $offset), $match);

            if (isset($match[1]) && trim($match[1]) !== '') {
                $className = '\\' . trim($match[1]) . $className;
            }

            if ($className !== '\\') {
                $classes[$file->getPathname()] = $className;
            }
        }

        return $classes;
    }
36322
public function toUri(array $pathVars = []): string
    {
        if ($pathVars) {
            return \strtr($this->path, $pathVars);
        }

        return $this->path;
    }
826347
public static function path(...$paths)
    {
        $protocol = '';
        $path = trim(implode(DIRECTORY_SEPARATOR, $paths));
        if (preg_match('@^([a-z0-9]+://|/)(.*)@i', $path, $m)) {
            $protocol = $m[1];
            $path = $m[2];
        }
        $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
        $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');
        $absolutes = [];
        foreach ($parts as $part) {
            if ('.' == $part) {
                continue;
            }
            if ('..' == $part) {
                array_pop($absolutes);
            } else {
                $absolutes[] = $part;
            }
        }
        $path = implode(DIRECTORY_SEPARATOR, $absolutes);
        if (DIRECTORY_SEPARATOR == '\\' && isset($protocol[4])) {
            $path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
        }
        return $protocol . $path;
    }
994657
protected function fixRelativePaths(array $paths)
    {
        $base = dirname($this->path);
        $base = ($base === '.') ? '' : "{$base}/";

        array_walk_recursive(
            $paths,
            function (&$path) use ($base) {
                $path = "{$base}{$path}";
            }
        );
        return $paths;
    }
1078576
public function withIncludedPaths(iterable $paths): EncoderInterface
    {
        \assert(
            \call_user_func(
                function (array $paths): bool {
                    $pathsOk = true;
                    foreach ($paths as $path) {
                        $pathsOk = $pathsOk === true && \is_string($path) === true && empty($path) === false;
                    }

                    return $pathsOk;
                },
                $paths
            )
        );

        $this->includePaths = $paths;

        return $this;
    }
602458
public function _normalizePaths($paths = [])
    {
        $routePaths = [];

        if ($paths === null) {
            return ['controller' => 'index', 'action' => 'index'];
        } elseif (is_string($paths)) {
            if (($pos = strpos($paths, '::')) !== false) {
                $routePaths['controller'] = substr($paths, 0, $pos);
                $routePaths['action'] = substr($paths, $pos + 2);
            } else {
                $routePaths['controller'] = $paths;
                $routePaths['action'] = 'index';
            }
        } elseif (is_array($paths)) {
            if (isset($paths['area'])) {
                $routePaths['area'] = $paths['area'];
            }

            if (isset($paths['controller'])) {
                $routePaths['controller'] = $paths['controller'];
            } elseif (isset($paths[0])) {
                $routePaths['controller'] = $paths[0];
            } else {
                $routePaths['controller'] = 'index';
            }

            if (isset($paths['action'])) {
                $routePaths['action'] = $paths['action'];
            } elseif (isset($paths[1])) {
                $routePaths['action'] = $paths[1];
            } else {
                $routePaths['action'] = 'index';
            }

            $params = [];
            /** @noinspection ForeachSourceInspection */
            foreach ($paths as $k => $v) {
                if (is_string($k) && !in_array($k, ['area', 'controller', 'action'], true)) {
                    $params[$k] = $v;
                }
            }

            if ($params) {
                $routePaths['params'] = $params;
            }
        }

        if (isset($routePaths['controller']) && strpos($routePaths['controller'], '\\') !== false) {
            $controller = strtr($routePaths['controller'], '\\', '/');

            if (substr_count($controller, '/') === 2) {
                $routePaths['controller'] = basename($controller, 'Controller');
            } elseif (preg_match('#(?:/Controllers/([^/]+)/(\w+)Controller)|(?:/Areas/([^/]+)/Controllers/(\w+)Controller)$#', $controller, $match)) {
                if (isset($match[3])) {
                    $routePaths['area'] = $match[3];
                    $routePaths['controller'] = $match[4];
                } else {
                    $routePaths['area'] = $match[1];
                    $routePaths['controller'] = $match[2];
                }
            } else {
                $routePaths['controller'] = basename($controller, 'Controller');
            }
        }

        return $routePaths;
    }