%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home2/vacivi36/code/vendor/rector/rector/packages/Testing/Fixture/
Upload File :
Create Path :
Current File : //home2/vacivi36/code/vendor/rector/rector/packages/Testing/Fixture/FixtureSplitter.php

<?php

declare (strict_types=1);
namespace Rector\Testing\Fixture;

use RectorPrefix202209\Nette\Utils\FileSystem;
use RectorPrefix202209\Nette\Utils\Strings;
use RectorPrefix202209\Webmozart\Assert\Assert;
final class FixtureSplitter
{
    /**
     * @var string
     * @see https://regex101.com/r/zZDoyy/1
     */
    public const SPLIT_LINE_REGEX = '#\\-\\-\\-\\-\\-\\r?\\n#';
    /**
     * @return array<string, string>
     */
    public static function loadFileAndSplitInputAndExpected(string $filePath) : array
    {
        Assert::fileExists($filePath);
        $fixtureFileContents = FileSystem::read($filePath);
        return Strings::split($fixtureFileContents, self::SPLIT_LINE_REGEX);
    }
}

Zerion Mini Shell 1.0