Skip to content

Commit

Permalink
Aktualisiere PHP-CS-Fixer auf v3.62.0 (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude authored Aug 26, 2024
1 parent f2c6fc7 commit dc321cc
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fix-cs-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
ref: ${{ github.head_ref }}

- name: Run PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga:3.11.0
uses: docker://ghcr.io/webfactory/php-cs-fixer:3.62.0

- name: Commit and push back changes
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
2 changes: 1 addition & 1 deletion src/DestinationAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface DestinationAdapter
/**
* Get an Iterator over all $className objects in the destination system, ordered by their ascending IDs.
*
* @return Iterator
* @return \Iterator
*
* @psalm-return Iterator<Tr>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/SourceAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface SourceAdapter
/**
* Get an Iterator over all objects in the source system, ordered by their ascending IDs.
*
* @return Iterator
* @return \Iterator
*
* @psalm-return Iterator<Ts>
*/
Expand Down
15 changes: 7 additions & 8 deletions src/Synchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
namespace Webfactory\ContentMapping;

use Iterator;
use LogicException;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;

Expand Down Expand Up @@ -43,10 +42,10 @@ final class Synchronizer
private $logger;

/** @var ?int */
private $lastSourceId = null;
private $lastSourceId;

/** @var ?int */
private $lastDestinationId = null;
private $lastDestinationId;

/**
* @psalm-param SourceAdapter<Ts> $source
Expand All @@ -57,7 +56,7 @@ public function __construct(
SourceAdapter $source,
Mapper $mapper,
DestinationAdapter $destination,
LoggerInterface $logger = null
?LoggerInterface $logger = null
) {
$this->source = $source;
$this->mapper = $mapper;
Expand Down Expand Up @@ -128,7 +127,7 @@ private function fetchDestinationId(object $destinationObject): int
* @psalm-param Iterator<Ts> $sourceQueue
* @psalm-param Iterator<Tr> $destinationQueue
*/
private function compareQueuesAndReactAccordingly(Iterator $sourceQueue, Iterator $destinationQueue, string $className): void
private function compareQueuesAndReactAccordingly(\Iterator $sourceQueue, \Iterator $destinationQueue, string $className): void
{
while ($sourceQueue->valid() && $destinationQueue->valid()) {
$sourceObject = $sourceQueue->current();
Expand All @@ -145,7 +144,7 @@ private function compareQueuesAndReactAccordingly(Iterator $sourceQueue, Iterato
$destinationQueue->next();
} else {
if ($sourceObjectId != $destinationObjectId) {
throw new LogicException();
throw new \LogicException();
}
$this->update($sourceObject, $destinationObject);
$sourceQueue->next();
Expand Down Expand Up @@ -239,7 +238,7 @@ private function update(object $sourceObject, object $destinationObject): void
* @psalm-param Iterator<Ts> $sourceQueue
* @psalm-param Iterator<Tr> $destinationQueue
*/
private function insertRemainingSourceObjects(Iterator $sourceQueue, string $className): void
private function insertRemainingSourceObjects(\Iterator $sourceQueue, string $className): void
{
while ($sourceQueue->valid()) {
$sourceObject = $sourceQueue->current();
Expand All @@ -254,7 +253,7 @@ private function insertRemainingSourceObjects(Iterator $sourceQueue, string $cla
* @psalm-param Iterator<Ts> $sourceQueue
* @psalm-param Iterator<Tr> $destinationQueue
*/
private function deleteRemainingDestinationObjects(Iterator $destinationQueue): void
private function deleteRemainingDestinationObjects(\Iterator $destinationQueue): void
{
while ($destinationQueue->valid()) {
$destinationObject = $destinationQueue->current();
Expand Down
5 changes: 1 addition & 4 deletions tests/Stubs/DestinationStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ class DestinationStub implements DestinationAdapter
*/
private $objects;

/**
* @param $objects
*/
public function __construct(\Iterator $objects = null)
public function __construct(?\Iterator $objects = null)
{
$this->objects = $objects ?: new \ArrayIterator();
}
Expand Down
5 changes: 1 addition & 4 deletions tests/Stubs/SourceStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ class SourceStub implements SourceAdapter
*/
private $objects;

/**
* @param $objects
*/
public function __construct(\Iterator $objects = null)
public function __construct(?\Iterator $objects = null)
{
$this->objects = $objects ?: new \ArrayIterator();
}
Expand Down

0 comments on commit dc321cc

Please sign in to comment.