Skip to content

Fix getRelativePath in SourceFinder#1918

Merged
DerManoMann merged 1 commit intozircote:masterfrom
DarkaOnLine:fix-getRelativePath-in-SourceFinder
Jan 15, 2026
Merged

Fix getRelativePath in SourceFinder#1918
DerManoMann merged 1 commit intozircote:masterfrom
DarkaOnLine:fix-getRelativePath-in-SourceFinder

Conversation

@DarkaOnLine
Copy link
Copy Markdown
Contributor

getRelativePath method was implemented incorrectly causing exclude directories being not excluded.

Before change:

Runtime:       PHP 8.4.16
Configuration: /Users/darius/Sites/swagger-php/phpunit.xml.dist

Failed asserting that an array does not have the key '/Users/darius/Sites/swagger-php/docs/examples/specs/using-traits/annotations/Decoration/Whistles.php'.
/Users/darius/Sites/swagger-php/tests/SourceFinderTest.php:33

Time: 00:03.667, Memory: 10.00 MB

There was 1 failure:

1) OpenApi\Tests\SourceFinderTest::testExclude
Failed asserting that an array does not have the key '/Users/darius/Sites/swagger-php/docs/examples/specs/using-traits/annotations/Decoration/Whistles.php'.

/Users/darius/Sites/swagger-php/tests/SourceFinderTest.php:33

FAILURES!
Tests: 1, Assertions: 2, Failures: 1.
Process finished with exit code 1

@DerManoMann DerManoMann merged commit cf33295 into zircote:master Jan 15, 2026
14 checks passed
@DerManoMann
Copy link
Copy Markdown
Collaborator

Thanks @DarkaOnLine

@github-actions
Copy link
Copy Markdown
Contributor

Created backport PR for 5.x:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-1918-to-5.x
git worktree add --checkout .worktree/backport-1918-to-5.x backport-1918-to-5.x
cd .worktree/backport-1918-to-5.x
git reset --hard HEAD^
git cherry-pick -x cf332956e6603fe4c8da6223a98b7ba65e20231e
git push --force-with-lease

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants