Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace abandoned webmozart/path-util with symfony/filesystem #1693

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions composer.json
Expand Up @@ -59,12 +59,11 @@
"sebastian/diff": "^3.0.2 || ^4.0",
"seld/jsonlint": "^1.7",
"symfony/console": "^3.4.29 || ^4.1.19 || ^5.0 || ^6.0",
"symfony/filesystem": "^3.4.29 || ^4.1.19 || ^5.0 || ^6.0",
"symfony/filesystem": "^5.4 || ^6.0",
"symfony/finder": "^3.4.29 || ^4.1.19 || ^5.0 || ^6.0",
"symfony/process": "^3.4.29 || ^4.1.19 || ^5.0 || ^6.0",
"thecodingmachine/safe": "^2.1.2",
"webmozart/assert": "^1.3",
"webmozart/path-util": "^2.3"
"webmozart/assert": "^1.3"
},
"conflict": {
"phpunit/php-code-coverage": ">9 <9.1.4",
Expand Down
68 changes: 9 additions & 59 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Configuration/ConfigurationFactory.php
Expand Up @@ -56,9 +56,9 @@
use OndraM\CiDetector\CiDetectorInterface;
use OndraM\CiDetector\Exception\CiNotDetectedException;
use function Safe\sprintf;
use Symfony\Component\Filesystem\Path;
use function sys_get_temp_dir;
use Webmozart\Assert\Assert;
use Webmozart\PathUtil\Path;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion src/Container.php
Expand Up @@ -151,8 +151,8 @@
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Path;
use Webmozart\Assert\Assert;
use Webmozart\PathUtil\Path;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion src/FileSystem/Locator/RootsFileLocator.php
Expand Up @@ -41,8 +41,8 @@
use function is_file;
use function Safe\realpath;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Path;
use Webmozart\Assert\Assert;
use Webmozart\PathUtil\Path;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion src/FileSystem/Locator/RootsFileOrDirectoryLocator.php
Expand Up @@ -40,8 +40,8 @@
use const DIRECTORY_SEPARATOR;
use function Safe\realpath;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Path;
use Webmozart\Assert\Assert;
use Webmozart\PathUtil\Path;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion src/FileSystem/TmpDirProvider.php
Expand Up @@ -38,8 +38,8 @@
use const DIRECTORY_SEPARATOR;
use function Safe\sprintf;
use function str_replace;
use Symfony\Component\Filesystem\Path;
use Webmozart\Assert\Assert;
use Webmozart\PathUtil\Path;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion src/Logger/GitHubAnnotationsLogger.php
Expand Up @@ -38,8 +38,8 @@
use Infection\Metrics\ResultsCollector;
use function Safe\shell_exec;
use function str_replace;
use Symfony\Component\Filesystem\Path;
use function trim;
use Webmozart\PathUtil\Path;

/**
* @internal
Expand Down
4 changes: 2 additions & 2 deletions src/Logger/Html/StrykerHtmlReportBuilder.php
Expand Up @@ -69,8 +69,8 @@
use function Safe\substr;
use function str_starts_with;
use function strlen;
use Symfony\Component\Filesystem\Path;
use Webmozart\Assert\Assert;
use Webmozart\PathUtil\Path;

/**
* @internal
Expand Down Expand Up @@ -162,7 +162,7 @@ private function getFiles(): ArrayObject

Assert::minCount($resultsByPath, 1, 'There must be at least one result to build HTML report.');

$basePath = Path::getLongestCommonBasePath(array_keys($resultsByPath));
$basePath = Path::getLongestCommonBasePath(...array_keys($resultsByPath));

Assert::string($basePath, '$basePath must be a string');

Expand Down
2 changes: 1 addition & 1 deletion src/TestFramework/Coverage/JUnit/JUnitReportLocator.php
Expand Up @@ -43,9 +43,9 @@
use Infection\FileSystem\Locator\FileNotFound;
use function iterator_to_array;
use function Safe\sprintf;
use Symfony\Component\Filesystem\Path;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;
use Webmozart\PathUtil\Path;

/**
* @internal
Expand Down
Expand Up @@ -43,9 +43,9 @@
use Infection\FileSystem\Locator\FileNotFound;
use function iterator_to_array;
use function Safe\sprintf;
use Symfony\Component\Filesystem\Path;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;
use Webmozart\PathUtil\Path;

/**
* @internal
Expand Down
Expand Up @@ -45,10 +45,10 @@
use function Safe\realpath;
use function Safe\sprintf;
use function str_replace;
use Symfony\Component\Filesystem\Path;
use Symfony\Component\Finder\SplFileInfo;
use function trim;
use Webmozart\Assert\Assert;
use Webmozart\PathUtil\Path;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/AutoReview/ContainerTest.php
Expand Up @@ -43,7 +43,7 @@
use function Safe\file_get_contents;
use function Safe\sprintf;
use function strpos;
use Webmozart\PathUtil\Path;
use Symfony\Component\Filesystem\Path;

final class ContainerTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/FileSystem/SourceFileCollectorTest.php
Expand Up @@ -44,7 +44,7 @@
use PHPUnit\Framework\TestCase;
use function Pipeline\take;
use function range;
use Webmozart\PathUtil\Path;
use Symfony\Component\Filesystem\Path;

final class SourceFileCollectorTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Mutator/MutatorFixturesProvider.php
Expand Up @@ -44,8 +44,8 @@
use function Safe\file_get_contents;
use function Safe\sprintf;
use function Safe\substr;
use Symfony\Component\Filesystem\Path;
use Webmozart\Assert\Assert;
use Webmozart\PathUtil\Path;

final class MutatorFixturesProvider
{
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Mutator/ProfileListProvider.php
Expand Up @@ -52,9 +52,9 @@
use function Safe\substr;
use const SORT_STRING;
use function str_replace;
use Symfony\Component\Filesystem\Path;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;
use Webmozart\PathUtil\Path;

final class ProfileListProvider
{
Expand Down
Expand Up @@ -46,7 +46,7 @@
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use function Safe\sprintf;
use Webmozart\PathUtil\Path;
use Symfony\Component\Filesystem\Path;

/**
* All these tests should be ran in separate processes, as otherwise they may rely
Expand Down
Expand Up @@ -49,8 +49,8 @@
use function Safe\realpath;
use function Safe\sprintf;
use function str_replace;
use Symfony\Component\Filesystem\Path;
use Traversable;
use Webmozart\PathUtil\Path;

/**
* @group integration
Expand Down
Expand Up @@ -40,7 +40,7 @@
use Infection\Tests\Fixtures\TestFramework\PhpUnit\Coverage\XmlCoverageFixtures;
use PHPUnit\Framework\TestCase;
use function Safe\sprintf;
use Webmozart\PathUtil\Path;
use Symfony\Component\Filesystem\Path;

/**
* @group integration
Expand Down
Expand Up @@ -51,7 +51,7 @@
use function set_error_handler;
use function str_replace;
use Symfony\Component\Filesystem\Filesystem;
use Webmozart\PathUtil\Path;
use Symfony\Component\Filesystem\Path;

/**
* @group integration
Expand Down