From 1ca423822f57694d1cea07aa40def42f15e6dacd Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Thu, 22 Jan 2026 17:46:23 +0100 Subject: [PATCH 1/3] Add `TorrStyle::done()` --- CHANGELOG.md | 6 ++++++ src/Console/Style/TorrStyle.php | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9091417..7054fcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +1.2.4 +===== + +* (improvement) Add `TorrStyle::done()`. + + 1.2.3 ===== diff --git a/src/Console/Style/TorrStyle.php b/src/Console/Style/TorrStyle.php index 3ec250a..c917026 100644 --- a/src/Console/Style/TorrStyle.php +++ b/src/Console/Style/TorrStyle.php @@ -99,4 +99,15 @@ public function createProgressBar ( return $progressBar; } + + /** + * A smaller way to mark something as done + */ + public function done (string $message) : void + { + $this->write(\sprintf( + "✓ %s", + $message, + )); + } } From de1df95c3c54b907d97500cd9d5c2bbcb5eafc03 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Thu, 22 Jan 2026 18:06:18 +0100 Subject: [PATCH 2/3] Update CI --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 1 + composer.json | 20 ++++++++++---------- phpstan.neon | 13 ++++++++++++- src/Console/Style/TorrStyle.php | 10 +++++----- vendor-bin/c-norm/composer.json | 2 +- vendor-bin/cs-fixer/composer.json | 2 +- vendor-bin/phpstan/composer.json | 14 +++++++------- 8 files changed, 38 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af85848..10622f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: - php: ['8.3'] + php: ['8.4'] steps: - name: Checkout Code diff --git a/CHANGELOG.md b/CHANGELOG.md index 7054fcf..6612345 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ===== * (improvement) Add `TorrStyle::done()`. +* (improvement) Bump dependencies. 1.2.3 diff --git a/composer.json b/composer.json index c2e32ec..41e3243 100644 --- a/composer.json +++ b/composer.json @@ -11,16 +11,15 @@ ], "homepage": "https://github.com/21TORR/cli-bundle", "require": { - "php": ">= 8.3", - "21torr/bundle-helpers": "^2.2", - "symfony/console": "^7.0", - "symfony/http-kernel": "^7.0" + "php": ">= 8.4", + "21torr/bundle-helpers": "^2.3.1", + "symfony/console": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0" }, "require-dev": { - "21torr/janus": "^1.2", - "bamarni/composer-bin-plugin": "^1.8", - "roave/security-advisories": "dev-latest", - "symfony/phpunit-bridge": "^7.0" + "21torr/janus": "^2.0.2", + "bamarni/composer-bin-plugin": "^1.8.2", + "roave/security-advisories": "dev-latest" }, "autoload": { "psr-4": { @@ -34,6 +33,7 @@ }, "config": { "allow-plugins": { + "21torr/janus": true, "bamarni/composer-bin-plugin": true }, "sort-packages": true @@ -50,11 +50,11 @@ "scripts": { "fix-lint": [ "@composer bin c-norm normalize \"$(pwd)/composer.json\" --indent-style tab --indent-size 1 --ansi", - "vendor-bin/cs-fixer/vendor/bin/php-cs-fixer fix --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --no-interaction --ansi" + "vendor-bin/cs-fixer/vendor/bin/php-cs-fixer fix --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --allow-unsupported-php-version=yes --no-interaction --ansi" ], "lint": [ "@composer bin c-norm normalize \"$(pwd)/composer.json\" --indent-style tab --indent-size 1 --dry-run --ansi", - "vendor-bin/cs-fixer/vendor/bin/php-cs-fixer check --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --no-interaction --ansi" + "vendor-bin/cs-fixer/vendor/bin/php-cs-fixer check --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --allow-unsupported-php-version=yes --no-interaction --ansi" ], "test": [ "vendor-bin/phpstan/vendor/bin/phpstan analyze -c phpstan.neon . --ansi -v" diff --git a/phpstan.neon b/phpstan.neon index cd0577a..fd17d4b 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,8 +1,19 @@ includes: - vendor/21torr/janus/phpstan/lib.neon +parameters: + # If you use simple-phpunit, you need to uncomment the following line. # Always make sure to first run simple-phpunit and then PHPStan. -# parameters: # bootstrapFiles: # - vendor/bin/.phpunit/phpunit/vendor/autoload.php + +# These are temporarily copied here, as normally they should be in the lib.neon of janus. +# However, due to a bug in PHPStan, this currently doesn't work (https://github.com/phpstan/phpstan/issues/12844) + excludePaths: + analyse: + - vendor + analyseAndScan: + - node_modules (?) + - var (?) + - vendor-bin diff --git a/src/Console/Style/TorrStyle.php b/src/Console/Style/TorrStyle.php index c917026..553550d 100644 --- a/src/Console/Style/TorrStyle.php +++ b/src/Console/Style/TorrStyle.php @@ -25,9 +25,9 @@ public function title (string $message) : void $length = Helper::width(Helper::removeDecoration($this->getFormatter(), $message)) + 4; $this->newLine(); - $this->writeln(sprintf(' ╭%s╮', self::HIGHLIGHT, str_repeat("─", $length))); - $this->writeln(sprintf(' │ %s │', self::HIGHLIGHT, $message)); - $this->writeln(sprintf(' ╰%s╯', self::HIGHLIGHT, str_repeat("─", $length))); + $this->writeln(\sprintf(' ╭%s╮', self::HIGHLIGHT, str_repeat("─", $length))); + $this->writeln(\sprintf(' │ %s │', self::HIGHLIGHT, $message)); + $this->writeln(\sprintf(' ╰%s╯', self::HIGHLIGHT, str_repeat("─", $length))); $this->newLine(); } @@ -41,7 +41,7 @@ public function section (string $message) : void $this->newLine(); $this->writeln([ $message, - sprintf('%s', self::HIGHLIGHT, str_repeat("─", $length)), + \sprintf('%s', self::HIGHLIGHT, str_repeat("─", $length)), ]); $this->newLine(); } @@ -78,7 +78,7 @@ public function listing (array $elements) : void { $this->newLine(); $elements = array_map( - static fn ($element) => sprintf(' ● %s', self::HIGHLIGHT, $element), + static fn ($element) => \sprintf(' ● %s', self::HIGHLIGHT, $element), $elements, ); diff --git a/vendor-bin/c-norm/composer.json b/vendor-bin/c-norm/composer.json index 29d96fe..43031c1 100644 --- a/vendor-bin/c-norm/composer.json +++ b/vendor-bin/c-norm/composer.json @@ -1,6 +1,6 @@ { "require-dev": { - "ergebnis/composer-normalize": "^2.42", + "ergebnis/composer-normalize": "^2.47", "roave/security-advisories": "dev-latest" }, "config": { diff --git a/vendor-bin/cs-fixer/composer.json b/vendor-bin/cs-fixer/composer.json index ceadfce..42e20ab 100644 --- a/vendor-bin/cs-fixer/composer.json +++ b/vendor-bin/cs-fixer/composer.json @@ -1,6 +1,6 @@ { "require-dev": { - "21torr/php-cs-fixer": "^1.1.1", + "21torr/php-cs-fixer": "^1.1.5", "roave/security-advisories": "dev-latest" } } diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json index cf165ff..4eb9387 100644 --- a/vendor-bin/phpstan/composer.json +++ b/vendor-bin/phpstan/composer.json @@ -3,14 +3,14 @@ "php": "^8.3" }, "require-dev": { - "phpstan/extension-installer": "^1.3.1", - "phpstan/phpstan": "^1.11", - "phpstan/phpstan-deprecation-rules": "^1.2", - "phpstan/phpstan-doctrine": "^1.4", - "phpstan/phpstan-phpunit": "^1.4", - "phpstan/phpstan-symfony": "^1.4", + "phpstan/extension-installer": "^1.4.2", + "phpstan/phpstan": "^2.1.11", + "phpstan/phpstan-deprecation-rules": "^2.0.1", + "phpstan/phpstan-doctrine": "^2.0.2", + "phpstan/phpstan-phpunit": "^2.0.6", + "phpstan/phpstan-symfony": "^2.0.4", "roave/security-advisories": "dev-latest", - "staabm/phpstan-todo-by": "^0.1.25" + "staabm/phpstan-todo-by": "^0.2" }, "config": { "sort-packages": true, From 4ff519f79ecee5c7e1274f80f36a63e429f7fa79 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Thu, 22 Jan 2026 18:31:03 +0100 Subject: [PATCH 3/3] Bump janus --- composer.json | 2 -- phpstan.neon | 53 ++++++++++++++++++++++++---------- vendor-bin/janus/composer.json | 10 +++++++ 3 files changed, 48 insertions(+), 17 deletions(-) create mode 100644 vendor-bin/janus/composer.json diff --git a/composer.json b/composer.json index 41e3243..8e5c8bd 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,6 @@ "symfony/http-kernel": "^7.4 || ^8.0" }, "require-dev": { - "21torr/janus": "^2.0.2", "bamarni/composer-bin-plugin": "^1.8.2", "roave/security-advisories": "dev-latest" }, @@ -33,7 +32,6 @@ }, "config": { "allow-plugins": { - "21torr/janus": true, "bamarni/composer-bin-plugin": true }, "sort-packages": true diff --git a/phpstan.neon b/phpstan.neon index fd17d4b..bade9c7 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,19 +1,42 @@ -includes: - - vendor/21torr/janus/phpstan/lib.neon - parameters: + level: 9 + + editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%' -# If you use simple-phpunit, you need to uncomment the following line. -# Always make sure to first run simple-phpunit and then PHPStan. -# bootstrapFiles: -# - vendor/bin/.phpunit/phpunit/vendor/autoload.php + checkDynamicProperties: true + checkExplicitMixedMissingReturn: true + checkUninitializedProperties: true + inferPrivatePropertyTypeFromConstructor: true + polluteScopeWithLoopInitialAssignments: false + reportPossiblyNonexistentConstantArrayOffset: true + reportUnmatchedIgnoredErrors: false + treatPhpDocTypesAsCertain: false -# These are temporarily copied here, as normally they should be in the lib.neon of janus. -# However, due to a bug in PHPStan, this currently doesn't work (https://github.com/phpstan/phpstan/issues/12844) + # Disable these settings here, as they currently crash in PHPStan v2 excludePaths: - analyse: - - vendor - analyseAndScan: - - node_modules (?) - - var (?) - - vendor-bin + analyse: + - vendor + analyseAndScan: + - node_modules (?) + - var (?) + - vendor-bin + + ignoreErrors: + - message: "#^Attribute class JetBrains\\\\PhpStorm\\\\.*? does not exist\\.$#" + - identifier: missingType.iterableValue + - + identifier: argument.type + path: %currentWorkingDirectory%/tests/* + - + identifier: staticMethod.alreadyNarrowedType + path: %currentWorkingDirectory%/tests/* + - + identifier: method.deprecated + path: %currentWorkingDirectory%/tests/* + # Using this will have a lot of false-positives, as entities are often used as form + # entries and there the fields need to be nullable. + - identifier: doctrine.columnType + +# Disable check, as this is not discoverable +#rules: +# - Janus\Phpstan\Rule\TaskRule \ No newline at end of file diff --git a/vendor-bin/janus/composer.json b/vendor-bin/janus/composer.json new file mode 100644 index 0000000..34e91ab --- /dev/null +++ b/vendor-bin/janus/composer.json @@ -0,0 +1,10 @@ +{ + "require": { + "21torr/janus": "^2.0" + }, + "config": { + "allow-plugins": { + "21torr/janus": true + } + } +}