Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions src/Rule/Rules/Composer/Psr4SourcePathsRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@ public function __construct(
) {
}

/**
* @return list<string>
*/
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';
Expand Down
10 changes: 0 additions & 10 deletions tests/Rule/Composer/Psr4SourcePathsRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Loading