Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow symfony 7, bump to PHP 8.1+ #4

Merged
merged 4 commits into from
Jan 1, 2024
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
14 changes: 1 addition & 13 deletions .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
branches:
- main

env:
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
COMPOSER_ROOT_VERSION: "dev-main"

jobs:
code_analysis:
strategy:
Expand All @@ -36,17 +32,9 @@ jobs:
name: 'Tests'
run: vendor/bin/phpunit

-
name: 'PHP Linter'
run: vendor/bin/parallel-lint src tests

-
name: 'Check Commented Code'
run: vendor/bin/easy-ci check-commented-code src tests --ansi

-
name: 'Check Active Classes'
run: vendor/bin/easy-ci check-active-class src --ansi
run: vendor/bin/class-leak check src --ansi

name: ${{ matrix.actions.name }}
runs-on: ubuntu-latest
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
composer.lock
/vendor
/vendor

.phpunit.result.cache
.phpunit.cache
30 changes: 10 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@
"require": {
"php": ">=8.1",
"clue/ndjson-react": "^1.3",
"fidry/cpu-core-counter": "^0.4.0 || ^0.5.1",
"nette/utils": "^3.2|^4.0",
"react/child-process": "^0.6.5",
"react/event-loop": "^1.3",
"react/socket": "^1.12",
"symfony/console": "^6.2",
"fidry/cpu-core-counter": "^0.4.0 || ^0.5.1"
"symfony/console": "^6.2|^7.0"
},
"require-dev": {
"symplify/package-builder": "^11.2",
"phpunit/phpunit": "^9.5.26",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpstan/extension-installer": "^1.2",
"rector/rector": "^0.15.10",
"symplify/easy-ci": "^11.1",
"symplify/easy-coding-standard": "^11.1",
"symplify/phpstan-extensions": "^11.1",
"symplify/symplify-kernel": "^11.2",
"tomasvotruba/unused-public": "^0.0.34"
"phpstan/extension-installer": "^1.3",
"phpunit/phpunit": "^10.5",
"rector/rector": "^0.18.13",
"symplify/easy-coding-standard": "^12.0",
"symplify/phpstan-extensions": "^11.4",
"tomasvotruba/class-leak": "^0.2.6"
},
"autoload": {
"psr-4": {
Expand All @@ -33,11 +30,6 @@
"Symplify\\EasyParallel\\Tests\\": "tests"
}
},
"extra": {
"branch-alias": {
"dev-main": "11.2-dev"
}
},
"scripts": {
"check-cs": "vendor/bin/ecs check --ansi",
"fix-cs": "vendor/bin/ecs check --fix --ansi",
Expand All @@ -51,7 +43,5 @@
"cweagans/composer-patches": true,
"phpstan/extension-installer": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
}
12 changes: 0 additions & 12 deletions easy-ci.php

This file was deleted.

1 change: 0 additions & 1 deletion ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
__DIR__ . '/config',
__DIR__ . '/ecs.php',
__DIR__ . '/rector.php',
__DIR__ . '/easy-ci.php',
__DIR__ . '/src',
__DIR__ . '/tests',
]);
Expand Down
9 changes: 2 additions & 7 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ parameters:
- tests

excludePaths:
- '*/tests/**/Source/*'
- '*/tests/**/Fixture/*'

unused_public:
methods: true
properties: true
constants: true
- '*/Source/*'
- '*/Fixture/*'

ignoreErrors:
-
Expand Down
8 changes: 5 additions & 3 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0"?>
<phpunit
bootstrap="vendor/autoload.php"
colors="true"
verbose="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php" colors="true"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
cacheDirectory=".phpunit.cache"
>
<testsuite name="all">
<directory>tests</directory>
Expand Down
3 changes: 3 additions & 0 deletions src/Contract/SerializableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use JsonSerializable;

/**
* @api
*/
interface SerializableInterface extends JsonSerializable
{
/**
Expand Down
27 changes: 0 additions & 27 deletions src/FileSystem/FilePathNormalizer.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/ValueObject/ParallelProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function bindConnection(Decoder $decoder, Encoder $encoder): void

private function cancelTimer(): void
{
if ($this->timer === null) {
if (! $this->timer instanceof TimerInterface) {
return;
}

Expand Down
1 change: 0 additions & 1 deletion tests/CommandLine/Source/SomeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

final class SomeService
{

}
13 changes: 5 additions & 8 deletions tests/CommandLine/WorkerCommandLineFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Symplify\EasyParallel\Tests\CommandLine;

use Iterator;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArrayInput;
Expand Down Expand Up @@ -38,11 +39,10 @@ protected function setUp(): void
}

/**
* @dataProvider provideData()
*
* @param class-string<Command> $commandClass
* @param array<string, mixed> $inputParameters
*/
#[DataProvider('provideData')]
public function test(
string $commandClass,
string $pathsOptionName,
Expand All @@ -66,14 +66,11 @@ public function test(
$this->assertSame($expectedCommand, $workerCommandLine);
}

/**
* @return Iterator<array<int, array<string, string|string[]|bool>>|string[]>
*/
public function provideData(): Iterator
public static function provideData(): Iterator
{
$cliInputOptions = array_slice($_SERVER['argv'], 1);

$expectedCommandLinesString = $this->createExpectedCommandLinesString($cliInputOptions);
$expectedCommandLinesString = self::createExpectedCommandLinesString($cliInputOptions);

yield [
MainCommand::class,
Expand Down Expand Up @@ -119,7 +116,7 @@ private function prepareProcessCommandDefinition(string $mainCommandClass): Inpu
/**
* @param string[] $cliInputOptions
*/
private function createExpectedCommandLinesString(array $cliInputOptions): string
private static function createExpectedCommandLinesString(array $cliInputOptions): string
{
$commandLineString = "'" . PHP_BINARY . "' '" . self::DUMMY_MAIN_SCRIPT . "'";

Expand Down