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

Add Compiler as a container service #29

Merged
merged 5 commits into from
Nov 4, 2020
Merged

Conversation

weierophinney
Copy link
Contributor

This patch adds the PhlyBlog\Compiler class as a service to the DI container, with a factory for creating it, and modifies the CompileCommand to optionally accept a Compiler instance to its constructor.
The CompileCommandFactory now pulls the Compiler service to inject it into the CompileCommand as well.
These changes allow users to add a delegator factory in order to listen to the compile event.

Fixes #28

@weierophinney weierophinney added this to the 2.1.0 milestone Nov 4, 2020
@weierophinney weierophinney self-assigned this Nov 4, 2020
Adds a factory for the `Compiler` class, and adds it to the `ConfigProvider`.
Simplifies logic in the `PhpFileFilter` and makes the exceptions it throws for non-existent directories more specific.
If not present, defaults to hard-coding one.

`CompileCommandFactory` now pulls the `Compiler` from the container when creating the command instance.
The PHPUnit workflow uses Composer to install deps, which is now on v2.
As such:

- We need to allow usage of laminas-dependency-plugin v2.
- We need to remove the `--no-suggest` option from  composer invocation.
Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
@github-actions
Copy link

github-actions bot commented Nov 4, 2020

Coverage Report

Totals Coverage
Statements: 75.57% ( 767 / 1015 )
Methods: 70.43% ( 162 / 230 )

@weierophinney weierophinney merged commit a850c1f into 2.1.x Nov 4, 2020
@weierophinney weierophinney deleted the feature/compiler-service branch November 4, 2020 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delegator can't able to intercept compiler command.
1 participant