From e9c3a5143146df07863de11cf6c1e9ce9c1037be Mon Sep 17 00:00:00 2001 From: php-cs-fixer Date: Wed, 25 Oct 2023 18:27:08 +0000 Subject: [PATCH] Changes by php-cs-fixer --- src/CLI/Arguments.php | 3 +-- src/CodeClone.php | 2 +- src/CodeCloneMapIterator.php | 2 +- .../SuffixTree/ApproximateCloneDetectingSuffixTree.php | 2 +- src/Detector/Strategy/SuffixTree/CloneInfo.php | 2 +- src/Detector/Strategy/SuffixTree/SuffixTree.php | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/CLI/Arguments.php b/src/CLI/Arguments.php index a756326..c5deb25 100644 --- a/src/CLI/Arguments.php +++ b/src/CLI/Arguments.php @@ -44,8 +44,7 @@ public function __construct( private readonly ?string $algorithm, private readonly int $editDistance, private readonly int $headEquality - ) - { + ) { } /** diff --git a/src/CodeClone.php b/src/CodeClone.php index f4739e1..4e745fd 100644 --- a/src/CodeClone.php +++ b/src/CodeClone.php @@ -56,7 +56,7 @@ public function lines(string $indent = ''): string $this->lines = implode( '', array_map( - static fn(string $line): string => $indent.$line, + static fn (string $line): string => $indent.$line, \array_slice( file($file->name()), $file->startLine() - 1, diff --git a/src/CodeCloneMapIterator.php b/src/CodeCloneMapIterator.php index be7e0db..a69d192 100644 --- a/src/CodeCloneMapIterator.php +++ b/src/CodeCloneMapIterator.php @@ -33,7 +33,7 @@ public function __construct(CodeCloneMap $clones) usort( $this->clones, - static fn(CodeClone $a, CodeClone $b): int => $a->numberOfLines() <=> $b->numberOfLines() + static fn (CodeClone $a, CodeClone $b): int => $a->numberOfLines() <=> $b->numberOfLines() ); $this->clones = array_reverse($this->clones); diff --git a/src/Detector/Strategy/SuffixTree/ApproximateCloneDetectingSuffixTree.php b/src/Detector/Strategy/SuffixTree/ApproximateCloneDetectingSuffixTree.php index 1c69ae0..4e69906 100644 --- a/src/Detector/Strategy/SuffixTree/ApproximateCloneDetectingSuffixTree.php +++ b/src/Detector/Strategy/SuffixTree/ApproximateCloneDetectingSuffixTree.php @@ -172,7 +172,7 @@ public function findClones(int $minLength, int $maxErrors, int $headEquality): a /** @var CloneInfo[] $values */ $values = array_values($map); - usort($values, static fn(CloneInfo $a, CloneInfo $b): int => $b->length - $a->length); + usort($values, static fn (CloneInfo $a, CloneInfo $b): int => $b->length - $a->length); return $values; } diff --git a/src/Detector/Strategy/SuffixTree/CloneInfo.php b/src/Detector/Strategy/SuffixTree/CloneInfo.php index 5b3b73b..b133b82 100644 --- a/src/Detector/Strategy/SuffixTree/CloneInfo.php +++ b/src/Detector/Strategy/SuffixTree/CloneInfo.php @@ -46,7 +46,7 @@ class CloneInfo public function __construct(int $length, int $position, /** * Number of occurrences of the clone. */ - private readonly int $occurrences, AbstractToken $token, PairList $otherClones) + private readonly int $occurrences, AbstractToken $token, PairList $otherClones) { $this->length = $length; $this->position = $position; diff --git a/src/Detector/Strategy/SuffixTree/SuffixTree.php b/src/Detector/Strategy/SuffixTree/SuffixTree.php index 4bb947f..acb40ff 100644 --- a/src/Detector/Strategy/SuffixTree/SuffixTree.php +++ b/src/Detector/Strategy/SuffixTree/SuffixTree.php @@ -147,7 +147,7 @@ class SuffixTree public function __construct(/** * The word we are working on. */ - protected $word) + protected $word) { $size = \count($word); $this->INFTY = $size;