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

#98 remove StubClassSourceLocator from default setup #100

Merged
merged 1 commit into from
Aug 21, 2018

Conversation

Ocramius
Copy link
Member

This effectively reverts #74 without introducing a BC break: the class
is now deprecated, but still exists in the codebase.

The idea of the StubClassSourceLocator was that it should be possible
to analyse code even if dependency holes are present, but that is now
solved by skipping BC break checks for any reflection-based exception.

This massively simplifies things, as any missing dependency will simply
lead to a skipped error and a non-zero exit code, much like it happens
in maglnet/composer-require-checker (https://github.com/maglnet/ComposerRequireChecker).

This also fixes weird scenarios where a pre-existing class is being
looked up in a new codebase that doesn't contain it. Assuming that
following was deleted across two breaking versions:

namespace Foo;
interface Bar {}

Before this change, this breakage would not be located, because the
StubClassSourceLocator would create an implicit Foo\Bar stub, which
would therefore be considered as "not a change".

@Ocramius Ocramius added the bug label Aug 21, 2018
@Ocramius Ocramius added this to the 1.1.1 milestone Aug 21, 2018
@Ocramius Ocramius self-assigned this Aug 21, 2018
is now deprecated, but still exists in the codebase.

The idea of the `StubClassSourceLocator` was that it should be possible
to analyse code even if dependency holes are present, but that is now
solved by skipping BC break checks for any reflection-based exception.

This massively simplifies things, as any missing dependency will simply
lead to a skipped error and a non-zero exit code, much like it happens
in `maglnet/composer-require-checker` (https://github.com/maglnet/ComposerRequireChecker).

This also fixes weird scenarios where a pre-existing class is being
looked up in a new codebase that doesn't contain it. Assuming that
following was deleted across two breaking versions:

```php
namespace Foo;
interface Bar {}
```

Before this change, this breakage would not be located, because the
`StubClassSourceLocator` would create an implicit `Foo\Bar` stub, which
would therefore be considered as "not a change".
@Ocramius Ocramius force-pushed the fix/#98-remove-superfluous-class-stubbing-of-#74 branch from ab29456 to 8944487 Compare August 21, 2018 17:48
@Ocramius Ocramius assigned asgrim and unassigned Ocramius Aug 21, 2018
@Ocramius Ocramius requested a review from asgrim August 21, 2018 19:21
@asgrim asgrim merged commit 85028e0 into master Aug 21, 2018
@asgrim asgrim deleted the fix/#98-remove-superfluous-class-stubbing-of-#74 branch August 21, 2018 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants