From 98f844378076bc0dadf6ffef65729dbf3999709c Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 12 Jan 2025 05:16:58 +0100 Subject: [PATCH] Modernize: add visibility for class constants ... as supported by PHP since PHP 7.1. Note: the `AssertFileEqualsSpecializationsTest::PATH_TO_EXPECTED` constant is declared as `public` as it is also used by tests in the `TestCaseTestTrait`. --- .phpcs.xml.dist | 4 ---- phpunitpolyfills-autoload.php | 2 +- .../Polyfills/AssertFileEqualsSpecializationsTest.php | 10 +++++----- tests/Polyfills/AssertObjectEqualsTest.php | 2 +- tests/Polyfills/AssertObjectNotEqualsTest.php | 2 +- tests/Polyfills/AssertionRenamesTest.php | 4 ++-- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index cc8f2cb..0bb2425 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -56,10 +56,6 @@ - - - - diff --git a/phpunitpolyfills-autoload.php b/phpunitpolyfills-autoload.php index 0d645fb..866a73e 100644 --- a/phpunitpolyfills-autoload.php +++ b/phpunitpolyfills-autoload.php @@ -22,7 +22,7 @@ final class Autoload { * * @var string */ - const VERSION = '4.0.0-dev'; + public const VERSION = '4.0.0-dev'; /** * Loads a class. diff --git a/tests/Polyfills/AssertFileEqualsSpecializationsTest.php b/tests/Polyfills/AssertFileEqualsSpecializationsTest.php index 3b2004c..ace823c 100644 --- a/tests/Polyfills/AssertFileEqualsSpecializationsTest.php +++ b/tests/Polyfills/AssertFileEqualsSpecializationsTest.php @@ -16,15 +16,15 @@ final class AssertFileEqualsSpecializationsTest extends TestCase { use AssertFileEqualsSpecializations; - const PATH_TO_EXPECTED = __DIR__ . '/Fixtures/AssertFileEqualsSpecialization_Expected.txt'; + public const PATH_TO_EXPECTED = __DIR__ . '/Fixtures/AssertFileEqualsSpecialization_Expected.txt'; - const PATH_TO_EQUALS = __DIR__ . '/Fixtures/AssertFileEqualsSpecialization_Equals.txt'; + private const PATH_TO_EQUALS = __DIR__ . '/Fixtures/AssertFileEqualsSpecialization_Equals.txt'; - const PATH_TO_NOT_EQUALS = __DIR__ . '/Fixtures/AssertFileEqualsSpecialization_NotEquals.txt'; + private const PATH_TO_NOT_EQUALS = __DIR__ . '/Fixtures/AssertFileEqualsSpecialization_NotEquals.txt'; - const PATH_TO_EQUALS_CI = __DIR__ . '/Fixtures/AssertFileEqualsSpecialization_EqualsCI.txt'; + private const PATH_TO_EQUALS_CI = __DIR__ . '/Fixtures/AssertFileEqualsSpecialization_EqualsCI.txt'; - const PATH_TO_NOT_EQUALS_CI = __DIR__ . '/Fixtures/AssertFileEqualsSpecialization_NotEqualsCI.txt'; + private const PATH_TO_NOT_EQUALS_CI = __DIR__ . '/Fixtures/AssertFileEqualsSpecialization_NotEqualsCI.txt'; /** * Verify availability of the assertFileEqualsCanonicalizing() method. diff --git a/tests/Polyfills/AssertObjectEqualsTest.php b/tests/Polyfills/AssertObjectEqualsTest.php index 3dce8d5..220061d 100644 --- a/tests/Polyfills/AssertObjectEqualsTest.php +++ b/tests/Polyfills/AssertObjectEqualsTest.php @@ -42,7 +42,7 @@ final class AssertObjectEqualsTest extends TestCase { * * @var string */ - const COMPARATOR_EXCEPTION = InvalidComparisonMethodException::class; + private const COMPARATOR_EXCEPTION = InvalidComparisonMethodException::class; /** * Verify availability of the assertObjectEquals() method. diff --git a/tests/Polyfills/AssertObjectNotEqualsTest.php b/tests/Polyfills/AssertObjectNotEqualsTest.php index e6e7510..90aa77f 100644 --- a/tests/Polyfills/AssertObjectNotEqualsTest.php +++ b/tests/Polyfills/AssertObjectNotEqualsTest.php @@ -42,7 +42,7 @@ final class AssertObjectNotEqualsTest extends TestCase { * * @var string */ - const COMPARATOR_EXCEPTION = InvalidComparisonMethodException::class; + private const COMPARATOR_EXCEPTION = InvalidComparisonMethodException::class; /** * Verify availability of the assertObjectNotEquals() method. diff --git a/tests/Polyfills/AssertionRenamesTest.php b/tests/Polyfills/AssertionRenamesTest.php index 752ea79..3206c6f 100644 --- a/tests/Polyfills/AssertionRenamesTest.php +++ b/tests/Polyfills/AssertionRenamesTest.php @@ -16,9 +16,9 @@ final class AssertionRenamesTest extends TestCase { use AssertionRenames; - const NOT_EXISTENT_FILE = __DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting.php'; + private const NOT_EXISTENT_FILE = __DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting.php'; - const NOT_EXISTENT_DIR = __DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting' . \DIRECTORY_SEPARATOR; + private const NOT_EXISTENT_DIR = __DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting' . \DIRECTORY_SEPARATOR; /** * Verify availability of the assertIsNotReadable() method.