Skip to content

Commit 135999c

Browse files
Merge branch '2.14.x' into 1.x
* 2.14.x: Reduce minimum covered code mutation score - floating point rounding hits again :-\ Replaced `infection/infection` with a stricter `roave/infection-static-analysis-plugin` Add `github`-formatted output to infection runs Reoved `branch-alias` - the project no longer has a `master` branch, so the alias is no longer needed Upgraded locked reference to `vimeo/psalm` Upgraded `vimeo/psalm`, `infection/infection` and removed a lot of unused inline annotations and superfluous code Upgraded to `phpbench/phpbench:^1.0.0` Upgraded to `phpbench/phpbench:^1.0.0` Removing pinned `nikic/php-parser` dependency: newer `vimeo/psalm` versions use newer releases anyway Ignoring missing type declarations on some BC-sensitive interfaces Re-enabling the `SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint` rule Re-enabling the `SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.NoAssignment` rule Cleaning up unused imports: as the tooling improves, CS and psalm now understand each other more Upgraded to `doctrine/coding-standard:^9.0.0` Upgraded PHPUnit dependencies Drop PHP 7.4 from CI pipelines (no longer supported) Upgraded to latest `laminas/laminas-code` dependency Removed conflict with `doctrine/annotations` Removed conflict with `zendframework/zend-stdlib` and `laminas/laminas-stdlib` Drop PHP 7.x support: time to move on to PHP 8.0+
2 parents f4f2309 + b19ebfd commit 135999c

File tree

90 files changed

+114
-240
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+114
-240
lines changed

phpunit.xml.dist

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
<?xml version="1.0"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
55
bootstrap="./vendor/autoload.php"
66
colors="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
107
verbose="true"
11-
stopOnFailure="false"
12-
processIsolation="false"
13-
backupGlobals="false"
148
columns="max"
15-
beStrictAboutTestsThatDoNotTestAnything="true"
169
beStrictAboutResourceUsageDuringSmallTests="true"
1710
beStrictAboutChangesToGlobalState="true"
1811
>
@@ -24,7 +17,7 @@
2417
<directory suffix=".phpt">./tests/language-feature-scripts</directory>
2518
</testsuite>
2619
</testsuites>
27-
<coverage includeUncoveredFiles="true">
20+
<coverage>
2821
<include>
2922
<directory suffix=".php">./src</directory>
3023
</include>

src/ProxyManager/Factory/AbstractBaseFactory.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,15 @@ public function __construct(?Configuration $configuration = null)
4444
* Generate a proxy from a class name
4545
*
4646
* @param array<string, mixed> $proxyOptions
47+
* @psalm-param class-string<RealObjectType> $className
48+
*
49+
* @psalm-return class-string<RealObjectType>
4750
*
4851
* @throws InvalidSignatureException
4952
* @throws MissingSignatureException
5053
* @throws OutOfBoundsException
5154
*
5255
* @psalm-template RealObjectType of object
53-
*
54-
* @psalm-param class-string<RealObjectType> $className
55-
*
56-
* @psalm-return class-string<RealObjectType>
5756
*/
5857
protected function generateProxy(string $className, array $proxyOptions = []): string
5958
{
@@ -102,7 +101,6 @@ abstract protected function getGenerator(): ProxyGeneratorInterface;
102101
*
103102
* @param array<string, mixed> $proxyParameters
104103
* @param array<string, mixed> $proxyOptions
105-
*
106104
* @psalm-param class-string $proxyClassName
107105
* @psalm-param class-string $className
108106
*/

src/ProxyManager/Factory/AccessInterceptorScopeLocalizerFactory.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@ public function __construct(?Configuration $configuration = null)
3535
* before method logic is executed
3636
* @param array<string, Closure> $suffixInterceptors an array (indexed by method name) of interceptor closures to be called
3737
* after method logic is executed
38-
*
39-
* @throws InvalidSignatureException
40-
* @throws MissingSignatureException
41-
* @throws OutOfBoundsException
42-
*
43-
* @psalm-template RealObjectType of object
44-
*
4538
* @psalm-param RealObjectType $instance
4639
* @psalm-param array<string, Closure(
4740
* RealObjectType&AccessInterceptorInterface<RealObjectType>=,
@@ -61,6 +54,11 @@ public function __construct(?Configuration $configuration = null)
6154
*
6255
* @psalm-return RealObjectType&AccessInterceptorInterface<RealObjectType>
6356
*
57+
* @throws InvalidSignatureException
58+
* @throws MissingSignatureException
59+
* @throws OutOfBoundsException
60+
*
61+
* @psalm-template RealObjectType of object
6462
* @psalm-suppress MixedInferredReturnType We ignore type checks here, since `staticProxyConstructor` is not
6563
* interfaced (by design)
6664
*/

src/ProxyManager/Factory/AccessInterceptorValueHolderFactory.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ public function __construct(?Configuration $configuration = null)
3737
* before method logic is executed
3838
* @param array<string, Closure> $suffixInterceptors an array (indexed by method name) of interceptor closures to be called
3939
* after method logic is executed
40-
*
41-
* @throws InvalidSignatureException
42-
* @throws MissingSignatureException
43-
* @throws OutOfBoundsException
44-
*
45-
* @psalm-template RealObjectType of object
46-
*
4740
* @psalm-param RealObjectType $instance
4841
* @psalm-param array<string, callable(
4942
* RealObjectType&AccessInterceptorInterface<RealObjectType>=,
@@ -63,6 +56,11 @@ public function __construct(?Configuration $configuration = null)
6356
*
6457
* @psalm-return RealObjectType&AccessInterceptorInterface<RealObjectType>&ValueHolderInterface<RealObjectType>&AccessInterceptorValueHolderInterface<RealObjectType>
6558
*
59+
* @throws InvalidSignatureException
60+
* @throws MissingSignatureException
61+
* @throws OutOfBoundsException
62+
*
63+
* @psalm-template RealObjectType of object
6664
* @psalm-suppress MixedInferredReturnType We ignore type checks here, since `staticProxyConstructor` is not
6765
* interfaced (by design)
6866
*/

src/ProxyManager/Factory/LazyLoadingGhostFactory.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use OutOfBoundsException;
99
use ProxyManager\Configuration;
1010
use ProxyManager\Proxy\GhostObjectInterface;
11-
use ProxyManager\Proxy\LazyLoadingInterface;
1211
use ProxyManager\ProxyGenerator\LazyLoadingGhostGenerator;
1312
use ProxyManager\ProxyGenerator\ProxyGeneratorInterface;
1413
use ProxyManager\Signature\Exception\InvalidSignatureException;
@@ -67,13 +66,6 @@ protected function getGenerator(): ProxyGeneratorInterface
6766
* key "skippedProperties", which allows to skip lazy-loading of some properties.
6867
* "skippedProperties" is a string[], containing a list of properties referenced
6968
* via PHP's internal property name (i.e. "\0ClassName\0propertyName")
70-
*
71-
* @throws MissingSignatureException
72-
* @throws InvalidSignatureException
73-
* @throws OutOfBoundsException
74-
*
75-
* @psalm-template RealObjectType as object
76-
*
7769
* @psalm-param class-string<RealObjectType> $className
7870
* @psalm-param Closure(
7971
* RealObjectType&GhostObjectInterface<RealObjectType>=,
@@ -86,6 +78,11 @@ protected function getGenerator(): ProxyGeneratorInterface
8678
*
8779
* @psalm-return RealObjectType&GhostObjectInterface<RealObjectType>
8880
*
81+
* @throws MissingSignatureException
82+
* @throws InvalidSignatureException
83+
* @throws OutOfBoundsException
84+
*
85+
* @psalm-template RealObjectType as object
8986
* @psalm-suppress MixedInferredReturnType We ignore type checks here, since `staticProxyConstructor` is not
9087
* interfaced (by design)
9188
*/

src/ProxyManager/Factory/LazyLoadingValueHolderFactory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ public function __construct(?Configuration $configuration = null)
2727

2828
/**
2929
* @param array<string, mixed> $proxyOptions
30-
*
31-
* @psalm-template RealObjectType of object
32-
*
3330
* @psalm-param class-string<RealObjectType> $className
3431
* @psalm-param Closure(
3532
* RealObjectType|null=,
@@ -42,6 +39,7 @@ public function __construct(?Configuration $configuration = null)
4239
*
4340
* @psalm-return RealObjectType&ValueHolderInterface<RealObjectType>&VirtualProxyInterface
4441
*
42+
* @psalm-template RealObjectType of object
4543
* @psalm-suppress MixedInferredReturnType We ignore type checks here, since `staticProxyConstructor` is not
4644
* interfaced (by design)
4745
*/

src/ProxyManager/Factory/NullObjectFactory.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,15 @@ public function __construct(?Configuration $configuration = null)
3131

3232
/**
3333
* @param object|string $instanceOrClassName the object to be wrapped or interface to transform to null object
34+
* @psalm-param RealObjectType|class-string<RealObjectType> $instanceOrClassName
35+
*
36+
* @psalm-return RealObjectType&NullObjectInterface
3437
*
3538
* @throws InvalidSignatureException
3639
* @throws MissingSignatureException
3740
* @throws OutOfBoundsException
3841
*
3942
* @psalm-template RealObjectType of object
40-
*
41-
* @psalm-param RealObjectType|class-string<RealObjectType> $instanceOrClassName
42-
*
43-
* @psalm-return RealObjectType&NullObjectInterface
44-
*
4543
* @psalm-suppress MixedInferredReturnType We ignore type checks here, since `staticProxyConstructor` is not
4644
* interfaced (by design)
4745
*/

src/ProxyManager/Factory/RemoteObject/AdapterInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ interface AdapterInterface
1414
*
1515
* @param array<int, mixed> $params
1616
*
17+
* Due to BC compliance, we cannot add a native `: mixed` return type declaration here
18+
*
19+
* phpcs:disable SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint
20+
*
1721
* @return mixed
1822
*/
1923
public function call(string $wrappedClass, string $method, array $params = []);

src/ProxyManager/Factory/RemoteObjectFactory.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,15 @@ public function __construct(AdapterInterface $adapter, ?Configuration $configura
3939
}
4040

4141
/**
42-
* @param string|object $instanceOrClassName
42+
* @psalm-param RealObjectType|class-string<RealObjectType> $instanceOrClassName
43+
*
44+
* @psalm-return RealObjectType&RemoteObjectInterface
4345
*
4446
* @throws InvalidSignatureException
4547
* @throws MissingSignatureException
4648
* @throws OutOfBoundsException
4749
*
4850
* @psalm-template RealObjectType of object
49-
*
50-
* @psalm-param RealObjectType|class-string<RealObjectType> $instanceOrClassName
51-
*
52-
* @psalm-return RealObjectType&RemoteObjectInterface
53-
*
5451
* @psalm-suppress MixedInferredReturnType We ignore type checks here, since `staticProxyConstructor` is not
5552
* interfaced (by design)
5653
*/

src/ProxyManager/Generator/Util/UniqueIdentifierGenerator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ abstract class UniqueIdentifierGenerator
2121
* Generates a valid unique identifier from the given name
2222
*
2323
* @psalm-return class-string
24+
*
2425
* @psalm-suppress MoreSpecificReturnType
2526
*/
2627
public static function getIdentifier(string $name): string

0 commit comments

Comments
 (0)