Skip to content

Commit cadf6f3

Browse files
committed
feat: dropping support for 7.4
- upgrading dependencies - adding support for 8.1
1 parent ecd0a11 commit cadf6f3

File tree

3 files changed

+30
-18
lines changed

3 files changed

+30
-18
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
language: php
22
sudo: false
33
php:
4-
- 7.3
5-
- 7.4
64
- 8.0
5+
- 8.1
76
before_script:
87
- composer install -n
98
script:
109
- export XDEBUG_MODE=coverage
1110
- vendor/bin/codecept run unit --coverage --coverage-xml
1211
after_script:
13-
- if [ $TRAVIS_PHP_VERSION = '7.4' ]; then php vendor/bin/php-coveralls; fi
12+
- if [ $TRAVIS_PHP_VERSION = '8.1' ]; then php vendor/bin/php-coveralls; fi
1413
after_success:
1514
- travis_retry php vendor/bin/php-coveralls -v
1615
- vendor/bin/test-reporter

composer.json

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
"description": "Symfony Console application factory that autowires dependecies",
44
"type": "library",
55
"require": {
6-
"php": "^7.3 | ~8.0.0",
7-
"selami/stdlib": "^2.0",
8-
"symfony/console": "^v5.1",
9-
"psr/container": "^1.0"
6+
"php": "^8.0",
7+
"selami/stdlib": "^2.5",
8+
"symfony/console": "^v5.4.13",
9+
"psr/container": "^1.1.2"
1010
},
1111
"require-dev": {
1212
"roave/security-advisories": "dev-master",
13-
"codeception/codeception": "^4.1",
14-
"php-coveralls/php-coveralls": "^2.1",
15-
"laminas/laminas-servicemanager": "^3.3",
16-
"object-calisthenics/phpcs-calisthenics-rules": "^3.4",
17-
"squizlabs/php_codesniffer": "^3.3",
18-
"codeception/module-phpbrowser": "^1.0",
19-
"codeception/module-asserts": "^1.2"
13+
"codeception/codeception": "^4.2.2",
14+
"php-coveralls/php-coveralls": "^v2.5.3",
15+
"laminas/laminas-servicemanager": "^3.17.0",
16+
"squizlabs/php_codesniffer": "^3.7.1",
17+
"codeception/module-phpbrowser": "^2.0.3",
18+
"codeception/module-asserts": "^2.0.1",
19+
"malukenho/mcbumpface": "^1.1.5",
20+
"codeception/codeception-progress-reporter": "^4.0.5"
2021
},
2122
"license": "MIT",
2223
"authors": [
@@ -39,7 +40,12 @@
3940
"scripts": {
4041
"unit-tests": "vendor/bin/codecept run unit --coverage",
4142
"phpcs": "vendor/bin/phpcs --standard=PSR2 src tests",
42-
"phpcbf": "vendor/bin/phpcbf --standard=PSR2 src tests",
43-
"phpcs-object-calisthenics": "vendor/bin/phpcs src -sp --standard=vendor/object-calisthenics/phpcs-calisthenics-rules/src/ObjectCalisthenics/ruleset.xml"
43+
"phpcbf": "vendor/bin/phpcbf --standard=PSR2 src tests"
44+
},
45+
"config": {
46+
"allow-plugins": {
47+
"dealerdirect/phpcodesniffer-composer-installer": true,
48+
"malukenho/mcbumpface": true
49+
}
4450
}
4551
}

src/Console/ApplicationFactory.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use ReflectionClass;
1111
use Selami\Console\Exception\DependencyNotFoundException;
1212
use Selami\Stdlib\Exception\ClassOrMethodCouldNotBeFound;
13+
use Laminas\ServiceManager\Exception\ServiceNotFoundException;
1314

1415
class ApplicationFactory
1516
{
@@ -52,7 +53,7 @@ private static function getControllerConstructorArguments($command): ?array
5253
{
5354
try {
5455
return Resolver::getParameterHints($command, '__construct');
55-
} catch (ClassOrMethodCouldNotBeFound $e) {
56+
} catch (ClassOrMethodCouldNotBeFound|ServiceNotFoundException $e) {
5657
throw new DependencyNotFoundException(
5758
sprintf(
5859
'%s when calling command: %s',
@@ -81,6 +82,12 @@ private static function getArgument(
8182
if ($argumentType === Resolver::ARRAY) {
8283
return $container->get($argumentName);
8384
}
84-
return $container->get($argumentType);
85+
try {
86+
return $container->get($argumentType);
87+
} catch (ServiceNotFoundException $exception) {
88+
throw new DependencyNotFoundException(
89+
sprintf('Container does not have an item service: %s', $argumentType)
90+
);
91+
}
8592
}
8693
}

0 commit comments

Comments
 (0)