diff --git a/src/Rule/Rules/Composer/Psr4SourcePathsRule.php b/src/Rule/Rules/Composer/Psr4SourcePathsRule.php index 88abecfb..8f8b2fe2 100644 --- a/src/Rule/Rules/Composer/Psr4SourcePathsRule.php +++ b/src/Rule/Rules/Composer/Psr4SourcePathsRule.php @@ -32,18 +32,6 @@ public function __construct( ) { } - /** - * @return list - */ - public function sourcePathsFor(string $basePath): array - { - if ($this->sourcePaths === null) { - return $this->psr4PathResolver->paths($basePath); - } - - return $this->normalisePaths($this->sourcePaths, $basePath); - } - public function evaluateProject(string $basePath, Architecture $architecture, array $skipPaths = []): ?RuleViolation { $composerFile = rtrim($basePath, '/') . '/composer.json'; diff --git a/tests/Rule/Composer/Psr4SourcePathsRuleTest.php b/tests/Rule/Composer/Psr4SourcePathsRuleTest.php index 33528c5b..34be7cd7 100644 --- a/tests/Rule/Composer/Psr4SourcePathsRuleTest.php +++ b/tests/Rule/Composer/Psr4SourcePathsRuleTest.php @@ -157,14 +157,6 @@ public function testReadsSourcePathsFromComposerWhenSourcePathsAreNotConfigured( RuleViolation::class, $psr4SourcePathsRule->evaluateProject($basePath, Architecture::define()) ); - $this->assertSame(['app', 'tests', 'specs'], $psr4SourcePathsRule->sourcePathsFor($basePath)); - } - - public function testNormalisesExplicitSourcePaths(): void - { - $psr4SourcePathsRule = new Psr4SourcePathsRule([' src/ ', 'tests\\']); - - $this->assertSame(['src', 'tests'], $psr4SourcePathsRule->sourcePathsFor($this->makeTempDir())); } public function testPassesWhenDotRelativeSourcePathsExistInComposerPsr4Autoloads(): void @@ -190,7 +182,6 @@ public function testPassesWhenDotRelativeSourcePathsExistInComposerPsr4Autoloads RuleViolation::class, $psr4SourcePathsRule->evaluateProject($basePath, Architecture::define()) ); - $this->assertSame(['src', 'tests'], $psr4SourcePathsRule->sourcePathsFor($basePath)); } public function testPassesWhenAbsoluteSourcePathsExistInComposerPsr4Autoloads(): void @@ -216,7 +207,6 @@ public function testPassesWhenAbsoluteSourcePathsExistInComposerPsr4Autoloads(): RuleViolation::class, $psr4SourcePathsRule->evaluateProject($basePath, Architecture::define()) ); - $this->assertSame(['src', 'tests'], $psr4SourcePathsRule->sourcePathsFor($basePath)); } public function testPassesWhenComposerUsesAbsoluteSourcePath(): void