Skip to content

Commit

Permalink
feat: dropping support for 7.4
Browse files Browse the repository at this point in the history
- upgrading dependencies
- adding support for 8.1
  • Loading branch information
mkorkmaz committed Oct 7, 2022
1 parent ecd0a11 commit cadf6f3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
language: php
sudo: false
php:
- 7.3
- 7.4
- 8.0
- 8.1
before_script:
- composer install -n
script:
- export XDEBUG_MODE=coverage
- vendor/bin/codecept run unit --coverage --coverage-xml
after_script:
- if [ $TRAVIS_PHP_VERSION = '7.4' ]; then php vendor/bin/php-coveralls; fi
- if [ $TRAVIS_PHP_VERSION = '8.1' ]; then php vendor/bin/php-coveralls; fi
after_success:
- travis_retry php vendor/bin/php-coveralls -v
- vendor/bin/test-reporter
32 changes: 19 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
"description": "Symfony Console application factory that autowires dependecies",
"type": "library",
"require": {
"php": "^7.3 | ~8.0.0",
"selami/stdlib": "^2.0",
"symfony/console": "^v5.1",
"psr/container": "^1.0"
"php": "^8.0",
"selami/stdlib": "^2.5",
"symfony/console": "^v5.4.13",
"psr/container": "^1.1.2"
},
"require-dev": {
"roave/security-advisories": "dev-master",
"codeception/codeception": "^4.1",
"php-coveralls/php-coveralls": "^2.1",
"laminas/laminas-servicemanager": "^3.3",
"object-calisthenics/phpcs-calisthenics-rules": "^3.4",
"squizlabs/php_codesniffer": "^3.3",
"codeception/module-phpbrowser": "^1.0",
"codeception/module-asserts": "^1.2"
"codeception/codeception": "^4.2.2",
"php-coveralls/php-coveralls": "^v2.5.3",
"laminas/laminas-servicemanager": "^3.17.0",
"squizlabs/php_codesniffer": "^3.7.1",
"codeception/module-phpbrowser": "^2.0.3",
"codeception/module-asserts": "^2.0.1",
"malukenho/mcbumpface": "^1.1.5",
"codeception/codeception-progress-reporter": "^4.0.5"
},
"license": "MIT",
"authors": [
Expand All @@ -39,7 +40,12 @@
"scripts": {
"unit-tests": "vendor/bin/codecept run unit --coverage",
"phpcs": "vendor/bin/phpcs --standard=PSR2 src tests",
"phpcbf": "vendor/bin/phpcbf --standard=PSR2 src tests",
"phpcs-object-calisthenics": "vendor/bin/phpcs src -sp --standard=vendor/object-calisthenics/phpcs-calisthenics-rules/src/ObjectCalisthenics/ruleset.xml"
"phpcbf": "vendor/bin/phpcbf --standard=PSR2 src tests"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"malukenho/mcbumpface": true
}
}
}
11 changes: 9 additions & 2 deletions src/Console/ApplicationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use ReflectionClass;
use Selami\Console\Exception\DependencyNotFoundException;
use Selami\Stdlib\Exception\ClassOrMethodCouldNotBeFound;
use Laminas\ServiceManager\Exception\ServiceNotFoundException;

class ApplicationFactory
{
Expand Down Expand Up @@ -52,7 +53,7 @@ private static function getControllerConstructorArguments($command): ?array
{
try {
return Resolver::getParameterHints($command, '__construct');
} catch (ClassOrMethodCouldNotBeFound $e) {
} catch (ClassOrMethodCouldNotBeFound|ServiceNotFoundException $e) {
throw new DependencyNotFoundException(
sprintf(
'%s when calling command: %s',
Expand Down Expand Up @@ -81,6 +82,12 @@ private static function getArgument(
if ($argumentType === Resolver::ARRAY) {
return $container->get($argumentName);
}
return $container->get($argumentType);
try {
return $container->get($argumentType);
} catch (ServiceNotFoundException $exception) {
throw new DependencyNotFoundException(
sprintf('Container does not have an item service: %s', $argumentType)
);
}
}
}

0 comments on commit cadf6f3

Please sign in to comment.