From dc2bd56b493879263a5c38f5fe5476e3c9a8299b Mon Sep 17 00:00:00 2001 From: Christian Kuhn Date: Sat, 23 Oct 2021 13:56:07 +0200 Subject: [PATCH 1/8] [TASK] Require symfony/polyfill-mbstring This is a drop in replacement if php-mbstring is not available. Using symfony/polyfill-mbstring we avoid the hard dependency to php-mbstring. composer req symfony/polyfill-mbstring --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7614d66..d5b3c0b 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "type": "library", "require": { "php": ">=7.2.0", - "ext-mbstring": "*" + "symfony/polyfill-mbstring": "^1.23" }, "require-dev": { "phpunit/phpunit": "^8 || ^9", From c9b9e7a1289e69aa047aabf53dd546d23cb3ab1d Mon Sep 17 00:00:00 2001 From: Christian Kuhn Date: Sat, 23 Oct 2021 14:11:53 +0200 Subject: [PATCH 2/8] [TASK] Add some multibyte tests --- tests/DiffTest.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/DiffTest.php b/tests/DiffTest.php index ee3b71b..2891a55 100644 --- a/tests/DiffTest.php +++ b/tests/DiffTest.php @@ -78,6 +78,13 @@ public function setAndGetGranularity(): void public function processAndRenderDataProvider(): array { return [ + 'empty strings' => [ + new Character(), + '', + '', + '', + '', + ], 'single word' => [ new Character(), 'hello', @@ -142,6 +149,27 @@ public function processAndRenderDataProvider(): array 'This is the 1st sentence. Its then carried on into another.\n It then carries on into another.' . chr(10) . 'This is another paragraph, just to test things further!', ], + 'multibyte strings #1' => [ + new Character(), + 'tränenüberströmt', + '', + 'd16', + 'tränenüberströmt' + ], + 'multibyte strings #2' => [ + new Character(), + '', + 'tränenüberströmt', + 'i16:tränenüberströmt', + 'tränenüberströmt' + ], + 'multibyte strings #3' => [ + new Character(), + 'tränenüberströmt', + 'tränenuebärströmt', + 'c6di2:uecdi:äc7', + 'tränenüuebeärströmt' + ], ]; } From f287fefe822e3af00cab24b6fec7d5d23e057b84 Mon Sep 17 00:00:00 2001 From: Christian Kuhn Date: Sat, 23 Oct 2021 14:12:28 +0200 Subject: [PATCH 3/8] [BUGFIX] Drop some unreachable code extractFragments() is only called from within diff(), which tests for empty $delimiters aleady, the if body in extractFragments() can't be reached. Avoids call to non-multibyte safe str_split(). --- src/Parser/Parser.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Parser/Parser.php b/src/Parser/Parser.php index 6f601df..ac70722 100644 --- a/src/Parser/Parser.php +++ b/src/Parser/Parser.php @@ -427,14 +427,6 @@ protected function charDiff($from_text, $to_text) */ protected function extractFragments($text, $delimiters) { - // special case: split into characters - if (empty($delimiters)) { - $chars = str_split($text, 1); - $chars[mb_strlen($text)] = ''; - - return $chars; - } - $fragments = []; $start = 0; $end = 0; From 523d3ef7daa10e399979f8fa353331a3d92c332f Mon Sep 17 00:00:00 2001 From: Christian Kuhn Date: Sat, 23 Oct 2021 14:26:52 +0200 Subject: [PATCH 4/8] [TASK] Declace strict_types=1 in tests --- tests/DelimitersTest.php | 1 + tests/DiffTest.php | 1 + tests/Granularity/CharacterTest.php | 1 + tests/Granularity/ParagraphTest.php | 1 + tests/Granularity/SentenceTest.php | 1 + tests/Granularity/WordTest.php | 1 + tests/Parser/OpcodesTest.php | 1 + tests/Parser/Operations/CopyTest.php | 1 + tests/Parser/Operations/DeleteTest.php | 1 + tests/Parser/Operations/InsertTest.php | 1 + tests/Parser/Operations/ReplaceTest.php | 1 + tests/Parser/ParserTest.php | 1 + tests/Render/HtmlTest.php | 1 + tests/Render/TextTest.php | 1 + 14 files changed, 14 insertions(+) diff --git a/tests/DelimitersTest.php b/tests/DelimitersTest.php index adbdce9..fb68980 100644 --- a/tests/DelimitersTest.php +++ b/tests/DelimitersTest.php @@ -1,4 +1,5 @@ Date: Sat, 23 Oct 2021 14:33:37 +0200 Subject: [PATCH 5/8] [TASK] declare_strict in all files --- .php-cs-fixer.dist.php | 1 + src/Delimiters.php | 2 ++ src/Diff.php | 3 ++- src/Exceptions/GranularityCountException.php | 2 ++ src/Exceptions/OperationException.php | 2 ++ src/Granularity/Character.php | 2 ++ src/Granularity/Granularity.php | 2 ++ src/Granularity/GranularityInterface.php | 2 ++ src/Granularity/Paragraph.php | 2 ++ src/Granularity/Sentence.php | 2 ++ src/Granularity/Word.php | 2 ++ src/Parser/Opcodes.php | 2 ++ src/Parser/OpcodesInterface.php | 2 ++ src/Parser/Operations/Copy.php | 2 ++ src/Parser/Operations/Delete.php | 2 ++ src/Parser/Operations/Insert.php | 2 ++ src/Parser/Operations/OperationInterface.php | 2 ++ src/Parser/Operations/Replace.php | 2 ++ src/Parser/Parser.php | 2 ++ src/Parser/ParserInterface.php | 2 ++ src/Render/Html.php | 2 ++ src/Render/Renderer.php | 2 ++ src/Render/RendererInterface.php | 2 ++ src/Render/Text.php | 2 ++ tests/DelimitersTest.php | 1 + tests/DiffTest.php | 1 + tests/Granularity/CharacterTest.php | 1 + tests/Granularity/ParagraphTest.php | 1 + tests/Granularity/SentenceTest.php | 1 + tests/Granularity/WordTest.php | 1 + tests/Parser/OpcodesTest.php | 1 + tests/Parser/Operations/CopyTest.php | 1 + tests/Parser/Operations/DeleteTest.php | 1 + tests/Parser/Operations/InsertTest.php | 1 + tests/Parser/Operations/ReplaceTest.php | 1 + tests/Parser/ParserTest.php | 1 + tests/Render/HtmlTest.php | 1 + tests/Render/TextTest.php | 1 + 38 files changed, 61 insertions(+), 1 deletion(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index cf08a34..11eacda 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -21,6 +21,7 @@ 'compact_nullable_typehint' => true, 'concat_space' => ['spacing' => 'one'], 'declare_equal_normalize' => ['space' => 'none'], + 'declare_strict_types' => true, 'dir_constant' => true, 'function_typehint_space' => true, 'lowercase_cast' => true, diff --git a/src/Delimiters.php b/src/Delimiters.php index 723a46a..af0e39d 100644 --- a/src/Delimiters.php +++ b/src/Delimiters.php @@ -1,5 +1,7 @@ Date: Sat, 23 Oct 2021 14:43:56 +0200 Subject: [PATCH 6/8] [TASK] Update PHP file header --- .php-cs-fixer.dist.php | 8 +++++++ src/Delimiters.php | 17 +++++-------- src/Diff.php | 17 +++++-------- src/Exceptions/GranularityCountException.php | 25 ++++++++------------ src/Exceptions/OperationException.php | 17 +++++-------- src/Granularity/Character.php | 17 +++++-------- src/Granularity/Granularity.php | 17 +++++-------- src/Granularity/GranularityInterface.php | 17 +++++-------- src/Granularity/Paragraph.php | 17 +++++-------- src/Granularity/Sentence.php | 17 +++++-------- src/Granularity/Word.php | 17 +++++-------- src/Parser/Opcodes.php | 17 +++++-------- src/Parser/OpcodesInterface.php | 17 +++++-------- src/Parser/Operations/Copy.php | 17 +++++-------- src/Parser/Operations/Delete.php | 17 +++++-------- src/Parser/Operations/Insert.php | 17 +++++-------- src/Parser/Operations/OperationInterface.php | 17 +++++-------- src/Parser/Operations/Replace.php | 17 +++++-------- src/Parser/Parser.php | 17 +++++-------- src/Parser/ParserInterface.php | 17 +++++-------- src/Render/Html.php | 17 +++++-------- src/Render/Renderer.php | 17 +++++-------- src/Render/RendererInterface.php | 17 +++++-------- src/Render/Text.php | 17 +++++-------- tests/DelimitersTest.php | 11 +++++++++ tests/DiffTest.php | 11 +++++++++ tests/Granularity/CharacterTest.php | 11 +++++++++ tests/Granularity/ParagraphTest.php | 11 +++++++++ tests/Granularity/SentenceTest.php | 11 +++++++++ tests/Granularity/WordTest.php | 11 +++++++++ tests/Parser/OpcodesTest.php | 11 +++++++++ tests/Parser/Operations/CopyTest.php | 11 +++++++++ tests/Parser/Operations/DeleteTest.php | 11 +++++++++ tests/Parser/Operations/InsertTest.php | 11 +++++++++ tests/Parser/Operations/ReplaceTest.php | 11 +++++++++ tests/Parser/ParserTest.php | 11 +++++++++ tests/Render/HtmlTest.php | 11 +++++++++ tests/Render/TextTest.php | 11 +++++++++ 38 files changed, 304 insertions(+), 257 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 11eacda..ca99256 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -24,6 +24,14 @@ 'declare_strict_types' => true, 'dir_constant' => true, 'function_typehint_space' => true, + 'header_comment' => [ + 'header' => 'FINE granularity DIFF' + . chr(10) . chr(10) . '(c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441)' + . chr(10) . '(c) 2013 Robert Crowe (http://cogpowered.com)' + . chr(10) . '(c) 2021 Christian Kuhn' + . chr(10). chr(10) . 'For the full copyright and license information, please view' + . chr(10) . 'the LICENSE file that was distributed with this source code.', + ], 'lowercase_cast' => true, 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], 'modernize_types_casting' => true, diff --git a/src/Delimiters.php b/src/Delimiters.php index af0e39d..18088d9 100644 --- a/src/Delimiters.php +++ b/src/Delimiters.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. - * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff; diff --git a/src/Diff.php b/src/Diff.php index 59e4808..8de3c9a 100644 --- a/src/Diff.php +++ b/src/Diff.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. - * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff; diff --git a/src/Exceptions/GranularityCountException.php b/src/Exceptions/GranularityCountException.php index 3f748e1..859c6e9 100644 --- a/src/Exceptions/GranularityCountException.php +++ b/src/Exceptions/GranularityCountException.php @@ -2,21 +2,16 @@ declare(strict_types=1); -/** -* FINE granularity DIFF -* -* Computes a set of instructions to convert the content of -* one string into another. -* -* Originally created by Raymond Hill (github.com/gorhill/PHP-FineDiff), brought up -* to date by Cog Powered (github.com/cogpowered/FineDiff). -* -* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) -* @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) -* @link https://github.com/cogpowered/FineDiff -* @version 0.0.1 -* @license MIT License (http://www.opensource.org/licenses/mit-license.php) -*/ +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ namespace cogpowered\FineDiff\Exceptions; diff --git a/src/Exceptions/OperationException.php b/src/Exceptions/OperationException.php index ff4541a..5922a11 100644 --- a/src/Exceptions/OperationException.php +++ b/src/Exceptions/OperationException.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. - * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Exceptions; diff --git a/src/Granularity/Character.php b/src/Granularity/Character.php index 60b0665..f2691a6 100644 --- a/src/Granularity/Character.php +++ b/src/Granularity/Character.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. - * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Granularity; diff --git a/src/Granularity/Granularity.php b/src/Granularity/Granularity.php index 91754a4..a986716 100644 --- a/src/Granularity/Granularity.php +++ b/src/Granularity/Granularity.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. - * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Granularity; diff --git a/src/Granularity/GranularityInterface.php b/src/Granularity/GranularityInterface.php index 5a57e67..42fa9f4 100644 --- a/src/Granularity/GranularityInterface.php +++ b/src/Granularity/GranularityInterface.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). - * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Granularity; diff --git a/src/Granularity/Paragraph.php b/src/Granularity/Paragraph.php index 434d4b6..0536a5e 100644 --- a/src/Granularity/Paragraph.php +++ b/src/Granularity/Paragraph.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. - * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Granularity; diff --git a/src/Granularity/Sentence.php b/src/Granularity/Sentence.php index 6e7c52d..c32a0e5 100644 --- a/src/Granularity/Sentence.php +++ b/src/Granularity/Sentence.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. - * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Granularity; diff --git a/src/Granularity/Word.php b/src/Granularity/Word.php index 19ab6c1..e374c41 100644 --- a/src/Granularity/Word.php +++ b/src/Granularity/Word.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. - * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Granularity; diff --git a/src/Parser/Opcodes.php b/src/Parser/Opcodes.php index 53c61ae..4cb3d35 100644 --- a/src/Parser/Opcodes.php +++ b/src/Parser/Opcodes.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. - * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Parser; diff --git a/src/Parser/OpcodesInterface.php b/src/Parser/OpcodesInterface.php index 437c318..853f929 100644 --- a/src/Parser/OpcodesInterface.php +++ b/src/Parser/OpcodesInterface.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). - * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Parser; diff --git a/src/Parser/Operations/Copy.php b/src/Parser/Operations/Copy.php index 7ea59b2..83c46b6 100644 --- a/src/Parser/Operations/Copy.php +++ b/src/Parser/Operations/Copy.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. - * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Parser\Operations; diff --git a/src/Parser/Operations/Delete.php b/src/Parser/Operations/Delete.php index 7452b39..a183bdc 100644 --- a/src/Parser/Operations/Delete.php +++ b/src/Parser/Operations/Delete.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. - * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Parser\Operations; diff --git a/src/Parser/Operations/Insert.php b/src/Parser/Operations/Insert.php index 14f5023..0e1a4a5 100644 --- a/src/Parser/Operations/Insert.php +++ b/src/Parser/Operations/Insert.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. - * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Parser\Operations; diff --git a/src/Parser/Operations/OperationInterface.php b/src/Parser/Operations/OperationInterface.php index 7f472dc..20294e8 100644 --- a/src/Parser/Operations/OperationInterface.php +++ b/src/Parser/Operations/OperationInterface.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). - * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Parser\Operations; diff --git a/src/Parser/Operations/Replace.php b/src/Parser/Operations/Replace.php index 55b5830..8e834a0 100644 --- a/src/Parser/Operations/Replace.php +++ b/src/Parser/Operations/Replace.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). - * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Parser\Operations; diff --git a/src/Parser/Parser.php b/src/Parser/Parser.php index 3de2bc8..b65820a 100644 --- a/src/Parser/Parser.php +++ b/src/Parser/Parser.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. - * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Parser; diff --git a/src/Parser/ParserInterface.php b/src/Parser/ParserInterface.php index 7508d04..a410235 100644 --- a/src/Parser/ParserInterface.php +++ b/src/Parser/ParserInterface.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). - * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Parser; diff --git a/src/Render/Html.php b/src/Render/Html.php index c0ca4f5..9b5e369 100644 --- a/src/Render/Html.php +++ b/src/Render/Html.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). - * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Render; diff --git a/src/Render/Renderer.php b/src/Render/Renderer.php index 145f7cf..f6c309f 100644 --- a/src/Render/Renderer.php +++ b/src/Render/Renderer.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). - * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Render; diff --git a/src/Render/RendererInterface.php b/src/Render/RendererInterface.php index 36e1f11..72f5953 100644 --- a/src/Render/RendererInterface.php +++ b/src/Render/RendererInterface.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). - * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Render; diff --git a/src/Render/Text.php b/src/Render/Text.php index 01812a8..1cbff6e 100644 --- a/src/Render/Text.php +++ b/src/Render/Text.php @@ -2,20 +2,15 @@ declare(strict_types=1); -/** +/* * FINE granularity DIFF * - * Computes a set of instructions to convert the content of - * one string into another. + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn * - * Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up - * to date by Cog Powered (https://github.com/cogpowered/FineDiff). - * - * @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441) - * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com) - * @link https://github.com/cogpowered/FineDiff - * @version 0.0.1 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace cogpowered\FineDiff\Render; diff --git a/tests/DelimitersTest.php b/tests/DelimitersTest.php index 79d2f71..10f0dcb 100644 --- a/tests/DelimitersTest.php +++ b/tests/DelimitersTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests; use cogpowered\FineDiff\Delimiters; diff --git a/tests/DiffTest.php b/tests/DiffTest.php index 9b954b7..c18bb25 100644 --- a/tests/DiffTest.php +++ b/tests/DiffTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests; use cogpowered\FineDiff\Diff; diff --git a/tests/Granularity/CharacterTest.php b/tests/Granularity/CharacterTest.php index 5bbacdb..d68cd51 100644 --- a/tests/Granularity/CharacterTest.php +++ b/tests/Granularity/CharacterTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests\Granularity; use cogpowered\FineDiff\Delimiters; diff --git a/tests/Granularity/ParagraphTest.php b/tests/Granularity/ParagraphTest.php index b387620..1726eb8 100644 --- a/tests/Granularity/ParagraphTest.php +++ b/tests/Granularity/ParagraphTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests\Granularity; use cogpowered\FineDiff\Delimiters; diff --git a/tests/Granularity/SentenceTest.php b/tests/Granularity/SentenceTest.php index cb42abe..984da80 100644 --- a/tests/Granularity/SentenceTest.php +++ b/tests/Granularity/SentenceTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests\Granularity; use cogpowered\FineDiff\Delimiters; diff --git a/tests/Granularity/WordTest.php b/tests/Granularity/WordTest.php index 27f2e67..64a8509 100644 --- a/tests/Granularity/WordTest.php +++ b/tests/Granularity/WordTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests\Granularity; use cogpowered\FineDiff\Delimiters; diff --git a/tests/Parser/OpcodesTest.php b/tests/Parser/OpcodesTest.php index f944a49..266b87d 100644 --- a/tests/Parser/OpcodesTest.php +++ b/tests/Parser/OpcodesTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests\Parser; use cogpowered\FineDiff\Exceptions\OperationException; diff --git a/tests/Parser/Operations/CopyTest.php b/tests/Parser/Operations/CopyTest.php index 217c2ec..ac37288 100644 --- a/tests/Parser/Operations/CopyTest.php +++ b/tests/Parser/Operations/CopyTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests\Parser\Operations; use cogpowered\FineDiff\Parser\Operations\Copy; diff --git a/tests/Parser/Operations/DeleteTest.php b/tests/Parser/Operations/DeleteTest.php index 5d231c6..8193fed 100644 --- a/tests/Parser/Operations/DeleteTest.php +++ b/tests/Parser/Operations/DeleteTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests\Parser\Operations; use cogpowered\FineDiff\Parser\Operations\Delete; diff --git a/tests/Parser/Operations/InsertTest.php b/tests/Parser/Operations/InsertTest.php index 8b98734..3a31ce1 100644 --- a/tests/Parser/Operations/InsertTest.php +++ b/tests/Parser/Operations/InsertTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests\Parser\Operations; use cogpowered\FineDiff\Parser\Operations\Insert; diff --git a/tests/Parser/Operations/ReplaceTest.php b/tests/Parser/Operations/ReplaceTest.php index 712a591..9b59e1b 100644 --- a/tests/Parser/Operations/ReplaceTest.php +++ b/tests/Parser/Operations/ReplaceTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests\Parser\Operations; use cogpowered\FineDiff\Parser\Operations\OperationInterface; diff --git a/tests/Parser/ParserTest.php b/tests/Parser/ParserTest.php index 9991194..7ece47a 100644 --- a/tests/Parser/ParserTest.php +++ b/tests/Parser/ParserTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests\Parser; use cogpowered\FineDiff\Exceptions\GranularityCountException; diff --git a/tests/Render/HtmlTest.php b/tests/Render/HtmlTest.php index 6ad542a..8d8c759 100644 --- a/tests/Render/HtmlTest.php +++ b/tests/Render/HtmlTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests\Render; use cogpowered\FineDiff\Render\Html; diff --git a/tests/Render/TextTest.php b/tests/Render/TextTest.php index ff1e019..8bf5326 100644 --- a/tests/Render/TextTest.php +++ b/tests/Render/TextTest.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * FINE granularity DIFF + * + * (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441) + * (c) 2013 Robert Crowe (http://cogpowered.com) + * (c) 2021 Christian Kuhn + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace cogpowered\FineDiff\Tests\Render; use cogpowered\FineDiff\Render\Text; From c5ea9e69666367d8e58f917f125bfc79e16ebdef Mon Sep 17 00:00:00 2001 From: Christian Kuhn Date: Sat, 23 Oct 2021 15:57:01 +0200 Subject: [PATCH 7/8] [!!!][TASK] Harden codebase towards strict typing Adds type hints where possible. Main methods like Diff->render() now accept strings and similar. Enables phpstan level 6. This is b/w compat breaking since types are now enforced. --- phpstan.neon.dist | 8 ++- src/Diff.php | 43 +++++------------ src/Granularity/Character.php | 3 ++ src/Granularity/Granularity.php | 8 +-- src/Granularity/GranularityInterface.php | 16 ++++-- src/Granularity/Paragraph.php | 3 ++ src/Granularity/Sentence.php | 3 ++ src/Granularity/Word.php | 3 ++ src/Parser/Opcodes.php | 16 +++--- src/Parser/OpcodesInterface.php | 18 +++---- src/Parser/Operations/Copy.php | 19 ++------ src/Parser/Operations/Delete.php | 18 ++----- src/Parser/Operations/Insert.php | 26 ++-------- src/Parser/Operations/OperationInterface.php | 17 ++----- src/Parser/Operations/Replace.php | 24 ++------- src/Parser/Parser.php | 51 ++++++++------------ src/Parser/ParserInterface.php | 16 ++---- src/Render/Html.php | 2 +- src/Render/Renderer.php | 2 +- src/Render/RendererInterface.php | 12 ++++- src/Render/Text.php | 3 +- tests/DiffTest.php | 3 ++ tests/Granularity/CharacterTest.php | 4 +- tests/Parser/Operations/ReplaceTest.php | 5 +- 24 files changed, 126 insertions(+), 197 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index c0fc603..5bfd01e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,6 +1,12 @@ parameters: - level: 5 + level: 6 paths: - ./src - ./tests + + ignoreErrors: + - + message: "#^Parameter \\#1 \\$opcodes of method cogpowered\\\\FineDiff\\\\Parser\\\\Opcodes\\:\\:setOpcodes\\(\\) expects array\\, array\\ given\\.$#" + count: 1 + path: tests/Parser/OpcodesTest.php diff --git a/src/Diff.php b/src/Diff.php index 8de3c9a..0204c18 100644 --- a/src/Diff.php +++ b/src/Diff.php @@ -52,24 +52,15 @@ class Diff */ public function __construct(GranularityInterface $granularity = null, RendererInterface $renderer = null, ParserInterface $parser = null) { - // Set some sensible defaults - - // Set the granularity of the diff $this->granularity = $granularity ?? new Character(); - - // Set the renderer to use when calling Diff::render $this->renderer = $renderer ?? new Html(); - - // Set the diff parser $this->parser = $parser ?? new Parser($this->granularity); } /** * Returns the granularity object used by the parser. - * - * @return GranularityInterface */ - public function getGranularity() + public function getGranularity(): GranularityInterface { return $this->parser->getGranularity(); } @@ -77,17 +68,15 @@ public function getGranularity() /** * Set the granularity level of the parser. */ - public function setGranularity(GranularityInterface $granularity) + public function setGranularity(GranularityInterface $granularity): void { $this->parser->setGranularity($granularity); } /** * Get the render. - * - * @return RendererInterface */ - public function getRenderer() + public function getRenderer(): RendererInterface { return $this->renderer; } @@ -95,17 +84,15 @@ public function getRenderer() /** * Set the renderer. */ - public function setRenderer(RendererInterface $renderer) + public function setRenderer(RendererInterface $renderer): void { $this->renderer = $renderer; } /** * Get the parser responsible for generating the diff/opcodes. - * - * @return ParserInterface */ - public function getParser() + public function getParser(): ParserInterface { return $this->parser; } @@ -113,7 +100,7 @@ public function getParser() /** * Set the parser. */ - public function setParser(ParserInterface $parser) + public function setParser(ParserInterface $parser): void { $this->parser = $parser; } @@ -121,30 +108,22 @@ public function setParser(ParserInterface $parser) /** * Gets the diff / opcodes between two strings. * - * Returns the opcode diff which can be used for example, to - * to generate a HTML report of the differences. - * - * @return OpcodesInterface + * Returns the opcode diff which can be used for example + * to generate HTML report of the differences. */ - public function getOpcodes($from_text, $to_text) + public function getOpcodes(string $from_text, string $to_text): OpcodesInterface { return $this->parser->parse($from_text, $to_text); } /** * Render the difference between two strings. - * - * By default will return the difference as HTML. - * - * @param string $from_text - * @param string $to_text - * @return string + * By default, will return the difference as HTML. */ - public function render($from_text, $to_text) + public function render(string $from_text, string $to_text): string { // First we need the opcodes $opcodes = $this->getOpcodes($from_text, $to_text); - return $this->renderer->process($from_text, $opcodes); } } diff --git a/src/Granularity/Character.php b/src/Granularity/Character.php index f2691a6..2cb0cd5 100644 --- a/src/Granularity/Character.php +++ b/src/Granularity/Character.php @@ -22,6 +22,9 @@ */ class Character extends Granularity { + /** + * @var array + */ protected $delimiters = [ Delimiters::PARAGRAPH, Delimiters::SENTENCE, diff --git a/src/Granularity/Granularity.php b/src/Granularity/Granularity.php index a986716..1089c7e 100644 --- a/src/Granularity/Granularity.php +++ b/src/Granularity/Granularity.php @@ -21,7 +21,7 @@ abstract class Granularity implements GranularityInterface { /** - * @var array Extending granularities should override this. + * @var array Extending granularities should override this. */ protected $delimiters = []; @@ -40,7 +40,7 @@ public function offsetExists($offset) #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->delimiters[$offset]) ? $this->delimiters[$offset] : null; + return $this->delimiters[$offset] ?? null; } /** @@ -79,7 +79,7 @@ public function count() /** * @inheritdoc */ - public function getDelimiters() + public function getDelimiters(): array { return $this->delimiters; } @@ -87,7 +87,7 @@ public function getDelimiters() /** * @inheritdoc */ - public function setDelimiters(array $delimiters) + public function setDelimiters(array $delimiters): void { $this->delimiters = $delimiters; } diff --git a/src/Granularity/GranularityInterface.php b/src/Granularity/GranularityInterface.php index 42fa9f4..953525a 100644 --- a/src/Granularity/GranularityInterface.php +++ b/src/Granularity/GranularityInterface.php @@ -15,19 +15,25 @@ namespace cogpowered\FineDiff\Granularity; -interface GranularityInterface extends \ArrayAccess, \Countable +use ArrayAccess; +use Countable; + +/** + * @extends ArrayAccess + */ +interface GranularityInterface extends ArrayAccess, Countable { /** * Get the delimiters that make up the granularity. * - * @return array + * @return array */ - public function getDelimiters(); + public function getDelimiters(): array; /** * Set the delimiters that make up the granularity. * - * @param array $delimiters + * @param array $delimiters */ - public function setDelimiters(array $delimiters); + public function setDelimiters(array $delimiters): void; } diff --git a/src/Granularity/Paragraph.php b/src/Granularity/Paragraph.php index 0536a5e..12f3d32 100644 --- a/src/Granularity/Paragraph.php +++ b/src/Granularity/Paragraph.php @@ -22,6 +22,9 @@ */ class Paragraph extends Granularity { + /** + * @var array + */ protected $delimiters = [ Delimiters::PARAGRAPH, ]; diff --git a/src/Granularity/Sentence.php b/src/Granularity/Sentence.php index c32a0e5..5e68cfb 100644 --- a/src/Granularity/Sentence.php +++ b/src/Granularity/Sentence.php @@ -22,6 +22,9 @@ */ class Sentence extends Granularity { + /** + * @var array + */ protected $delimiters = [ Delimiters::PARAGRAPH, Delimiters::SENTENCE, diff --git a/src/Granularity/Word.php b/src/Granularity/Word.php index e374c41..c9b5992 100644 --- a/src/Granularity/Word.php +++ b/src/Granularity/Word.php @@ -22,6 +22,9 @@ */ class Word extends Granularity { + /** + * @var array + */ protected $delimiters = [ Delimiters::PARAGRAPH, Delimiters::SENTENCE, diff --git a/src/Parser/Opcodes.php b/src/Parser/Opcodes.php index 4cb3d35..bfc6ffb 100644 --- a/src/Parser/Opcodes.php +++ b/src/Parser/Opcodes.php @@ -24,32 +24,30 @@ class Opcodes implements OpcodesInterface { /** - * @var array Individual opcodes. + * @var array Individual opcodes. */ protected $opcodes = []; /** * @inheritdoc */ - public function getOpcodes() + public function getOpcodes(): array { return $this->opcodes; } /** * @inheritdoc + * @throws OperationException */ - public function setOpcodes(array $opcodes) + public function setOpcodes(array $opcodes): void { $this->opcodes = []; - - // Ensure that all elements of the array - // are of the correct type + // Ensure that all elements of the array are of the correct type. foreach ($opcodes as $opcode) { - if (!is_a($opcode, OperationInterface::class)) { + if (!$opcode instanceof OperationInterface) { throw new OperationException('Invalid opcode object'); } - $this->opcodes[] = $opcode->getOpcode(); } } @@ -57,7 +55,7 @@ public function setOpcodes(array $opcodes) /** * @inheritdoc */ - public function generate() + public function generate(): string { return implode('', $this->opcodes); } diff --git a/src/Parser/OpcodesInterface.php b/src/Parser/OpcodesInterface.php index 853f929..b521ed3 100644 --- a/src/Parser/OpcodesInterface.php +++ b/src/Parser/OpcodesInterface.php @@ -15,37 +15,31 @@ namespace cogpowered\FineDiff\Parser; -use cogpowered\FineDiff\Exceptions\OperationException; +use cogpowered\FineDiff\Parser\Operations\OperationInterface; interface OpcodesInterface { /** * Get the opcodes. * - * @return array + * @return array */ - public function getOpcodes(); + public function getOpcodes(): array; /** * Set the opcodes for this parse. * - * @param array $opcodes Elements must be an instance of OperationInterface. - * @throws OperationException + * @param array $opcodes Elements must be an instance of OperationInterface. */ - public function setOpcodes(array $opcodes); + public function setOpcodes(array $opcodes): void; /** * Return the opcodes in a format that can then be rendered. - * - * @return string */ - public function generate(); + public function generate(): string; /** * When object is cast to a string returns opcodes as string. - * - * @see Opcodes::generate - * @return string */ public function __toString(); } diff --git a/src/Parser/Operations/Copy.php b/src/Parser/Operations/Copy.php index 83c46b6..4050f34 100644 --- a/src/Parser/Operations/Copy.php +++ b/src/Parser/Operations/Copy.php @@ -30,31 +30,22 @@ class Copy implements OperationInterface * * @param int $len Length of string. */ - public function __construct($len) + public function __construct(int $len) { $this->len = $len; } - /** - * @inheritdoc - */ - public function getFromLen() + public function getFromLen(): int { return $this->len; } - /** - * @inheritdoc - */ - public function getToLen() + public function getToLen(): int { return $this->len; } - /** - * @inheritdoc - */ - public function getOpcode() + public function getOpcode(): string { if ($this->len === 1) { return 'c'; @@ -69,7 +60,7 @@ public function getOpcode() * @param int $size Amount to increase the string length by. * @return int New length */ - public function increase($size) + public function increase(int $size): int { return $this->len += $size; } diff --git a/src/Parser/Operations/Delete.php b/src/Parser/Operations/Delete.php index a183bdc..9ae30ab 100644 --- a/src/Parser/Operations/Delete.php +++ b/src/Parser/Operations/Delete.php @@ -30,36 +30,26 @@ class Delete implements OperationInterface * * @param int $len Length of string. */ - public function __construct($len) + public function __construct(int $len) { $this->fromLen = $len; } - /** - * @inheritdoc - */ - public function getFromLen() + public function getFromLen(): int { return $this->fromLen; } - /** - * @inheritdoc - */ - public function getToLen() + public function getToLen(): int { return 0; } - /** - * @inheritdoc - */ - public function getOpcode() + public function getOpcode(): string { if ($this->fromLen === 1) { return 'd'; } - return "d{$this->fromLen}"; } } diff --git a/src/Parser/Operations/Insert.php b/src/Parser/Operations/Insert.php index 0e1a4a5..28561d6 100644 --- a/src/Parser/Operations/Insert.php +++ b/src/Parser/Operations/Insert.php @@ -27,49 +27,33 @@ class Insert implements OperationInterface /** * Sets the text that the operation is working with. - * - * @param string $text */ - public function __construct($text) + public function __construct(string $text) { $this->text = $text; } - /** - * @inheritdoc - */ - public function getFromLen() + public function getFromLen(): int { return 0; } - /** - * @inheritdoc - */ - public function getToLen() + public function getToLen(): int { return mb_strlen($this->text); } - /** - * @inheritdoc - */ - public function getText() + public function getText(): string { return $this->text; } - /** - * @inheritdoc - */ - public function getOpcode() + public function getOpcode(): string { $to_len = mb_strlen($this->text); - if ($to_len === 1) { return "i:{$this->text}"; } - return "i{$to_len}:{$this->text}"; } } diff --git a/src/Parser/Operations/OperationInterface.php b/src/Parser/Operations/OperationInterface.php index 20294e8..74a7814 100644 --- a/src/Parser/Operations/OperationInterface.php +++ b/src/Parser/Operations/OperationInterface.php @@ -17,18 +17,7 @@ interface OperationInterface { - /** - * @return int - */ - public function getFromLen(); - - /** - * @return int - */ - public function getToLen(); - - /** - * @return string Opcode for this operation. - */ - public function getOpcode(); + public function getFromLen(): int; + public function getToLen(): int; + public function getOpcode(): string; } diff --git a/src/Parser/Operations/Replace.php b/src/Parser/Operations/Replace.php index 8e834a0..5c2afe2 100644 --- a/src/Parser/Operations/Replace.php +++ b/src/Parser/Operations/Replace.php @@ -31,55 +31,41 @@ class Replace implements OperationInterface * @param int $fromLen * @param string $text */ - public function __construct($fromLen, $text) + public function __construct(int $fromLen, string $text) { $this->fromLen = $fromLen; $this->text = $text; } - /** - * @inheritdoc - */ - public function getFromLen() + public function getFromLen(): int { return $this->fromLen; } - /** - * @inheritdoc - */ - public function getToLen() + public function getToLen(): int { return mb_strlen($this->text); } /** * Get the text the operation is working with. - * - * @return string */ - public function getText() + public function getText(): string { return $this->text; } - /** - * @inheritdoc - */ - public function getOpcode() + public function getOpcode(): string { if ($this->fromLen === 1) { $del_opcode = 'd'; } else { $del_opcode = "d{$this->fromLen}"; } - $to_len = mb_strlen($this->text); - if ($to_len === 1) { return "{$del_opcode}i:{$this->text}"; } - return "{$del_opcode}i{$to_len}:{$this->text}"; } } diff --git a/src/Parser/Parser.php b/src/Parser/Parser.php index b65820a..718e2a1 100644 --- a/src/Parser/Parser.php +++ b/src/Parser/Parser.php @@ -16,6 +16,7 @@ namespace cogpowered\FineDiff\Parser; use cogpowered\FineDiff\Exceptions\GranularityCountException; +use cogpowered\FineDiff\Exceptions\OperationException; use cogpowered\FineDiff\Granularity\GranularityInterface; use cogpowered\FineDiff\Parser\Operations\Copy; use cogpowered\FineDiff\Parser\Operations\Delete; @@ -59,7 +60,7 @@ class Parser implements ParserInterface protected $stackpointer = 0; /** - * @var array Holds the individual opcodes as the diff takes place. + * @var array Holds the individual opcodes as the diff takes place. */ protected $edits = []; @@ -85,7 +86,7 @@ public function getGranularity() /** * @inheritdoc */ - public function setGranularity(GranularityInterface $granularity) + public function setGranularity(GranularityInterface $granularity): void { $this->granularity = $granularity; } @@ -93,7 +94,7 @@ public function setGranularity(GranularityInterface $granularity) /** * @inheritdoc */ - public function getOpcodes() + public function getOpcodes(): OpcodesInterface { return $this->opcodes; } @@ -101,15 +102,16 @@ public function getOpcodes() /** * @inheritdoc */ - public function setOpcodes(OpcodesInterface $opcodes) + public function setOpcodes(OpcodesInterface $opcodes): void { $this->opcodes = $opcodes; } /** * @inheritdoc + * @throws GranularityCountException|OperationException */ - public function parse($from_text, $to_text) + public function parse(string $from_text, string $to_text): OpcodesInterface { // Ensure the granularity contains some delimiters if (count($this->granularity) === 0) { @@ -133,21 +135,17 @@ public function parse($from_text, $to_text) /** * Actually kicks off the processing. Recursive function. - * - * @param string $from_text - * @param string $to_text */ - protected function process($from_text, $to_text) + protected function process(string $from_text, string $to_text): void { // Lets get parsing - $delimiters = $this->granularity[$this->stackpointer++]; + $delimiters = $this->granularity[$this->stackpointer++] ?? ''; $has_next_stage = $this->stackpointer < count($this->granularity); // Actually perform diff $diff = $this->diff($from_text, $to_text, $delimiters); foreach ($diff as $fragment) { - // increase granularity if ($fragment instanceof Replace && $has_next_stage) { $this->process( @@ -156,7 +154,9 @@ protected function process($from_text, $to_text) ); } elseif ($fragment instanceof Copy && $this->last_edit instanceof Copy) { // fuse copy ops whenever possible - $this->edits[count($this->edits)-1]->increase($fragment->getFromLen()); + /** @var Copy $copyOperation */ + $copyOperation = $this->edits[count($this->edits)-1]; + $copyOperation->increase($fragment->getFromLen()); $this->from_offset += $fragment->getFromLen(); } else { /* $fragment instanceof Copy */ @@ -173,12 +173,9 @@ protected function process($from_text, $to_text) /** * Core parsing function. * - * @param string $from_text - * @param string $to_text - * @param string $delimiters Delimiter to use for this parse. - * @return array + * @return array */ - protected function diff($from_text, $to_text, $delimiters) + protected function diff(string $from_text, string $to_text, string $delimiters): array { // Empty delimiter means character-level diffing. // In such case, use code path optimized for character-level diffing. @@ -324,11 +321,9 @@ protected function diff($from_text, $to_text, $delimiters) /** * Same as Parser::diff but tuned for character level granularity. * - * @param string $from_text - * @param string $to_text - * @return array + * @return array */ - protected function charDiff($from_text, $to_text) + protected function charDiff(string $from_text, string $to_text): array { $result = []; $jobs = [[0, mb_strlen($from_text), 0, mb_strlen($to_text)]]; @@ -415,33 +410,27 @@ protected function charDiff($from_text, $to_text) /** * Efficiently fragment the text into an array according to specified delimiters. * - * No delimiters means fragment into single character. The array indices are the offset of the fragments into + * The array indices are the offset of the fragments into * the input string. A sentinel empty fragment is always added at the end. * Careful: No check is performed as to the validity of the delimiters. - * - * @param string $text - * @param string $delimiters + * + * @return array */ - protected function extractFragments($text, $delimiters) + protected function extractFragments(string $text, string $delimiters) { $fragments = []; $start = 0; $end = 0; - for (;;) { $end += strcspn($text, $delimiters, $end); $end += strspn($text, $delimiters, $end); - if ($end === $start) { break; } - $fragments[$start] = mb_substr($text, $start, $end - $start); $start = $end; } - $fragments[$start] = ''; - return $fragments; } } diff --git a/src/Parser/ParserInterface.php b/src/Parser/ParserInterface.php index a410235..36e8100 100644 --- a/src/Parser/ParserInterface.php +++ b/src/Parser/ParserInterface.php @@ -15,7 +15,6 @@ namespace cogpowered\FineDiff\Parser; -use cogpowered\FineDiff\Exceptions\GranularityCountException; use cogpowered\FineDiff\Granularity\GranularityInterface; interface ParserInterface @@ -37,27 +36,20 @@ public function getGranularity(); /** * Set the granularity that the parser is working with. */ - public function setGranularity(GranularityInterface $granularity); + public function setGranularity(GranularityInterface $granularity): void; /** * Get the opcodes object that is used to store all the opcodes. - * - * @return OpcodesInterface */ - public function getOpcodes(); + public function getOpcodes(): OpcodesInterface; /** * Set the opcodes object used to store all the opcodes for this parse. */ - public function setOpcodes(OpcodesInterface $opcodes); + public function setOpcodes(OpcodesInterface $opcodes): void; /** * Generates the opcodes needed to transform one string to another. - * - * @param string $from_text - * @param string $to_text - * @throws GranularityCountException - * @return OpcodesInterface */ - public function parse($from_text, $to_text); + public function parse(string $from_text, string $to_text): OpcodesInterface; } diff --git a/src/Render/Html.php b/src/Render/Html.php index 9b5e369..6235c23 100644 --- a/src/Render/Html.php +++ b/src/Render/Html.php @@ -17,7 +17,7 @@ class Html extends Renderer { - public function callback($opcode, $from, $from_offset, $from_len) + public function callback(string $opcode, string $from, int $from_offset, int $from_len): string { if ($opcode === 'c') { $html = htmlentities(mb_substr($from, $from_offset, $from_len)); diff --git a/src/Render/Renderer.php b/src/Render/Renderer.php index f6c309f..eab4558 100644 --- a/src/Render/Renderer.php +++ b/src/Render/Renderer.php @@ -26,7 +26,7 @@ abstract class Renderer implements RendererInterface * @param string|OpcodesInterface|mixed $opcodes Throws on non-string and non-OpcodesInterface * @return string */ - public function process($from_text, $opcodes) + public function process(string $from_text, $opcodes) { // Validate opcodes if (!is_string($opcodes) && !($opcodes instanceof OpcodesInterface)) { diff --git a/src/Render/RendererInterface.php b/src/Render/RendererInterface.php index 72f5953..0959681 100644 --- a/src/Render/RendererInterface.php +++ b/src/Render/RendererInterface.php @@ -15,8 +15,16 @@ namespace cogpowered\FineDiff\Render; +use cogpowered\FineDiff\Parser\OpcodesInterface; + interface RendererInterface { - public function process($from_text, $opcode); - public function callback($opcode, $from, $from_offset, $from_len); + /** + * @param string $from_text + * @param string|OpcodesInterface|mixed $opcode Throws on non-string and non-OpcodesInterface + * @return string + */ + public function process(string $from_text, $opcode); + + public function callback(string $opcode, string $from, int $from_offset, int $from_len): string; } diff --git a/src/Render/Text.php b/src/Render/Text.php index 1cbff6e..a6c35dd 100644 --- a/src/Render/Text.php +++ b/src/Render/Text.php @@ -17,12 +17,11 @@ class Text extends Renderer { - public function callback($opcode, $from, $from_offset, $from_len) + public function callback(string $opcode, string $from, int $from_offset, int $from_len): string { if ($opcode === 'c' || $opcode === 'i') { return mb_substr($from, $from_offset, $from_len); } - return ''; } } diff --git a/tests/DiffTest.php b/tests/DiffTest.php index c18bb25..3c1101a 100644 --- a/tests/DiffTest.php +++ b/tests/DiffTest.php @@ -88,6 +88,9 @@ public function setAndGetGranularity(): void self::assertSame($granularity, $subject->getParser()->getGranularity()); } + /** + * @return array[] + */ public function processAndRenderDataProvider(): array { return [ diff --git a/tests/Granularity/CharacterTest.php b/tests/Granularity/CharacterTest.php index d68cd51..cfbb68c 100644 --- a/tests/Granularity/CharacterTest.php +++ b/tests/Granularity/CharacterTest.php @@ -71,8 +71,8 @@ public function arrayAccess(): void { $subject = new Character(); self::assertSame(Delimiters::SENTENCE, $subject[1]); - $subject[1] = 'foo'; - self::assertSame('foo', $subject[1]); + $subject[1] = Delimiters::PARAGRAPH; + self::assertSame(Delimiters::PARAGRAPH, $subject[1]); unset($subject[1]); self::assertCount(3, $subject); } diff --git a/tests/Parser/Operations/ReplaceTest.php b/tests/Parser/Operations/ReplaceTest.php index 9b59e1b..f86435e 100644 --- a/tests/Parser/Operations/ReplaceTest.php +++ b/tests/Parser/Operations/ReplaceTest.php @@ -53,6 +53,9 @@ public function getToLen(): void self::assertEquals(5, (new Replace(3, 'world'))->getToLen()); } + /** + * @return array[] + */ public function getOpcodeDataProvider(): array { return [ @@ -83,7 +86,7 @@ public function getOpcodeDataProvider(): array * @test * @dataProvider getOpcodeDataProvider */ - public function getOpcode($fromLen, $text, $expected): void + public function getOpcode(int $fromLen, string $text, string $expected): void { self::assertSame($expected, (new Replace($fromLen, $text))->getOpcode()); } From 9383647ea9f872c149f64f9a1e820f404f0b5453 Mon Sep 17 00:00:00 2001 From: Christian Kuhn Date: Sat, 23 Oct 2021 16:06:52 +0200 Subject: [PATCH 8/8] [TASk] phpstan level 8 --- phpstan.neon.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 5bfd01e..8f60cd4 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,5 +1,5 @@ parameters: - level: 6 + level: 8 paths: - ./src