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

ASSIST - Rebase of current develop to (master with #242 applied) #251

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
5413057
Adds test that preconfiguration through members gets applied.
fhein Jan 28, 2018
3b5ddd6
Adds PreconfiguredServiceManager test asset.
fhein Jan 28, 2018
d51cf4b
Adds TaggingInitializer, AbstractFactoryFoo and PassthroughDelegator
fhein Jan 28, 2018
860d629
Adds test asset PreconfiguredServiceManager.
fhein Jan 28, 2018
ab26a61
Adds class Foo test asset. To be generated by AbstractFactoryFoo on
fhein Jan 28, 2018
1c1f0d6
Fake.
fhein Jan 28, 2018
f977a4b
Fix: Process preconfigured abstract factories and initializers
fhein Jan 29, 2018
bcaf2d5
Adds test asset TaggingDelegatorFactory.
fhein Jan 29, 2018
539cfb4
Completes the fix for abstract factories and initializers. Invokables
fhein Jan 29, 2018
3b8155e
Fixes completed for abstract factories and initializers.
fhein Jan 29, 2018
9f35a10
3.3.2 readiness
weierophinney Jan 29, 2018
d2650ee
Removed tests which explicitly tested if invokables are converted to
fhein Jan 29, 2018
c94e1cf
Parens added.
fhein Jan 29, 2018
5298ab0
Change for PHP 5.6 compatibility.
fhein Jan 29, 2018
5aa73cc
Removed $constructing parameter.
fhein Jan 29, 2018
cb3b0b1
Set $this->configured after call to configure() at construction time.
fhein Jan 29, 2018
8b787f2
Extended benchmarks as of #231
fhein Jan 31, 2018
13e0feb
Deleted an assert which was assuming that invokables are handled as
fhein Feb 1, 2018
0365c4b
As requested.
fhein Feb 1, 2018
63b2302
Split PreconfigurationGetsAppliedTest. Changed tag checking
fhein Feb 1, 2018
0d36f50
Replaced unsets with [] assignments. Moved $configured assignment back
fhein Feb 1, 2018
e568c94
As requested.
fhein Feb 1, 2018
a8ba1a3
Made $invokables private to avoid bc issues.
fhein Feb 1, 2018
8e91bc6
Had to revert access to $invokables[] to protected in order to allow
fhein Feb 1, 2018
de467bd
Moved object creation through factory one level down to avoid using a
fhein Feb 1, 2018
b27f5d0
Changed docblock.
fhein Feb 1, 2018
44a7b5b
Removed commented old line of previous implementation.
fhein Feb 2, 2018
73eadf1
Removed @covers getFactory, because that does not exist any longer.
fhein Feb 2, 2018
1c58b3a
Renamed createObjectTroughFactory to createServiceThroughFactory
fhein Feb 6, 2018
2da8ce9
Merge pull request #6 from fhein/TEST-Prefconfiguration-gets-applied
fhein Feb 7, 2018
e6327ad
spelling fixes
Apr 9, 2017
146acda
drop hhvm
kokspflanze Jun 3, 2017
aa73f47
updated travis build matrix lowest/locked/latest
kokspflanze Jun 29, 2017
7add102
Update .travis.yml
kokspflanze Jul 4, 2017
cc68766
Dropped PHP 5.6 and PHP 7.0
michalbundyra Jul 5, 2017
b4a9fb3
Updated travis configuration to be consistent with other packaes
michalbundyra Jul 5, 2017
751eb9b
Changed self:: to $this-> for expectException* methods
michalbundyra Jul 5, 2017
ee9af6f
Use self:: instead of $this-> for assert* methods
michalbundyra Jul 5, 2017
71928a6
Removed unused variables
michalbundyra Jul 5, 2017
a30310f
Removed redundant parentheses
michalbundyra Jul 5, 2017
fdc16a4
Removed unused import
michalbundyra Jul 5, 2017
84cf057
Optimize PHP function calls
smuggli Jul 4, 2017
c0df483
Optimize more PHP function calls and issets
smuggli Jul 5, 2017
4b2c443
Import PHP internal functions
michalbundyra Jul 9, 2017
93c6e00
Alphabetical order of use statements
michalbundyra Jul 9, 2017
ab0179c
replace count() usage to empty when possible
samsonasik Aug 8, 2017
0261db3
replace empty() with !
samsonasik Aug 10, 2017
ec4cacb
Updated Travis CI configuration
michalbundyra Nov 28, 2017
810005e
Removed $found variable. Reordered service resolution, so that aliases
fhein Jan 2, 2018
aff74e2
#216 checking that the `AbstractFactory` is called with a resolved al…
Ocramius Jan 9, 2018
0644c1f
Revert "Removed $found variable. Reordered service resolution, so tha…
Ocramius Jan 9, 2018
f08b8b5
Updated to php-coveralls/php-coveralls
michalbundyra Dec 14, 2017
e518a32
Added a benchmark for setService.
fhein Jan 5, 2018
a66cc49
Speed up setAlias.
fhein Jan 5, 2018
6948d5b
Removed debug out. Puh.
fhein Jan 5, 2018
f956edc
CS tweaks.
fhein Jan 5, 2018
bc6bac1
Forgot to store the original param to aliases array. Necessary at all?
fhein Jan 5, 2018
4d6c270
Polish.
fhein Jan 6, 2018
be7a73b
Started optimizing abstractFactories.
fhein Jan 6, 2018
ce5f850
Added todos.
fhein Jan 6, 2018
adc93e0
CS fixes, as usual.
fhein Jan 6, 2018
02f9244
Compacted and added cycle visualization.
fhein Jan 9, 2018
5609280
Removed redundant $resolvedAliases array. Aliases are resolved when
fhein Jan 9, 2018
dbaffd2
Added source code documentation to doSetAlias to explain alias
fhein Jan 9, 2018
2de6da1
Removed @todos.
fhein Jan 9, 2018
22ab810
Merged the performance optimization of has (PR #220) because of the
fhein Jan 9, 2018
18c3694
Fix bc break:
fhein Jan 10, 2018
c94f2cc
Renamed validate members to validateServiceName.
fhein Jan 10, 2018
1ec4f8f
Corrected overall formatting of sprintfs. Reviewed an fixed all imports
fhein Jan 10, 2018
0804b4e
Added optimized algorithm for batch addition of new aliases via
fhein Jan 10, 2018
a7f9bd3
Fixed bug in abstract factory mock in
fhein Jan 10, 2018
f1df0cc
Finalized mapAliasToTarget and mapAliasesToTargets.
fhein Jan 11, 2018
a02d020
Optimized performance for setInvokableClass and handling of invokables
fhein Jan 11, 2018
5acff67
Reintroduced $this->configure. Assumed, configure may be called once
fhein Jan 11, 2018
da3dab7
Fixed introduced bc break by adding Named Constructor for CMNAException.
fhein Jan 11, 2018
1454ba0
Fixed my fix.
fhein Jan 11, 2018
d1a1b3f
Removed reference to Tarjan. Added explanation why there are different
fhein Jan 11, 2018
cb3fa2f
CS tweaks.
fhein Jan 11, 2018
3440736
Unified redundant exception messages for invalid initializers and
fhein Jan 12, 2018
f2d9c16
Removed obsolete emulateHas.
fhein Jan 12, 2018
9df6662
Tweaks as requested by webimpress.
fhein Jan 12, 2018
2c9ced2
As requested by @webimpress
fhein Jan 12, 2018
0b35b66
Edits ContainerModificationsNotAllowedException message
weierophinney Jan 16, 2018
546ba35
Adds missing annotation
weierophinney Jan 16, 2018
3e61556
Removes extraneous whitespace and adds array typehint
weierophinney Jan 16, 2018
2b7f831
CS/consistency fixes for InvalidArgumentException
weierophinney Jan 16, 2018
ae0b573
Alphabetizes all imports in ServiceManager
weierophinney Jan 16, 2018
04b4340
CS/consistency fixes for ServiceManager changes
weierophinney Jan 16, 2018
e19fcad
Adds CHANGELOG entry for #221
weierophinney Jan 16, 2018
d66e1f5
Tests and fix for mapAliasesToTargets as of #221.
fhein Jan 18, 2018
ca9cddc
Missing word in source doc.
fhein Jan 18, 2018
96bb757
Removed $_.
fhein Jan 18, 2018
24d643b
Switched mapAliasesToTargets from isset() to empty() mechanics.
fhein Jan 19, 2018
4856629
Adds CHANGELOG entry for #230
weierophinney Jan 22, 2018
be2ddd4
Avoid usage of leading `\` on imported functions
Jan 23, 2018
1fb75a7
Adds a test to verify that build/get/has remain stable and correct over
fhein Jan 24, 2018
78c0a26
Changes as requested.
fhein Jan 25, 2018
97b675e
Changes docblock of data provider.
fhein Jan 25, 2018
4061ecc
Adds delegator scenario.
fhein Jan 25, 2018
62a0f82
Added support for iteration over several sm configs. Added support for
fhein Jan 25, 2018
c57cc9c
Ready for review.
fhein Jan 25, 2018
183ff34
Improved tests aliases with abstract factories.
jaapio Jan 27, 2018
88644d4
#241 corrected CS in newly introduced tests, removed `equalsTo` for s…
Ocramius Feb 1, 2018
bd8c93b
#241 CS (spacing)
Ocramius Feb 1, 2018
d07ac65
Adjustments to resolve sync issues with already integrated #221.
fhein Feb 7, 2018
791713e
Reverted phpunit calls to self::
fhein Feb 7, 2018
6cb0048
Removed root namespace references.
fhein Feb 7, 2018
0c28315
Remove differences to develop.
fhein Feb 7, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
buildpath
.DS_Store
.idea
.project
.settings/
.*.sw*
.*.un~
nbproject
doc/html/
tmp/
zf-mkdoc-theme/

/clover.xml
/coveralls-upload.json
/docs/html/
/phpunit.xml
/vendor/
/zf-mkdoc-theme.tgz
/zf-mkdoc-theme/
33 changes: 6 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,19 @@ cache:

env:
global:
- COMPOSER_ARGS="--no-interaction --no-plugins"
- COVERAGE_DEPS="satooshi/php-coveralls"
- COMPOSER_ARGS="--no-interaction"
- COVERAGE_DEPS="php-coveralls/php-coveralls"

matrix:
include:
- php: 5.6
env:
- DEPS=lowest
- php: 5.6
env:
- DEPS=locked
- LEGACY_DEPS="ocramius/proxy-manager phpbench/phpbench phpunit/phpunit"
- php: 5.6
env:
- DEPS=latest
- php: 7
env:
- DEPS=lowest
- php: 7
env:
- DEPS=locked
- LEGACY_DEPS="ocramius/proxy-manager phpbench/phpbench phpunit/phpunit"
- php: 7
env:
- DEPS=latest
- php: 7.1
env:
- DEPS=lowest
- php: 7.1
env:
- DEPS=locked
- BENCHMARKS=true
- CS_CHECK=true
- BENCHMARKS=true
- TEST_COVERAGE=true
- php: 7.1
env:
Expand All @@ -59,10 +39,9 @@ before_install:
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi

install:
- travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs
- if [[ $LEGACY_DEPS != '' ]]; then travis_retry composer update --with-dependencies $COMPOSER_ARGS $LEGACY_DEPS ; fi
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
- travis_retry composer install $COMPOSER_ARGS
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
- stty cols 120 && composer show

Expand All @@ -72,7 +51,7 @@ script:
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi

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

notifications:
email: false
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ All notable changes to this project will be documented in this file, in reverse

### Changed

- Nothing.
- [#221](https://github.com/zendframework/zend-servicemanager/pull/221) provides
enormous performance improvements for each of the various mutator methods
(`setAlias()`, `setFactory()`, etc.), `has()` lookups, and initial
container configuration.

### Deprecated

Expand All @@ -29,6 +32,8 @@ All notable changes to this project will be documented in this file, in reverse

- [#233](https://github.com/zendframework/zend-servicemanager/pull/233) fixes a
number of parameter annotations to reflect the actual types used.
- [#230](https://github.com/zendframework/zend-servicemanager/pull/230) fixes a
problem in detecting cyclic aliases, ensuring they are detected correctly.

## 3.3.1 - 2017-11-27

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/BenchAsset/AbstractFactoryFoo.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

namespace ZendBench\ServiceManager\BenchAsset;

use Zend\ServiceManager\Factory\AbstractFactoryInterface;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\AbstractFactoryInterface;

class AbstractFactoryFoo implements AbstractFactoryInterface
{
Expand Down
23 changes: 23 additions & 0 deletions benchmarks/BenchAsset/DelegatorFactoryFoo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
* @link https://github.com/zendframework/zend-servicemanager for the canonical source repository
* @copyright Copyright (c) 2018 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace ZendBench\ServiceManager\BenchAsset;

use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\DelegatorFactoryInterface;

class DelegatorFactoryFoo implements DelegatorFactoryInterface
{
/**
* {@inheritDoc}
* @see \Zend\ServiceManager\Factory\DelegatorFactoryInterface::__invoke()
*/
public function __invoke(ContainerInterface $container, $name, callable $callback, array $options = null)
{
return ($options !== null) ? $callback($options) : $callback();
}
}
2 changes: 1 addition & 1 deletion benchmarks/BenchAsset/FactoryFoo.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

namespace ZendBench\ServiceManager\BenchAsset;

use Zend\ServiceManager\Factory\FactoryInterface;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\FactoryInterface;

class FactoryFoo implements FactoryInterface
{
Expand Down
28 changes: 28 additions & 0 deletions benchmarks/BenchAsset/InitializerFoo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* @link https://github.com/zendframework/zend-servicemanager for the canonical source repository
* @copyright Copyright (c) 2018 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace ZendBench\ServiceManager\BenchAsset;

use Zend\ServiceManager\Initializer\InitializerInterface;

class InitializerFoo implements InitializerInterface
{
protected $options;

/**
* {@inheritDoc}
* @see \Zend\ServiceManager\Initializer\InitializerInterface::__invoke()
*/
public function __invoke(\Interop\Container\ContainerInterface $container, $instance)
{
}

public function __construct($options = null)
{
$this->options = $options;
}
}
113 changes: 113 additions & 0 deletions benchmarks/HasBench.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?php
/**
* @link http://github.com/zendframework/zend-servicemanager for the canonical source repository
* @copyright Copyright (c) 2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace ZendBench\ServiceManager;

use PhpBench\Benchmark\Metadata\Annotations\Iterations;
use PhpBench\Benchmark\Metadata\Annotations\Revs;
use PhpBench\Benchmark\Metadata\Annotations\Warmup;
use Zend\ServiceManager\ServiceManager;

/**
* @Revs(1000)
* @Iterations(20)
* @Warmup(2)
*/
class HasBench
{
/**
* @var ServiceManager
*/
private $sm;

public function __construct()
{
$this->sm = new ServiceManager([
'factories' => [
'factory1' => BenchAsset\FactoryFoo::class,
],
'invokables' => [
'invokable1' => BenchAsset\Foo::class,
],
'services' => [
'service1' => new \stdClass(),
],
'aliases' => [
'alias1' => 'service1',
'recursiveAlias1' => 'alias1',
'recursiveAlias2' => 'recursiveAlias1',
],
'abstract_factories' => [
BenchAsset\AbstractFactoryFoo::class
]
]);
}

public function benchHasFactory1()
{
// @todo @link https://github.com/phpbench/phpbench/issues/304
$sm = clone $this->sm;

$sm->has('factory1');
}

public function benchHasInvokable1()
{
// @todo @link https://github.com/phpbench/phpbench/issues/304
$sm = clone $this->sm;

$sm->has('invokable1');
}

public function benchHasService1()
{
// @todo @link https://github.com/phpbench/phpbench/issues/304
$sm = clone $this->sm;

$sm->has('service1');
}

public function benchHasAlias1()
{
// @todo @link https://github.com/phpbench/phpbench/issues/304
$sm = clone $this->sm;

$sm->has('alias1');
}

public function benchHasRecursiveAlias1()
{
// @todo @link https://github.com/phpbench/phpbench/issues/304
$sm = clone $this->sm;

$sm->has('recursiveAlias1');
}

public function benchHasRecursiveAlias2()
{
// @todo @link https://github.com/phpbench/phpbench/issues/304
$sm = clone $this->sm;

$sm->has('recursiveAlias2');
}

public function benchHasAbstractFactory()
{
// @todo @link https://github.com/phpbench/phpbench/issues/304
$sm = clone $this->sm;

$sm->has('foo');
}

public function benchHasNot()
{
// @todo @link https://github.com/phpbench/phpbench/issues/304
$sm = clone $this->sm;

$sm->has('42');
}
}
Loading