From b9bd414bd3ffd0a9cbfb0ff24a6c0a7616433d5f Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Tue, 19 Mar 2019 09:29:01 +0100 Subject: [PATCH 1/2] Reverting BC break - ` : void` return type hint cannot be added to open classes/interfaces (yet) --- phpcs.xml.dist | 3 +++ .../AccessInterceptorScopeLocalizerGenerator.php | 4 +++- .../ProxyGenerator/AccessInterceptorValueHolderGenerator.php | 4 +++- src/ProxyManager/ProxyGenerator/LazyLoadingGhostGenerator.php | 4 +++- .../ProxyGenerator/LazyLoadingValueHolderGenerator.php | 4 +++- src/ProxyManager/ProxyGenerator/ProxyGeneratorInterface.php | 4 +++- src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php | 4 +++- src/ProxyManager/Signature/SignatureCheckerInterface.php | 4 +++- 8 files changed, 24 insertions(+), 7 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 13f5437e8..7ec266854 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -21,5 +21,8 @@ + + + diff --git a/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizerGenerator.php b/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizerGenerator.php index bd805e0bd..391de777c 100644 --- a/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizerGenerator.php +++ b/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizerGenerator.php @@ -44,8 +44,10 @@ class AccessInterceptorScopeLocalizerGenerator implements ProxyGeneratorInterfac * * @throws InvalidArgumentException * @throws InvalidProxiedClassException + * + * @return void */ - public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) : void + public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) { CanProxyAssertion::assertClassCanBeProxied($originalClass, false); diff --git a/src/ProxyManager/ProxyGenerator/AccessInterceptorValueHolderGenerator.php b/src/ProxyManager/ProxyGenerator/AccessInterceptorValueHolderGenerator.php index 96d1989a8..87e6a64f5 100644 --- a/src/ProxyManager/ProxyGenerator/AccessInterceptorValueHolderGenerator.php +++ b/src/ProxyManager/ProxyGenerator/AccessInterceptorValueHolderGenerator.php @@ -49,8 +49,10 @@ class AccessInterceptorValueHolderGenerator implements ProxyGeneratorInterface * * @throws InvalidArgumentException * @throws InvalidProxiedClassException + * + * @return void */ - public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) : void + public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) { CanProxyAssertion::assertClassCanBeProxied($originalClass); diff --git a/src/ProxyManager/ProxyGenerator/LazyLoadingGhostGenerator.php b/src/ProxyManager/ProxyGenerator/LazyLoadingGhostGenerator.php index c55617389..27da197b9 100644 --- a/src/ProxyManager/ProxyGenerator/LazyLoadingGhostGenerator.php +++ b/src/ProxyManager/ProxyGenerator/LazyLoadingGhostGenerator.php @@ -49,8 +49,10 @@ class LazyLoadingGhostGenerator implements ProxyGeneratorInterface * * @throws InvalidProxiedClassException * @throws InvalidArgumentException + * + * @return void */ - public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator, array $proxyOptions = []) : void + public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator, array $proxyOptions = []) { CanProxyAssertion::assertClassCanBeProxied($originalClass, false); diff --git a/src/ProxyManager/ProxyGenerator/LazyLoadingValueHolderGenerator.php b/src/ProxyManager/ProxyGenerator/LazyLoadingValueHolderGenerator.php index 864b28c90..d59dc6f1f 100644 --- a/src/ProxyManager/ProxyGenerator/LazyLoadingValueHolderGenerator.php +++ b/src/ProxyManager/ProxyGenerator/LazyLoadingValueHolderGenerator.php @@ -49,8 +49,10 @@ class LazyLoadingValueHolderGenerator implements ProxyGeneratorInterface * * @throws InvalidProxiedClassException * @throws InvalidArgumentException + * + * @return void */ - public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) : void + public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) { CanProxyAssertion::assertClassCanBeProxied($originalClass); diff --git a/src/ProxyManager/ProxyGenerator/ProxyGeneratorInterface.php b/src/ProxyManager/ProxyGenerator/ProxyGeneratorInterface.php index dd75e54d8..6fd163401 100644 --- a/src/ProxyManager/ProxyGenerator/ProxyGeneratorInterface.php +++ b/src/ProxyManager/ProxyGenerator/ProxyGeneratorInterface.php @@ -15,6 +15,8 @@ interface ProxyGeneratorInterface { /** * Apply modifications to the provided $classGenerator to proxy logic from $originalClass + * + * @return void */ - public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) : void; + public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator); } diff --git a/src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php b/src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php index fb05b2661..3ebf8e828 100644 --- a/src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php +++ b/src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php @@ -37,8 +37,10 @@ class RemoteObjectGenerator implements ProxyGeneratorInterface * * @throws InvalidProxiedClassException * @throws InvalidArgumentException + * + * @return void */ - public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) : void + public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) { CanProxyAssertion::assertClassCanBeProxied($originalClass); diff --git a/src/ProxyManager/Signature/SignatureCheckerInterface.php b/src/ProxyManager/Signature/SignatureCheckerInterface.php index 619f13175..9a517f3ba 100644 --- a/src/ProxyManager/Signature/SignatureCheckerInterface.php +++ b/src/ProxyManager/Signature/SignatureCheckerInterface.php @@ -20,6 +20,8 @@ interface SignatureCheckerInterface * * @throws InvalidSignatureException * @throws MissingSignatureException + * + * @return void */ - public function checkSignature(ReflectionClass $class, array $parameters) : void; + public function checkSignature(ReflectionClass $class, array $parameters); } From b6214b92c1d3d9fbd87d06d3160f055f0ba2a662 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Tue, 19 Mar 2019 09:31:51 +0100 Subject: [PATCH 2/2] Re-ordered annotations as per CS rules --- .../AccessInterceptorScopeLocalizerGenerator.php | 4 ++-- .../ProxyGenerator/AccessInterceptorValueHolderGenerator.php | 4 ++-- src/ProxyManager/ProxyGenerator/LazyLoadingGhostGenerator.php | 4 ++-- .../ProxyGenerator/LazyLoadingValueHolderGenerator.php | 4 ++-- src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php | 4 ++-- src/ProxyManager/Signature/SignatureCheckerInterface.php | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizerGenerator.php b/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizerGenerator.php index 391de777c..a0834dfe4 100644 --- a/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizerGenerator.php +++ b/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizerGenerator.php @@ -42,10 +42,10 @@ class AccessInterceptorScopeLocalizerGenerator implements ProxyGeneratorInterfac /** * {@inheritDoc} * + * @return void + * * @throws InvalidArgumentException * @throws InvalidProxiedClassException - * - * @return void */ public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) { diff --git a/src/ProxyManager/ProxyGenerator/AccessInterceptorValueHolderGenerator.php b/src/ProxyManager/ProxyGenerator/AccessInterceptorValueHolderGenerator.php index 87e6a64f5..4b06db980 100644 --- a/src/ProxyManager/ProxyGenerator/AccessInterceptorValueHolderGenerator.php +++ b/src/ProxyManager/ProxyGenerator/AccessInterceptorValueHolderGenerator.php @@ -47,10 +47,10 @@ class AccessInterceptorValueHolderGenerator implements ProxyGeneratorInterface /** * {@inheritDoc} * + * @return void + * * @throws InvalidArgumentException * @throws InvalidProxiedClassException - * - * @return void */ public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) { diff --git a/src/ProxyManager/ProxyGenerator/LazyLoadingGhostGenerator.php b/src/ProxyManager/ProxyGenerator/LazyLoadingGhostGenerator.php index 27da197b9..ab42e749e 100644 --- a/src/ProxyManager/ProxyGenerator/LazyLoadingGhostGenerator.php +++ b/src/ProxyManager/ProxyGenerator/LazyLoadingGhostGenerator.php @@ -47,10 +47,10 @@ class LazyLoadingGhostGenerator implements ProxyGeneratorInterface /** * {@inheritDoc} * + * @return void + * * @throws InvalidProxiedClassException * @throws InvalidArgumentException - * - * @return void */ public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator, array $proxyOptions = []) { diff --git a/src/ProxyManager/ProxyGenerator/LazyLoadingValueHolderGenerator.php b/src/ProxyManager/ProxyGenerator/LazyLoadingValueHolderGenerator.php index d59dc6f1f..1d52406a1 100644 --- a/src/ProxyManager/ProxyGenerator/LazyLoadingValueHolderGenerator.php +++ b/src/ProxyManager/ProxyGenerator/LazyLoadingValueHolderGenerator.php @@ -47,10 +47,10 @@ class LazyLoadingValueHolderGenerator implements ProxyGeneratorInterface /** * {@inheritDoc} * + * @return void + * * @throws InvalidProxiedClassException * @throws InvalidArgumentException - * - * @return void */ public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) { diff --git a/src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php b/src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php index 3ebf8e828..539b4f464 100644 --- a/src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php +++ b/src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php @@ -35,10 +35,10 @@ class RemoteObjectGenerator implements ProxyGeneratorInterface /** * {@inheritDoc} * + * @return void + * * @throws InvalidProxiedClassException * @throws InvalidArgumentException - * - * @return void */ public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) { diff --git a/src/ProxyManager/Signature/SignatureCheckerInterface.php b/src/ProxyManager/Signature/SignatureCheckerInterface.php index 9a517f3ba..e2fc014a5 100644 --- a/src/ProxyManager/Signature/SignatureCheckerInterface.php +++ b/src/ProxyManager/Signature/SignatureCheckerInterface.php @@ -18,10 +18,10 @@ interface SignatureCheckerInterface * * @param mixed[] $parameters * + * @return void + * * @throws InvalidSignatureException * @throws MissingSignatureException - * - * @return void */ public function checkSignature(ReflectionClass $class, array $parameters); }