Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit 2efa798

Browse files
authored
Merge branch 'develop' into phpstan-fixes
2 parents 12091e5 + f98a895 commit 2efa798

File tree

75 files changed

+1538
-769
lines changed

Some content is hidden

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

75 files changed

+1538
-769
lines changed

.travis.yml

+6-27
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,20 @@ cache:
88

99
env:
1010
global:
11-
- COMPOSER_ARGS="--no-interaction --no-plugins"
12-
- COVERAGE_DEPS="satooshi/php-coveralls"
11+
- COMPOSER_ARGS="--no-interaction"
12+
- COVERAGE_DEPS="php-coveralls/php-coveralls"
1313
- PHPSTAN_DEPS="phpstan/phpstan:^0.10.3"
1414

1515
matrix:
1616
include:
17-
- php: 5.6
18-
env:
19-
- DEPS=lowest
20-
- php: 5.6
21-
env:
22-
- DEPS=locked
23-
- LEGACY_DEPS="ocramius/proxy-manager phpbench/phpbench phpunit/phpunit"
24-
- php: 5.6
25-
env:
26-
- DEPS=latest
27-
- php: 7
28-
env:
29-
- DEPS=lowest
30-
- php: 7
31-
env:
32-
- DEPS=locked
33-
- LEGACY_DEPS="ocramius/proxy-manager phpbench/phpbench phpunit/phpunit"
34-
- php: 7
35-
env:
36-
- DEPS=latest
3717
- php: 7.1
3818
env:
3919
- DEPS=lowest
4020
- php: 7.1
4121
env:
4222
- DEPS=locked
43-
- BENCHMARKS=true
4423
- CS_CHECK=true
24+
- BENCHMARKS=true
4525
- TEST_COVERAGE=true
4626
- PHPSTAN_TEST=true
4727
- LEGACY_DEPS="ocramius/proxy-manager phpbench/phpbench phpunit/phpunit"
@@ -62,10 +42,9 @@ before_install:
6242
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
6343

6444
install:
65-
- travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs
66-
- if [[ $LEGACY_DEPS != '' ]]; then travis_retry composer update --with-dependencies $COMPOSER_ARGS $LEGACY_DEPS ; fi
67-
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
45+
- travis_retry composer install $COMPOSER_ARGS
6846
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
47+
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
6948
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
7049
- if [[ $PHPSTAN_TEST == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $PHPSTAN_DEPS ; fi
7150
- stty cols 120 && composer show
@@ -77,7 +56,7 @@ script:
7756
- if [[ $PHPSTAN_TEST == 'true' ]]; then ./vendor/bin/phpstan analyse --no-progress . ; fi
7857

7958
after_script:
80-
- if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi
59+
- if [[ $TEST_COVERAGE == 'true' ]]; then vendor/bin/php-coveralls -v ; fi
8160

8261
notifications:
8362
email: false

CHANGELOG.md

+30
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,36 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5+
## 4.0.0 - TBD
6+
7+
### Added
8+
9+
- Nothing.
10+
11+
### Changed
12+
13+
- [#221](https://github.com/zendframework/zend-servicemanager/pull/221) provides
14+
enormous performance improvements for each of the various mutator methods
15+
(`setAlias()`, `setFactory()`, etc.), `has()` lookups, and initial
16+
container configuration.
17+
18+
### Deprecated
19+
20+
- Nothing.
21+
22+
### Removed
23+
24+
- [#197](https://github.com/zendframework/zend-servicemanager/pull/197) drops
25+
support for PHP versions prior to 7.1.
26+
27+
- [#193](https://github.com/zendframework/zend-servicemanager/pull/193) drops
28+
support for HHVM.
29+
30+
### Fixed
31+
32+
- [#230](https://github.com/zendframework/zend-servicemanager/pull/230) fixes a
33+
problem in detecting cyclic aliases, ensuring they are detected correctly.
34+
535
## 3.3.2 - 2018-01-29
636

737
### Added

benchmarks/BenchAsset/AbstractFactoryFoo.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
namespace ZendBench\ServiceManager\BenchAsset;
99

10+
use Psr\Container\ContainerInterface;
1011
use Zend\ServiceManager\Factory\AbstractFactoryInterface;
11-
use Interop\Container\ContainerInterface;
1212

1313
class AbstractFactoryFoo implements AbstractFactoryInterface
1414
{

benchmarks/BenchAsset/FactoryFoo.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
namespace ZendBench\ServiceManager\BenchAsset;
99

10+
use Psr\Container\ContainerInterface;
1011
use Zend\ServiceManager\Factory\FactoryInterface;
11-
use Interop\Container\ContainerInterface;
1212

1313
class FactoryFoo implements FactoryInterface
1414
{

benchmarks/HasBench.php

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<?php
2+
/**
3+
* @link http://github.com/zendframework/zend-servicemanager for the canonical source repository
4+
* @copyright Copyright (c) 2016 Zend Technologies USA Inc. (http://www.zend.com)
5+
* @license http://framework.zend.com/license/new-bsd New BSD License
6+
*/
7+
8+
namespace ZendBench\ServiceManager;
9+
10+
use PhpBench\Benchmark\Metadata\Annotations\Iterations;
11+
use PhpBench\Benchmark\Metadata\Annotations\Revs;
12+
use PhpBench\Benchmark\Metadata\Annotations\Warmup;
13+
use Zend\ServiceManager\ServiceManager;
14+
15+
/**
16+
* @Revs(1000)
17+
* @Iterations(20)
18+
* @Warmup(2)
19+
*/
20+
class HasBench
21+
{
22+
/**
23+
* @var ServiceManager
24+
*/
25+
private $sm;
26+
27+
public function __construct()
28+
{
29+
$this->sm = new ServiceManager([
30+
'factories' => [
31+
'factory1' => BenchAsset\FactoryFoo::class,
32+
],
33+
'invokables' => [
34+
'invokable1' => BenchAsset\Foo::class,
35+
],
36+
'services' => [
37+
'service1' => new \stdClass(),
38+
],
39+
'aliases' => [
40+
'alias1' => 'service1',
41+
'recursiveAlias1' => 'alias1',
42+
'recursiveAlias2' => 'recursiveAlias1',
43+
],
44+
'abstract_factories' => [
45+
BenchAsset\AbstractFactoryFoo::class
46+
]
47+
]);
48+
}
49+
50+
public function benchHasFactory1()
51+
{
52+
// @todo @link https://github.com/phpbench/phpbench/issues/304
53+
$sm = clone $this->sm;
54+
55+
$sm->has('factory1');
56+
}
57+
58+
public function benchHasInvokable1()
59+
{
60+
// @todo @link https://github.com/phpbench/phpbench/issues/304
61+
$sm = clone $this->sm;
62+
63+
$sm->has('invokable1');
64+
}
65+
66+
public function benchHasService1()
67+
{
68+
// @todo @link https://github.com/phpbench/phpbench/issues/304
69+
$sm = clone $this->sm;
70+
71+
$sm->has('service1');
72+
}
73+
74+
public function benchHasAlias1()
75+
{
76+
// @todo @link https://github.com/phpbench/phpbench/issues/304
77+
$sm = clone $this->sm;
78+
79+
$sm->has('alias1');
80+
}
81+
82+
public function benchHasRecursiveAlias1()
83+
{
84+
// @todo @link https://github.com/phpbench/phpbench/issues/304
85+
$sm = clone $this->sm;
86+
87+
$sm->has('recursiveAlias1');
88+
}
89+
90+
public function benchHasRecursiveAlias2()
91+
{
92+
// @todo @link https://github.com/phpbench/phpbench/issues/304
93+
$sm = clone $this->sm;
94+
95+
$sm->has('recursiveAlias2');
96+
}
97+
98+
public function benchHasAbstractFactory()
99+
{
100+
// @todo @link https://github.com/phpbench/phpbench/issues/304
101+
$sm = clone $this->sm;
102+
103+
$sm->has('foo');
104+
}
105+
106+
public function benchHasNot()
107+
{
108+
// @todo @link https://github.com/phpbench/phpbench/issues/304
109+
$sm = clone $this->sm;
110+
111+
$sm->has('42');
112+
}
113+
}

benchmarks/SetNewServicesBench.php

+8
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ public function __construct()
5656
$this->sm = new ServiceManager($config);
5757
}
5858

59+
public function benchSetService()
60+
{
61+
// @todo @link https://github.com/phpbench/phpbench/issues/304
62+
$sm = clone $this->sm;
63+
64+
$sm->setService('service2', new \stdClass());
65+
}
66+
5967
public function benchSetFactory()
6068
{
6169
// @todo @link https://github.com/phpbench/phpbench/issues/304

composer.json

+12-11
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,24 @@
2121
"forum": "https://discourse.zendframework.com/c/questions/components"
2222
},
2323
"require": {
24-
"php": "^5.6 || ^7.0",
25-
"container-interop/container-interop": "^1.2",
24+
"php": "^7.1",
2625
"psr/container": "^1.0",
2726
"zendframework/zend-stdlib": "^3.1"
2827
},
2928
"require-dev": {
30-
"mikey179/vfsStream": "^1.6.5",
31-
"ocramius/proxy-manager": "^1.0 || ^2.0",
29+
"mikey179/vfsStream": "^1.6.4",
30+
"ocramius/proxy-manager": "^2.1.1",
3231
"phpbench/phpbench": "^0.13.0",
33-
"phpunit/phpunit": "^5.7.25 || ^6.4.4",
34-
"zendframework/zend-coding-standard": "~1.0.0"
32+
"phpunit/phpunit": "^6.4.4",
33+
"zendframework/zend-coding-standard": "~1.0.0",
34+
"zendframework/zend-container-config-test": "^0.2.1"
3535
},
3636
"provide": {
37-
"container-interop/container-interop-implementation": "^1.2",
3837
"psr/container-implementation": "^1.0"
3938
},
4039
"suggest": {
41-
"ocramius/proxy-manager": "ProxyManager 1.* to handle lazy initialization of services",
42-
"zendframework/zend-stdlib": "zend-stdlib ^2.5 if you wish to use the MergeReplaceKey or MergeRemoveKey features in Config instances"
40+
"ocramius/proxy-manager": "ProxyManager ^2.1.1 to handle lazy initialization of services",
41+
"zendframework/zend-stdlib": "zend-stdlib ^2.7.7 | ^3.1 if you wish to use the MergeReplaceKey or MergeRemoveKey features in Config instances"
4342
},
4443
"autoload": {
4544
"psr-4": {
@@ -55,6 +54,9 @@
5554
"config": {
5655
"sort-packages": true
5756
},
57+
"conflict": {
58+
"container-interop/container-interop": "<1.2.0"
59+
},
5860
"extra": {
5961
"branch-alias": {
6062
"dev-master": "3.3-dev",
@@ -73,7 +75,6 @@
7375
"cs-check": "phpcs",
7476
"cs-fix": "phpcbf",
7577
"test": "phpunit --colors=always",
76-
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
77-
"upload-coverage": "coveralls -v"
78+
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
7879
}
7980
}

0 commit comments

Comments
 (0)