Skip to content

Conversation

@TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Oct 20, 2017

Stub Files

Sometimes we need reflection of class that is not here.

To overcome this hard dependency on /vendor, we can prepare a stub file in format:

/stubs/Namespace.ClassName.stub

When class Namespace\ClassName and is nowhere to be found, the stub file will be used to identify it.

Thanks for inspiration to @Roave and BetterReflection: https://github.com/Roave/BetterReflection/blob/master/src/SourceLocator/Type/PhpInternalSourceLocator.php#L42-L48

@TomasVotruba TomasVotruba merged commit 5b1d08c into master Oct 20, 2017
@TomasVotruba TomasVotruba deleted the stub-fallback branch October 20, 2017 12:20
TomasVotruba added a commit that referenced this pull request May 25, 2021
rectorphp/rector-src@4f4c416 [CodeQuality] Skip UnusedForeachValueToArrayKeysRector when value used in compact (#100)
echo511 pushed a commit to echo511/rector that referenced this pull request Sep 4, 2021
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