Skip to content

Commit

Permalink
Merge pull request #452 from Ocramius/fix/revert-void-return-type-bc-…
Browse files Browse the repository at this point in the history
…break

Revert BC break - `: void` cannot be added as return type to open classes
  • Loading branch information
Ocramius authored Mar 19, 2019
2 parents 10e0eb0 + b6214b9 commit 3be0722
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 7 deletions.
3 changes: 3 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
<exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming.SuperfluousSuffix"/>
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming.SuperfluousSuffix"/>
<exclude name="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming.SuperfluousPrefix"/>

<!-- we cannot enforce the " : void" return type hint due to BC compliance, for now -->
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint"/>
</rule>
</ruleset>
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ class AccessInterceptorScopeLocalizerGenerator implements ProxyGeneratorInterfac
/**
* {@inheritDoc}
*
* @return void
*
* @throws InvalidArgumentException
* @throws InvalidProxiedClassException
*/
public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) : void
public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator)
{
CanProxyAssertion::assertClassCanBeProxied($originalClass, false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ class AccessInterceptorValueHolderGenerator implements ProxyGeneratorInterface
/**
* {@inheritDoc}
*
* @return void
*
* @throws InvalidArgumentException
* @throws InvalidProxiedClassException
*/
public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) : void
public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator)
{
CanProxyAssertion::assertClassCanBeProxied($originalClass);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ class LazyLoadingGhostGenerator implements ProxyGeneratorInterface
/**
* {@inheritDoc}
*
* @return void
*
* @throws InvalidProxiedClassException
* @throws InvalidArgumentException
*/
public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator, array $proxyOptions = []) : void
public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator, array $proxyOptions = [])
{
CanProxyAssertion::assertClassCanBeProxied($originalClass, false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ class LazyLoadingValueHolderGenerator implements ProxyGeneratorInterface
/**
* {@inheritDoc}
*
* @return void
*
* @throws InvalidProxiedClassException
* @throws InvalidArgumentException
*/
public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) : void
public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator)
{
CanProxyAssertion::assertClassCanBeProxied($originalClass);

Expand Down
4 changes: 3 additions & 1 deletion src/ProxyManager/ProxyGenerator/ProxyGeneratorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
4 changes: 3 additions & 1 deletion src/ProxyManager/ProxyGenerator/RemoteObjectGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ class RemoteObjectGenerator implements ProxyGeneratorInterface
/**
* {@inheritDoc}
*
* @return void
*
* @throws InvalidProxiedClassException
* @throws InvalidArgumentException
*/
public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator) : void
public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator)
{
CanProxyAssertion::assertClassCanBeProxied($originalClass);

Expand Down
4 changes: 3 additions & 1 deletion src/ProxyManager/Signature/SignatureCheckerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ interface SignatureCheckerInterface
*
* @param mixed[] $parameters
*
* @return void
*
* @throws InvalidSignatureException
* @throws MissingSignatureException
*/
public function checkSignature(ReflectionClass $class, array $parameters) : void;
public function checkSignature(ReflectionClass $class, array $parameters);
}

0 comments on commit 3be0722

Please sign in to comment.