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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Latest
------

## Changes
* [#190](https://github.com/cleverage/process-bundle/issues/190) Update quality stack: use Rector `withComposerBased()` sets (removed `SYMFONY_64` / `PHPUNIT_100` sets), declare used Symfony packages and PHPUnit range in composer.json, apply quality tools fixes

v5.0
-----

Expand Down
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,33 @@
"symfony/console": "^6.4|^7.4|^8",
"symfony/dependency-injection": "^6.4|^7.4|^8",
"symfony/dotenv": "^6.4|^7.4|^8",
"symfony/error-handler": "^6.4|^7.4|^8",
"symfony/event-dispatcher": "^6.4|^7.4|^8",
"symfony/event-dispatcher-contracts": "^3",
"symfony/expression-language": "^6.4|^7.4|^8",
"symfony/filesystem": "^6.4|^7.4|^8",
"symfony/finder": "^6.4|^7.4|^8",
"symfony/framework-bundle": "^6.4|^7.4|^8",
"symfony/monolog-bridge":"^6.4|^7.4|^8",
"symfony/http-kernel": "^6.4|^7.4|^8",
"symfony/monolog-bridge": "^6.4|^7.4|^8",
"symfony/monolog-bundle": "^3.11|^4",
"symfony/options-resolver": "^6.4|^7.4|^8",
"symfony/process": "^6.4|^7.4|^8",
"symfony/property-access": "^6.4|^7.4|^8",
"symfony/runtime": "^6.4|^7.4|^8",
"symfony/serializer": "^6.4|^7.4|^8",
"symfony/service-contracts": ">=1.0.0",
"symfony/stopwatch": "^6.4|^7.4|^8",
"symfony/validator": "^6.4|^7.4|^8",
"symfony/yaml": "^6.4|^7.4|^8",
"symfony/service-contracts": ">=1.0.0"
"symfony/var-dumper": "^6.4|^7.4|^8",
"symfony/yaml": "^6.4|^7.4|^8"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "*",
"phpstan/extension-installer": "*",
"phpstan/phpstan": "*",
"phpstan/phpstan-symfony": "*",
"phpunit/phpunit": "*",
"phpunit/phpunit": "^10.5|^11|^12|^13",
"rector/rector": "*",
"roave/security-advisories": "dev-latest",
"symfony/test-pack": "^1.1"
Expand Down
5 changes: 1 addition & 4 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Symfony\Set\SymfonySetList;
use Rector\ValueObject\PhpVersion;
Expand All @@ -16,13 +15,11 @@
])
->withPhpSets(php82: true)
// here we can define, what prepared sets of rules will be applied
->withComposerBased(phpunit: true, symfony: true)
->withPreparedSets(deadCode: true, codeQuality: true, symfonyCodeQuality: true)
->withAttributesSets(symfony: true)
->withSets([
LevelSetList::UP_TO_PHP_82,
SymfonySetList::SYMFONY_64,
SymfonySetList::SYMFONY_CODE_QUALITY,
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
PHPUnitSetList::PHPUNIT_100,
])
;
6 changes: 0 additions & 6 deletions src/Model/SubprocessInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ public function __construct(

/**
* Prepare the process before start.
*
* @return $this
*/
public function buildProcess(): static
{
Expand Down Expand Up @@ -94,8 +92,6 @@ public function buildProcess(): static

/**
* Start the process.
*
* @return $this
*/
public function start(): static
{
Expand All @@ -106,8 +102,6 @@ public function start(): static

/**
* Stop the process.
*
* @return $this
*/
public function stop(float $timeout = 10): static
{
Expand Down
10 changes: 4 additions & 6 deletions src/Task/ColumnAggregatorTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,10 @@ protected function addValueToAggregationGroup(
string $referenceKey,
string $aggregationKey,
): void {
if (!isset($this->result[$column])) {
$this->result[$column] = [
$referenceKey => $column,
$aggregationKey => [],
];
}
$this->result[$column] ??= [
$referenceKey => $column,
$aggregationKey => [],
];

$this->result[$column][$aggregationKey][] = $input;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Task/File/Csv/CsvWriterTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected function getHeaders(ProcessState $state, array $options): ?array
{
$headers = $options['headers'];
if (null === $headers) {
$headers = array_keys($state->getInput());
return array_keys($state->getInput());
}

return $headers;
Expand Down
2 changes: 1 addition & 1 deletion src/Transformer/CachedTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static function (Options $options, $value) {
* @see https://www.php.net/manual/en/datetime.formats.relative.php
*/
if (\is_string($value)) {
$value = new \DateTime($value);
return new \DateTime($value);
}

return $value;
Expand Down
6 changes: 2 additions & 4 deletions src/Transformer/Xml/XpathEvaluatorTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,13 @@ public function transform(mixed $value, array $options = []): mixed

$query = $options['query'];
if (\is_array($query)) {
$result = array_map(
return array_map(
fn ($subquery): mixed => $this->query($xpath, $subquery['subquery'], $value, $subquery),
$query
);
} else {
$result = $this->query($xpath, $query, $value, $options);
}

return $result;
return $this->query($xpath, $query, $value, $options);
}

public function getCode(): string
Expand Down
Loading