Skip to content
Open
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
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
php: ['8.2', '8.3', '8.4']
symfony: ['^6.4', '^7.2']
symfony: ['^6.4', '^7.2', '^8.0']
dependency-version: [prefer-lowest, prefer-stable]
exclude:
- php: '8.2'
symfony: '^8.0'
- php: '8.3'
symfony: '^8.0'

name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} (Symfony ${{ matrix.symfony }})

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- Added support for Symfony 8

## [v0.2.0] - 2025-06-10
- Included symfony/process as dependency (resolves issues for some installations)
- Added `language` option to configuration file (defaults to `en_US`)
Expand Down
7 changes: 4 additions & 3 deletions bin/peck
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ declare(strict_types=1);

use Peck\Console\Commands\CheckCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\CommandLoader\FactoryCommandLoader;

foreach ([
dirname(__DIR__, 4).'/vendor/autoload.php',
Expand All @@ -22,9 +23,9 @@ $application = new Application(
'0.2.0',
);

$application->add(
new CheckCommand,
);
$application->setCommandLoader(new FactoryCommandLoader([
'check' => static fn (): CheckCommand => new CheckCommand,
]));

$application->setDefaultCommand('check');

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
"require": {
"php": "^8.2",
"nunomaduro/termwind": "^1.17.0|^2.3.0",
"symfony/console": "^6.4.17|^7.2.1",
"symfony/finder": "^6.4.17|^7.2.2",
"symfony/process": "^6.4.17|^7.2.2"
"symfony/console": "^6.4.17|^7.2.1|^8.0",
"symfony/finder": "^6.4.17|^7.2.2|^8.0",
"symfony/process": "^6.4.17|^7.2.2|^8.0"
},
"require-dev": {
"laravel/pint": "^1.20.0",
"pestphp/pest": "^2.36|^3.7.4",
"pestphp/pest-plugin-type-coverage": "^2.8.7|^3.2.3",
"phpstan/phpstan": "^1.12.16",
"rector/rector": "^1.2.10",
"symfony/var-dumper": "^7.2.0"
"symfony/var-dumper": "^7.2.0|^8.0"
},
"autoload": {
"psr-4": {
Expand Down
57 changes: 7 additions & 50 deletions tests/Integration/CheckCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@
declare(strict_types=1);

use Peck\Console\Commands\CheckCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;

it('may fail', function (): void {
$application = new Application;

$application->add(new CheckCommand);

$command = $application->find('check');

$commandTester = new CommandTester($command);
$commandTester = new CommandTester(new CheckCommand);

$commandTester->execute([
'--path' => 'tests/Fixtures/ClassesToTest/FolderThatShouldBeIgnored',
Expand All @@ -26,13 +19,7 @@
});

it('may pass', function (): void {
$application = new Application;

$application->add(new CheckCommand);

$command = $application->find('check');

$commandTester = new CommandTester($command);
$commandTester = new CommandTester(new CheckCommand);

$commandTester->execute([]);

Expand All @@ -43,13 +30,7 @@
});

it('may pass with lineless issues', function (): void {
$application = new Application;

$application->add(new CheckCommand);

$command = $application->find('check');

$commandTester = new CommandTester($command);
$commandTester = new CommandTester(new CheckCommand);

$commandTester->execute([
'--path' => 'tests/Fixtures/FolderWithTypoos',
Expand All @@ -62,13 +43,7 @@
});

it('may pass with init option', function (): void {
$application = new Application;

$application->add(new CheckCommand);

$command = $application->find('check');

$commandTester = new CommandTester($command);
$commandTester = new CommandTester(new CheckCommand);

$commandTester->execute([
'--init' => true,
Expand All @@ -81,13 +56,7 @@
});

it('may pass with ignore-all option', function (): void {
$application = new Application;

$application->add(new CheckCommand);

$command = $application->find('check');

$commandTester = new CommandTester($command);
$commandTester = new CommandTester(new CheckCommand);

$commandTester->execute([
'--ignore-all' => true,
Expand All @@ -101,13 +70,7 @@
});

it('may fail with text option', function (): void {
$application = new Application;

$application->add(new CheckCommand);

$command = $application->find('check');

$commandTester = new CommandTester($command);
$commandTester = new CommandTester(new CheckCommand);

$commandTester->execute([
'--text' => 'This is a test with a typoo.',
Expand All @@ -120,13 +83,7 @@
});

it('may pass with text option', function (): void {
$application = new Application;

$application->add(new CheckCommand);

$command = $application->find('check');

$commandTester = new CommandTester($command);
$commandTester = new CommandTester(new CheckCommand);

$commandTester->execute([
'--text' => 'This is a test without any typos.',
Expand Down