Skip to content

Commit

Permalink
Merge branch 'feature/travis'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-suffi committed Jun 13, 2017
2 parents ee57894 + ff0eaf0 commit 5403a53
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage_clover: build/logs/clover.xml
json_path: build/logs/coveralls-upload.json
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: php

php:
- '7.0'
- '7.1'
- nightly

install:
- curl -s http://getcomposer.org/installer | php
- php composer.phar install --dev --no-interaction

script:
- mkdir -p build/logs
- php vendor/bin/phpunit -c tests/phpunit.xml tests/

after_success:
- travis_retry php vendor/bin/coveralls
- travis_retry php vendor/bin/coveralls -v
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Dependency injection container
==============================

[![Build Status](https://api.travis-ci.org/dmitry-suffi/di-container.svg?branch=master)](https://travis-ci.org/dmitry-suffi/di-container)
[![Coveralls](https://coveralls.io/repos/github/dmitry-suffi/di-container/badge.svg?branch=master)](https://coveralls.io/github/dmitry-suffi/di-container?branch=master)

Dependency injection container
[Martin Fowler's article](http://martinfowler.com/articles/injection.html)
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"keywords": ["di", "container"],
"homepage": "https://github.com/dmitry-suffi/di-container",
"type": "project",
"license": "BSD-3-Clause",
"license": "MIT",
"support": {},
"minimum-stability": "stable",
"require": {
"php": ">=7.0.0"
},
"require-dev": {
"phpunit/phpunit": "5.4.*"
"phpunit/phpunit": "5.4.*",
"satooshi/php-coveralls": "*"
},
"autoload": {
"psr-4": {"suffi\\di\\": "di\\"}
Expand Down
2 changes: 1 addition & 1 deletion di/Definition.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ protected function resolve(string $className)
*/
protected function isCalable($paramValue)
{
return !is_string($paramValue) && $this->isCalable($paramValue);
return !is_string($paramValue) && is_callable($paramValue);
}

}
18 changes: 18 additions & 0 deletions tests/phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>

<!-- see http://www.phpunit.de/wiki/Documentation -->
<phpunit bootstrap="autoload.php">
<testsuites>
<testsuite name="tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../di</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="../build/logs/clover.xml"/>
</logging>
</phpunit>

0 comments on commit 5403a53

Please sign in to comment.