ok

Mini Shell

Direktori : /home2/selectio/public_html/fms-worksuite/vendor/phpro/grumphp/src/Locator/
Upload File :
Current File : /home2/selectio/public_html/fms-worksuite/vendor/phpro/grumphp/src/Locator/StdInFiles.php

<?php

declare(strict_types=1);

namespace GrumPHP\Locator;

use GrumPHP\Collection\FilesCollection;

class StdInFiles
{
    /**
     * @var ChangedFiles
     */
    private $changedFilesLocator;

    /**
     * @var ListedFiles
     */
    private $listedFiles;

    public function __construct(
        ChangedFiles $changedFilesLocator,
        ListedFiles $listedFiles
    ) {
        $this->changedFilesLocator = $changedFilesLocator;
        $this->listedFiles = $listedFiles;
    }

    public function locate(string $stdIn): FilesCollection
    {
        if (preg_match('/^diff --git/', $stdIn)) {
            return $this->changedFilesLocator->locateFromRawDiffInput($stdIn);
        }

        return $this->listedFiles->locate($stdIn);
    }
}

Zerion Mini Shell 1.0