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

[BC Break] Internal container refactoring. #501

Merged
merged 1 commit into from
Apr 14, 2024

Conversation

lisachenko
Copy link
Member

New version drops the GoAspectContainer class and rely just on Container class now.
Container uses now generic methods, so IDE and PhpStan aware about types now.
Tags have been replaced with interface names, which simplifies usage of marker interfaces.
All unnecessary string variables were replaced with class FQN.
No more special methods to register advisors or pointcuts - they are just values in container.

New version drops GoAspectContainer class and rely just on Container class now.
Container uses now generic methods, so IDE and PhpStan aware about types now.
Tags have been replaced with interface names, which simplifies usage of marker interfaces.
All unnecessary string variables were replaced with class FQN.
No more special methods to register advisors or pointcuts - they are just values in container.
@lisachenko lisachenko added this to the 4.0.0 milestone Apr 14, 2024
@scrutinizer-notifier
Copy link

A new inspection was created.

{
$this->loaders[] = $loader;
public function __construct(
protected AspectContainer $container,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 4 spaces, found 8

@@ -83,7 +80,7 @@ protected function getAdvice(
$interceptorAttribute instanceof After => new AfterInterceptor($adviceCallback, $adviceOrder, $pointcutExpression),
$interceptorAttribute instanceof Around => new AroundInterceptor($adviceCallback, $adviceOrder, $pointcutExpression),
$interceptorAttribute instanceof AfterThrowing => new AfterThrowingInterceptor($adviceCallback, $adviceOrder, $pointcutExpression),
default => throw new UnexpectedValueException('Unsupported method meta class: ' . get_class($interceptorAttribute)),
default => throw new UnexpectedValueException('Unsupported method meta class: ' . $interceptorAttribute::class),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 12

$result[$id] = $this->get($id);
}
}
$this->add($id, function (self $container) use ($id, $lazyDefinitionClosure): object {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected 1 space after closing parenthesis; found 0

@lisachenko lisachenko merged commit 5d7e1ad into master Apr 14, 2024
10 of 11 checks passed
@lisachenko lisachenko deleted the feature/container-refactoring branch April 14, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants