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

Commit 69882b8

Browse files
committed
Merge branch 'hotfix/166'
Close #166
2 parents 8842c7d + 58e52fe commit 69882b8

File tree

7 files changed

+29
-31
lines changed

7 files changed

+29
-31
lines changed

.travis.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ matrix:
2626
include:
2727
- php: 5.5
2828
env:
29-
- EXECUTE_CS_CHECK=true
29+
- CS_CHECK=true
3030
- php: 5.6
3131
env:
32-
- EXECUTE_TEST_COVERALLS=true
32+
- TEST_COVERAGE=true
3333
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
3434
- PATH="$HOME/.local/bin:$PATH"
3535
- php: 7
@@ -42,21 +42,20 @@ notifications:
4242
email: false
4343

4444
before_install:
45-
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
45+
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
4646
- composer self-update
47-
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls:^1.0 ; fi
47+
- if [[ $TEST_COVERAGE == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls:^1.0 ; fi
4848

4949
install:
5050
- travis_retry composer install --no-interaction
5151

5252
script:
53-
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; fi
54-
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then ./vendor/bin/phpunit ; fi
55-
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/phpcs ; fi
53+
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
54+
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
5655
- 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
5756

5857
after_success:
5958
- if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi
6059

6160
after_script:
62-
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/coveralls -v ; fi
61+
- if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ standards checks, and provides configuration for our selected checks.
8484
To run checks only:
8585

8686
```console
87-
$ ./vendor/bin/phpcs
87+
$ composer cs-check
8888
```
8989

9090
`phpcs` provides another tool, `phpcbf`, that can automatically fix many common
9191
problems:
9292

9393
```console
94-
$ ./vendor/bin/phpcbf
94+
$ composer cs-fix
9595
```
9696

9797
If you allow `phpcbf` to fix CS issues, please re-run the tests to ensure

benchmarks/BenchAsset/AbstractFactoryFoo.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ public function canCreate(ContainerInterface $container, $requestedName)
1818
{
1919
return ($requestedName === 'foo');
2020
}
21-
2221
}

composer.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"require-dev": {
2121
"phpunit/phpunit": "^4.6 || ^5.2.10",
2222
"ocramius/proxy-manager": "^1.0 || ^2.0",
23-
"squizlabs/php_codesniffer": "^2.5.1",
24-
"phpbench/phpbench": "^0.10.0"
23+
"phpbench/phpbench": "^0.10.0",
24+
"zendframework/zend-coding-standard": "~1.0.0"
2525
},
2626
"suggest": {
2727
"ocramius/proxy-manager": "ProxyManager 1.* to handle lazy initialization of services",
@@ -43,5 +43,16 @@
4343
},
4444
"provide": {
4545
"container-interop/container-interop-implementation": "^1.1"
46+
},
47+
"scripts": {
48+
"check": [
49+
"@cs-check",
50+
"@test"
51+
],
52+
"cs-check": "phpcs",
53+
"cs-fix": "phpcbf",
54+
"test": "phpunit --colors=always",
55+
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
56+
"upload-coverage": "coveralls -v"
4657
}
4758
}

phpcs.xml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
<?xml version="1.0"?>
22
<ruleset name="Zend Framework coding standard">
3-
<description>Zend Framework coding standard</description>
4-
5-
<!-- display progress -->
6-
<arg value="p"/>
7-
<arg name="colors"/>
8-
9-
<!-- inherit rules from: -->
10-
<rule ref="PSR2"/>
11-
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
12-
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
13-
<properties>
14-
<property name="ignoreBlankLines" value="false"/>
15-
</properties>
16-
</rule>
3+
<rule ref="./vendor/zendframework/zend-coding-standard/ruleset.xml"/>
174

185
<!-- Paths to check -->
196
<file>src</file>
207
<file>test</file>
21-
<exclude-pattern>*/test/log/*</exclude-pattern>
8+
<file>benchmarks</file>
9+
10+
<exclude-pattern>test/log/</exclude-pattern>
2211
</ruleset>

src/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private function merge(array $a, array $b)
111111
$a[$key] = $value;
112112
}
113113
} else {
114-
if (!$value instanceof MergeRemoveKey) {
114+
if (! $value instanceof MergeRemoveKey) {
115115
$a[$key] = $value;
116116
}
117117
}

src/ServiceManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ private function createDelegatorFromName($name, array $options = null)
741741
private function doCreate($resolvedName, array $options = null)
742742
{
743743
try {
744-
if (!isset($this->delegators[$resolvedName])) {
744+
if (! isset($this->delegators[$resolvedName])) {
745745
// Let's create the service by fetching the factory
746746
$factory = $this->getFactory($resolvedName);
747747
$object = $factory($this->creationContext, $resolvedName, $options);
@@ -876,7 +876,7 @@ private function createFactoriesForInvokables(array $invokables)
876876
*/
877877
private function validateOverrides(array $config)
878878
{
879-
if ($this->allowOverride || !$this->configured) {
879+
if ($this->allowOverride || ! $this->configured) {
880880
return;
881881
}
882882

0 commit comments

Comments
 (0)