Skip to content

Commit c243095

Browse files
localheinzsebastianbergmann
authored andcommitted
Fix: Run friendsofphp/php-cs-fixer
1 parent 1381b9f commit c243095

38 files changed

+70
-265
lines changed

src/Chunk.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10-
1110
namespace SebastianBergmann\Diff;
1211

1312
final class Chunk

src/Diff.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10-
1110
namespace SebastianBergmann\Diff;
1211

1312
final class Diff
@@ -28,8 +27,6 @@ final class Diff
2827
private $chunks;
2928

3029
/**
31-
* @param string $from
32-
* @param string $to
3330
* @param Chunk[] $chunks
3431
*/
3532
public function __construct(string $from, string $to, array $chunks = [])

src/Differ.php

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10-
1110
namespace SebastianBergmann\Diff;
1211

1312
use SebastianBergmann\Diff\Output\DiffOutputBuilderInterface;
@@ -19,9 +18,13 @@
1918
final class Differ
2019
{
2120
public const OLD = 0;
21+
2222
public const ADDED = 1;
23+
2324
public const REMOVED = 2;
25+
2426
public const DIFF_LINE_END_WARNING = 3;
27+
2528
public const NO_LINE_END_EOF_WARNING = 4;
2629

2730
/**
@@ -58,11 +61,8 @@ public function __construct($outputBuilder = null)
5861
/**
5962
* Returns the diff between two arrays or strings as string.
6063
*
61-
* @param array|string $from
62-
* @param array|string $to
63-
* @param null|LongestCommonSubsequenceCalculator $lcs
64-
*
65-
* @return string
64+
* @param array|string $from
65+
* @param array|string $to
6666
*/
6767
public function diff($from, $to, LongestCommonSubsequenceCalculator $lcs = null): string
6868
{
@@ -89,8 +89,6 @@ public function diff($from, $to, LongestCommonSubsequenceCalculator $lcs = null)
8989
* @param array|string $from
9090
* @param array|string $to
9191
* @param LongestCommonSubsequenceCalculator $lcs
92-
*
93-
* @return array
9492
*/
9593
public function diffToArray($from, $to, LongestCommonSubsequenceCalculator $lcs = null): array
9694
{
@@ -159,8 +157,6 @@ public function diffToArray($from, $to, LongestCommonSubsequenceCalculator $lcs
159157
/**
160158
* Casts variable to string if it is not a string or array.
161159
*
162-
* @param mixed $input
163-
*
164160
* @return array|string
165161
*/
166162
private function normalizeDiffInput($input)
@@ -174,22 +170,12 @@ private function normalizeDiffInput($input)
174170

175171
/**
176172
* Checks if input is string, if so it will split it line-by-line.
177-
*
178-
* @param string $input
179-
*
180-
* @return array
181173
*/
182174
private function splitStringByLines(string $input): array
183175
{
184-
return \preg_split('/(.*\R)/', $input, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
176+
return \preg_split('/(.*\R)/', $input, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
185177
}
186178

187-
/**
188-
* @param array $from
189-
* @param array $to
190-
*
191-
* @return LongestCommonSubsequenceCalculator
192-
*/
193179
private function selectLcsImplementation(array $from, array $to): LongestCommonSubsequenceCalculator
194180
{
195181
// We do not want to use the time-efficient implementation if its memory
@@ -208,24 +194,17 @@ private function selectLcsImplementation(array $from, array $to): LongestCommonS
208194
/**
209195
* Calculates the estimated memory footprint for the DP-based method.
210196
*
211-
* @param array $from
212-
* @param array $to
213-
*
214197
* @return float|int
215198
*/
216199
private function calculateEstimatedFootprint(array $from, array $to)
217200
{
218-
$itemSize = PHP_INT_SIZE === 4 ? 76 : 144;
201+
$itemSize = \PHP_INT_SIZE === 4 ? 76 : 144;
219202

220203
return $itemSize * \min(\count($from), \count($to)) ** 2;
221204
}
222205

223206
/**
224207
* Returns true if line ends don't match in a diff.
225-
*
226-
* @param array $diff
227-
*
228-
* @return bool
229208
*/
230209
private function detectUnmatchedLineEndings(array $diff): bool
231210
{

src/Exception/ConfigurationException.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,10 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10-
1110
namespace SebastianBergmann\Diff;
1211

1312
final class ConfigurationException extends InvalidArgumentException
1413
{
15-
/**
16-
* @param string $option
17-
* @param string $expected
18-
* @param mixed $value
19-
* @param int $code
20-
* @param null|\Exception $previous
21-
*/
2214
public function __construct(
2315
string $option,
2416
string $expected,

src/Exception/Exception.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10-
1110
namespace SebastianBergmann\Diff;
1211

1312
interface Exception

src/Exception/InvalidArgumentException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10-
1110
namespace SebastianBergmann\Diff;
1211

1312
class InvalidArgumentException extends \InvalidArgumentException implements Exception

src/Line.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10-
1110
namespace SebastianBergmann\Diff;
1211

1312
final class Line
1413
{
1514
public const ADDED = 1;
15+
1616
public const REMOVED = 2;
17+
1718
public const UNCHANGED = 3;
1819

1920
/**

src/LongestCommonSubsequenceCalculator.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,12 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10-
1110
namespace SebastianBergmann\Diff;
1211

1312
interface LongestCommonSubsequenceCalculator
1413
{
1514
/**
1615
* Calculates the longest common subsequence of two arrays.
17-
*
18-
* @param array $from
19-
* @param array $to
20-
*
21-
* @return array
2216
*/
2317
public function calculate(array $from, array $to): array;
2418
}

src/MemoryEfficientLongestCommonSubsequenceCalculator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10-
1110
namespace SebastianBergmann\Diff;
1211

1312
final class MemoryEfficientLongestCommonSubsequenceCalculator implements LongestCommonSubsequenceCalculator

src/Output/AbstractChunkOutputBuilder.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,13 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10-
1110
namespace SebastianBergmann\Diff\Output;
1211

1312
abstract class AbstractChunkOutputBuilder implements DiffOutputBuilderInterface
1413
{
1514
/**
1615
* Takes input of the diff array and returns the common parts.
1716
* Iterates through diff line by line.
18-
*
19-
* @param array $diff
20-
* @param int $lineThreshold
21-
*
22-
* @return array
2317
*/
2418
protected function getCommonChunks(array $diff, int $lineThreshold = 5): array
2519
{

0 commit comments

Comments
 (0)