From cf59cf0aa47f7281b103d69ad1b0679cb9f77b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20de=20la=20Pen=CC=83a?= Date: Wed, 21 Oct 2026 16:56:00 +0100 Subject: [PATCH] feat: stub find-replace exclusions and hide app settings --- .phpstan/constants.php | 3 ++ src/Common/FindReplace/Exclusion/Package.php | 20 ++++++++++++ src/FindReplace/Interfaces/Exclusion.php | 24 ++++++++++++++ tests/FindReplace/Exclusion/PackageTest.php | 34 ++++++++++++++++++++ tests/bootstrap.php | 2 ++ 5 files changed, 83 insertions(+) create mode 100644 src/Common/FindReplace/Exclusion/Package.php create mode 100644 src/FindReplace/Interfaces/Exclusion.php create mode 100644 tests/FindReplace/Exclusion/PackageTest.php diff --git a/.phpstan/constants.php b/.phpstan/constants.php index a5eeecfa0..1f5f9bb33 100644 --- a/.phpstan/constants.php +++ b/.phpstan/constants.php @@ -3,3 +3,6 @@ define('NAILS_COMMON_PATH', './'); define('NAILS_CI_SYSTEM_PATH', NAILS_COMMON_PATH . 'vendor/pocketarc/codeigniter/system/'); define('BASEPATH', NAILS_CI_SYSTEM_PATH); +define('NAILS_DB_PREFIX', 'nails_'); + +require_once dirname(__DIR__) . '/src/FindReplace/Interfaces/Exclusion.php'; diff --git a/src/Common/FindReplace/Exclusion/Package.php b/src/Common/FindReplace/Exclusion/Package.php new file mode 100644 index 000000000..bad867c96 --- /dev/null +++ b/src/Common/FindReplace/Exclusion/Package.php @@ -0,0 +1,20 @@ + + */ + public function hidden(): array; + + /** + * Searched and shown, never replaced. Same entry format as hidden(). + * + * @return list + */ + public function readOnly(): array; +} diff --git a/tests/FindReplace/Exclusion/PackageTest.php b/tests/FindReplace/Exclusion/PackageTest.php new file mode 100644 index 000000000..7cd45e15f --- /dev/null +++ b/tests/FindReplace/Exclusion/PackageTest.php @@ -0,0 +1,34 @@ +hidden() + ); + } + + public function testReadOnly(): void + { + self::assertSame( + [], + (new Package())->readOnly() + ); + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 12a66d508..4c88e6827 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -63,3 +63,5 @@ Testing::bootstrapModule(__FILE__); } + +require_once dirname(__DIR__) . '/src/FindReplace/Interfaces/Exclusion.php';