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

Commit e17aaea

Browse files
committed
Merging develop to master in preparation for 3.2.0 release
2 parents 8a60789 + 59bab4f commit e17aaea

File tree

110 files changed

+3688
-209
lines changed

Some content is hidden

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

110 files changed

+3688
-209
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,16 @@ env:
2222
- secure: "KoLcNj22t668IhAhm5ej6DNf23waoGrZpQ1kmuq5ptTqsXjFjy/cjOJCvWOeRX62Tl2kjc7co9UeK0f91osZ2Wq7HLb+1bIXX5SrB6SfyPUajCQtCtu0xGgEKZfuQwzLWSYoR3tsaD6vqgMjKwwst10d+AyICjdLNu9dHtdu9HpozZtK3kM9+0FwMOiRqFEND2GY05oVYXOrzgu1xNmE1YEGpjKzqqBNpqFOP4W+OnTMRTQcyrlbFzOFvAip7X3GGw9iUSnSzZTnIOWJgMdah8/eFqhrPO8O73faW+/v3ZTxdwupOEZyg7s3TD6+W9rjmN+TgOZEP484PcSlUc6sXA4QM4iL8xthG3bWk8+CDrsnuQmunrXz7T5xUEHs/7B8NuGJ8yT89fMCYGySERKIfCx17+N9kP/848A/+39LE1NIlTxnaPISfm9WMNG67xsEKyJluC/YataPGl0zZ6/7Q7w1oDYvjhsqooUsxKRD2/psd1zrVDJurDa7Ayv/E21u2dIDtbp6w9Zl+he+kwRItMNhtCdzyShqtuY0V/JRmn2lZY2PsfbICRXXAbQnDveNFYz5tE2K40Qm4RWrdZ4cnaLiNJeukdYKVJCFHtZr9rdx1uVeK78Pf5o3rt4S8S1aat35eMZQunc6s4gmeXU5+wIxwXiyOtkdlL3LztSox9s="
2323

2424
matrix:
25-
fast_finish: true
2625
include:
27-
- php: 5.5
28-
env:
29-
- CS_CHECK=true
3026
- php: 5.6
3127
env:
3228
- TEST_COVERAGE=true
3329
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
3430
- PATH="$HOME/.local/bin:$PATH"
3531
- php: 7
32+
env:
33+
- CS_CHECK=true
34+
- php: 7.1
3635
- php: hhvm
3736
allow_failures:
3837
- php: hhvm
@@ -50,7 +49,8 @@ install:
5049
- travis_retry composer install --no-interaction
5150

5251
script:
53-
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
52+
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; fi
53+
- if [[ $TEST_COVERAGE != 'true' ]]; then composer test ; fi
5454
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
5555
- if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi
5656

CHANGELOG.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,55 @@
22

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

5+
## 3.2.0 - TBD
6+
7+
### Added
8+
9+
- [#146](https://github.com/zendframework/zend-servicemanager/pull/146) adds
10+
`Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory`, which enables a
11+
configuration-based approach to providing class dependencies when all
12+
dependencies are services known to the `ServiceManager`. Please see
13+
[the documentation](doc/book/config-abstract-factory.md) for details.
14+
- [#154](https://github.com/zendframework/zend-servicemanager/pull/154) adds
15+
`Zend\ServiceManager\Tool\ConfigDumper`, which will introspect a given class
16+
to determine dependencies, and then create configuration for
17+
`Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory`, merging it with
18+
the provided configuration file. It also adds a vendor binary,
19+
`generate-deps-for-config-factory`, for generating these from the command
20+
line.
21+
- [#154](https://github.com/zendframework/zend-servicemanager/pull/154) adds
22+
`Zend\ServiceManager\Tool\FactoryCreator`, which will introspect a given class
23+
and generate a factory for it. It also adds a vendor binary,
24+
`generate-factory-for-class`, for generating these from the command line.
25+
- [#153](https://github.com/zendframework/zend-servicemanager/pull/153) adds
26+
`Zend\ServiceManager\AbstractFactory\ReflectionBasedAbstractFactory`. This
27+
class may be used as either a mapped factory or an abstract factory, and will
28+
use reflection in order to determine which dependencies to use from the
29+
container when instantiating the requested service, with the following rules:
30+
- Scalar values are not allowed, unless they have default values associated.
31+
- Values named `$config` type-hinted against `array` will be injected with the
32+
`config` service, if present.
33+
- All other array values will be provided an empty array.
34+
- Class/interface typehints will be pulled from the container.
35+
- [#150](https://github.com/zendframework/zend-servicemanager/pull/150) adds
36+
a "cookbook" section to the documentation, with an initial document detailing
37+
the pros and cons of abstract factory usage.
38+
39+
### Deprecated
40+
41+
- Nothing.
42+
43+
### Removed
44+
45+
- Nothing.
46+
47+
### Fixed
48+
49+
- [#106](https://github.com/zendframework/zend-servicemanager/pull/106) adds
50+
detection of multiple attempts to register the same instance or named abstract
51+
factory, using a previous instance when detected. You may still use multiple
52+
discrete instances, however.
53+
554
## 3.1.2 - 2016-12-19
655

756
### Added

CONTRIBUTING.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ To run tests:
6262

6363
If you don't have `curl` installed, you can also download `composer.phar` from https://getcomposer.org/
6464

65-
- Run the tests via `phpunit` and the provided PHPUnit config, like in this example:
65+
- Run the tests:
6666

6767
```console
68-
$ ./vendor/bin/phpunit
68+
$ composer test
6969
```
7070

71-
You can turn on conditional tests with the phpunit.xml file.
71+
You can turn on conditional tests with the `phpunit.xml` file.
7272
To do so:
7373

7474
- Copy `phpunit.xml.dist` file to `phpunit.xml`
@@ -77,24 +77,23 @@ To do so:
7777

7878
## Running Coding Standards Checks
7979

80-
This component uses [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) for coding
81-
standards checks, and provides configuration for our selected checks.
82-
`phpcs` is installed by default via Composer.
80+
This component follows [PSR-1](http://www.php-fig.org/psr/psr-1/) and
81+
[PSR-2](http://www.php-fig.org/psr/psr-2/) guidelines, and ships with tooling
82+
for both checking code against standards, as well as fixing most errors.
8383

8484
To run checks only:
8585

8686
```console
8787
$ composer cs-check
8888
```
8989

90-
`phpcs` provides another tool, `phpcbf`, that can automatically fix many common
91-
problems:
90+
To fix common errors:
9291

9392
```console
9493
$ composer cs-fix
9594
```
9695

97-
If you allow `phpcbf` to fix CS issues, please re-run the tests to ensure
96+
If you allow tooling to fix CS issues, please re-run the tests to ensure
9897
they pass, and make sure you add and commit the changes after verification.
9998

10099
## Recommended Workflow for Contributions

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2005-2015, Zend Technologies USA, Inc.
1+
Copyright (c) 2005-2016, Zend Technologies USA, Inc.
22

33
All rights reserved.
44

benchmarks/BenchAsset/AbstractFactoryFoo.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
<?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+
28
namespace ZendBench\ServiceManager\BenchAsset;
39

410
use Zend\ServiceManager\Factory\AbstractFactoryInterface;

benchmarks/BenchAsset/Bar.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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\BenchAsset;
9+
10+
class Bar
11+
{
12+
protected $options;
13+
14+
public function __construct($options = null)
15+
{
16+
$this->options = $options;
17+
}
18+
}

benchmarks/BenchAsset/Dependency.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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\BenchAsset;
9+
10+
class Dependency
11+
{
12+
}

benchmarks/BenchAsset/FactoryFoo.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
<?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+
28
namespace ZendBench\ServiceManager\BenchAsset;
39

410
use Zend\ServiceManager\Factory\FactoryInterface;

benchmarks/BenchAsset/Foo.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
<?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+
28
namespace ZendBench\ServiceManager\BenchAsset;
39

410
class Foo
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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\BenchAsset;
9+
10+
class ServiceDependingOnConfig
11+
{
12+
/**
13+
* @var array
14+
*/
15+
private $config;
16+
17+
public function __construct(array $config)
18+
{
19+
$this->config = $config;
20+
}
21+
}

0 commit comments

Comments
 (0)