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

Commit

Permalink
Merge branch 'hotfix/166'
Browse files Browse the repository at this point in the history
Close #166
  • Loading branch information
weierophinney committed Dec 19, 2016
2 parents 8842c7d + 58e52fe commit 69882b8
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 31 deletions.
15 changes: 7 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ matrix:
include:
- php: 5.5
env:
- EXECUTE_CS_CHECK=true
- CS_CHECK=true
- php: 5.6
env:
- EXECUTE_TEST_COVERALLS=true
- TEST_COVERAGE=true
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
- PATH="$HOME/.local/bin:$PATH"
- php: 7
Expand All @@ -42,21 +42,20 @@ notifications:
email: false

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

install:
- travis_retry composer install --no-interaction

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

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

after_script:
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/coveralls -v ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ standards checks, and provides configuration for our selected checks.
To run checks only:

```console
$ ./vendor/bin/phpcs
$ composer cs-check
```

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

```console
$ ./vendor/bin/phpcbf
$ composer cs-fix
```

If you allow `phpcbf` to fix CS issues, please re-run the tests to ensure
Expand Down
1 change: 0 additions & 1 deletion benchmarks/BenchAsset/AbstractFactoryFoo.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ public function canCreate(ContainerInterface $container, $requestedName)
{
return ($requestedName === 'foo');
}

}
15 changes: 13 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"require-dev": {
"phpunit/phpunit": "^4.6 || ^5.2.10",
"ocramius/proxy-manager": "^1.0 || ^2.0",
"squizlabs/php_codesniffer": "^2.5.1",
"phpbench/phpbench": "^0.10.0"
"phpbench/phpbench": "^0.10.0",
"zendframework/zend-coding-standard": "~1.0.0"
},
"suggest": {
"ocramius/proxy-manager": "ProxyManager 1.* to handle lazy initialization of services",
Expand All @@ -43,5 +43,16 @@
},
"provide": {
"container-interop/container-interop-implementation": "^1.1"
},
"scripts": {
"check": [
"@cs-check",
"@test"
],
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"test": "phpunit --colors=always",
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
"upload-coverage": "coveralls -v"
}
}
19 changes: 4 additions & 15 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
<?xml version="1.0"?>
<ruleset name="Zend Framework coding standard">
<description>Zend Framework coding standard</description>

<!-- display progress -->
<arg value="p"/>
<arg name="colors"/>

<!-- inherit rules from: -->
<rule ref="PSR2"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
<rule ref="./vendor/zendframework/zend-coding-standard/ruleset.xml"/>

<!-- Paths to check -->
<file>src</file>
<file>test</file>
<exclude-pattern>*/test/log/*</exclude-pattern>
<file>benchmarks</file>

<exclude-pattern>test/log/</exclude-pattern>
</ruleset>
2 changes: 1 addition & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private function merge(array $a, array $b)
$a[$key] = $value;
}
} else {
if (!$value instanceof MergeRemoveKey) {
if (! $value instanceof MergeRemoveKey) {
$a[$key] = $value;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/ServiceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ private function createDelegatorFromName($name, array $options = null)
private function doCreate($resolvedName, array $options = null)
{
try {
if (!isset($this->delegators[$resolvedName])) {
if (! isset($this->delegators[$resolvedName])) {
// Let's create the service by fetching the factory
$factory = $this->getFactory($resolvedName);
$object = $factory($this->creationContext, $resolvedName, $options);
Expand Down Expand Up @@ -876,7 +876,7 @@ private function createFactoriesForInvokables(array $invokables)
*/
private function validateOverrides(array $config)
{
if ($this->allowOverride || !$this->configured) {
if ($this->allowOverride || ! $this->configured) {
return;
}

Expand Down

0 comments on commit 69882b8

Please sign in to comment.