Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
php: ['8.3']
php: ['8.4']

steps:
- name: Checkout Code
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
1.2.4
=====

* (improvement) Add `TorrStyle::done()`.
* (improvement) Bump dependencies.


1.2.3
=====

Expand Down
18 changes: 8 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@
],
"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"
"bamarni/composer-bin-plugin": "^1.8.2",
"roave/security-advisories": "dev-latest"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -50,11 +48,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"
Expand Down
50 changes: 42 additions & 8 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
includes:
- vendor/21torr/janus/phpstan/lib.neon

# 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
parameters:
level: 9

editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'

checkDynamicProperties: true
checkExplicitMixedMissingReturn: true
checkUninitializedProperties: true
inferPrivatePropertyTypeFromConstructor: true
polluteScopeWithLoopInitialAssignments: false
reportPossiblyNonexistentConstantArrayOffset: true
reportUnmatchedIgnoredErrors: false
treatPhpDocTypesAsCertain: false

# Disable these settings here, as they currently crash in PHPStan v2
excludePaths:
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
21 changes: 16 additions & 5 deletions src/Console/Style/TorrStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public function title (string $message) : void
$length = Helper::width(Helper::removeDecoration($this->getFormatter(), $message)) + 4;

$this->newLine();
$this->writeln(sprintf(' <fg=%s>╭%s╮</>', self::HIGHLIGHT, str_repeat("─", $length)));
$this->writeln(sprintf(' <fg=%s>│</> %s <fg=red>│</>', self::HIGHLIGHT, $message));
$this->writeln(sprintf(' <fg=%s>╰%s╯</>', self::HIGHLIGHT, str_repeat("─", $length)));
$this->writeln(\sprintf(' <fg=%s>╭%s╮</>', self::HIGHLIGHT, str_repeat("─", $length)));
$this->writeln(\sprintf(' <fg=%s>│</> %s <fg=red>│</>', self::HIGHLIGHT, $message));
$this->writeln(\sprintf(' <fg=%s>╰%s╯</>', self::HIGHLIGHT, str_repeat("─", $length)));
$this->newLine();
}

Expand All @@ -41,7 +41,7 @@ public function section (string $message) : void
$this->newLine();
$this->writeln([
$message,
sprintf('<fg=%s>%s</>', self::HIGHLIGHT, str_repeat("─", $length)),
\sprintf('<fg=%s>%s</>', self::HIGHLIGHT, str_repeat("─", $length)),
]);
$this->newLine();
}
Expand Down Expand Up @@ -78,7 +78,7 @@ public function listing (array $elements) : void
{
$this->newLine();
$elements = array_map(
static fn ($element) => sprintf(' <fg=%s>●</> %s', self::HIGHLIGHT, $element),
static fn ($element) => \sprintf(' <fg=%s>●</> %s', self::HIGHLIGHT, $element),
$elements,
);

Expand All @@ -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(
"<fg=green>✓</> %s",
$message,
));
}
}
2 changes: 1 addition & 1 deletion vendor-bin/c-norm/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require-dev": {
"ergebnis/composer-normalize": "^2.42",
"ergebnis/composer-normalize": "^2.47",
"roave/security-advisories": "dev-latest"
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/cs-fixer/composer.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
10 changes: 10 additions & 0 deletions vendor-bin/janus/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"require": {
"21torr/janus": "^2.0"
},
"config": {
"allow-plugins": {
"21torr/janus": true
}
}
}
14 changes: 7 additions & 7 deletions vendor-bin/phpstan/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down