Skip to content

Commit 7a40eed

Browse files
authored
Merge pull request #537 from phparkitect/claude/test-arkitect-symfony-01Y6qfRAb4ebWgwPX3mequCg
Symfony 8 support
2 parents 0096703 + d41f4f6 commit 7a40eed

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
],
2424
"require": {
2525
"php": "^7.4|^8",
26-
"symfony/finder": "^3.0|^4.0|^5.0|^6.0|^7.0",
27-
"symfony/event-dispatcher": "^3.0|^4.0|^5.0|^6.0|^7.0",
28-
"symfony/console": "^3.0|^4.0|^5.0|^6.0|^7.0",
29-
"symfony/polyfill-php80": "^1.33",
30-
"nikic/php-parser": "~5",
31-
"webmozart/assert": "^1.9",
3226
"ext-json": "*",
27+
"nikic/php-parser": "~5",
28+
"ondram/ci-detector": "^4.2",
3329
"phpstan/phpdoc-parser": "^1.2|^2.0",
34-
"ondram/ci-detector": "^4.2"
30+
"symfony/console": "^3.0|^4.0|^5.0|^6.0|^7.0|^8.0",
31+
"symfony/event-dispatcher": "^3.0|^4.0|^5.0|^6.0|^7.0|^8.0",
32+
"symfony/finder": "^3.0|^4.0|^5.0|^6.0|^7.0|^8.0",
33+
"symfony/polyfill-php80": "^1.33",
34+
"webmozart/assert": "^1.9"
3535
},
3636
"require-dev": {
3737
"friendsofphp/php-cs-fixer": "^3.90",
@@ -40,7 +40,7 @@
4040
"phpspec/prophecy-phpunit": "^2.4",
4141
"phpunit/phpunit": "^7.5|^9.0|^10.0",
4242
"roave/security-advisories": "dev-master",
43-
"symfony/var-dumper": "^3.0|^4.0|^5.0|^6.0|^7.0"
43+
"symfony/var-dumper": "^3.0|^4.0|^5.0|^6.0|^7.0|^8.0"
4444
},
4545
"autoload": {
4646
"psr-4": {

src/CLI/PhpArkitectApplication.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@ class PhpArkitectApplication extends \Symfony\Component\Console\Application
2121
public function __construct()
2222
{
2323
parent::__construct('PHPArkitect', Version::get());
24-
$this->add(new Check());
25-
$this->add(new Init());
26-
$this->add(new DebugExpression());
24+
25+
// Symfony 8 removed add() in favor of addCommand()
26+
// addCommand() was introduced in Symfony 7.4
27+
$addMethod = method_exists($this, 'addCommand') ? 'addCommand' : 'add';
28+
29+
$this->$addMethod(new Check());
30+
$this->$addMethod(new Init());
31+
$this->$addMethod(new DebugExpression());
2732
}
2833

2934
public function getLongVersion(): string

0 commit comments

Comments
 (0)