Skip to content

Commit a7bf1bb

Browse files
committed
refactor(tests): remove PHP version check for --parallel option in TestsCommand
Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
1 parent bc062b0 commit a7bf1bb

5 files changed

Lines changed: 9 additions & 19 deletions

File tree

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"require": {
2727
"php": "^8.3",
2828
"composer-plugin-api": "^2.0",
29+
"brianium/paratest": "^7.17",
2930
"composer/composer": "^2.9",
3031
"dg/bypass-finals": "^1.9",
3132
"ergebnis/composer-normalize": "^2.50",
@@ -54,8 +55,7 @@
5455
"symfony/var-dumper": "^7.4",
5556
"symfony/var-exporter": "^7.4",
5657
"symplify/easy-coding-standard": "^13.0",
57-
"thecodingmachine/safe": "^3.4",
58-
"brianium/paratest": "^7.17"
58+
"thecodingmachine/safe": "^3.4"
5959
},
6060
"minimum-stability": "stable",
6161
"autoload": {

src/Command/SkillsCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
namespace FastForward\DevTools\Command;
2020

2121
use FastForward\DevTools\Agent\Skills\SkillsSynchronizer;
22-
use FastForward\DevTools\Agent\Skills\SynchronizeResult;
2322
use Symfony\Component\Console\Input\InputInterface;
2423
use Symfony\Component\Console\Output\OutputInterface;
2524
use Symfony\Component\Filesystem\Filesystem;
@@ -123,7 +122,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
123122

124123
$this->synchronizer->setLogger($this->getIO());
125124

126-
/** @var SynchronizeResult $result */
127125
$result = $this->synchronizer->synchronize($skillsDir, $packageSkillsPath);
128126

129127
if ($result->failed()) {

src/Command/TestsCommand.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
135135

136136
$parallel = null !== $input->getOption('parallel');
137137

138-
if ($parallel) {
139-
if (version_compare(PHP_VERSION, '8.5.0', '>=')) {
140-
$output->writeln('<warning>--parallel is not compatible with PHP ' . PHP_VERSION . '. Running tests with PHPUnit instead...</warning>');
141-
$parallel = false;
142-
}
143-
}
144-
145-
$command = $this->getAbsolutePath(sprintf(
146-
'vendor/bin/%s',
147-
$parallel ? 'paratest' : 'phpunit'
148-
));
138+
$command = $this->getAbsolutePath(\sprintf('vendor/bin/%s', $parallel ? 'paratest' : 'phpunit'));
149139

150-
if (!$parallel) {
140+
if (! $parallel) {
151141
$arguments[] = '--display-deprecations';
152142
$arguments[] = '--display-phpunit-deprecations';
153143
$arguments[] = '--display-incomplete';

src/GitAttributes/Merger.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public function merge(string $existingContent, array $exportIgnoreEntries, array
7979
if (isset($keptExportLookup[$pathKey])) {
8080
continue;
8181
}
82+
8283
if (isset($exportIgnoreLines[$pathKey])) {
8384
continue;
8485
}
@@ -149,8 +150,8 @@ private function parseExistingLines(string $content): array
149150

150151
$lines = [];
151152

152-
foreach (preg_split('/\R/', $content) ?: [] as $line) {
153-
$trimmedLine = trim($line);
153+
foreach (preg_split('/\R/', $content) as $line) {
154+
$trimmedLine = trim((string) $line);
154155

155156
if ('' === $trimmedLine) {
156157
continue;

src/GitAttributes/Writer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ private function format(string $content): string
6262
{
6363
$rows = [];
6464
$maxPathSpecLength = 0;
65+
$lines = preg_split('/\R/', $content);
6566

66-
foreach (preg_split('/\R/', $content) ?: [] as $line) {
67+
foreach ($lines as $line) {
6768
$trimmedLine = trim((string) $line);
6869

6970
if ('' === $trimmedLine) {

0 commit comments

Comments
 (0)