From 8b2d49d8a8b74acfc4f76b06cd53dedaa72c56e0 Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Wed, 28 Feb 2024 14:38:01 +0000 Subject: [PATCH] update namespace --- composer.json | 4 +- composer.lock | 122 ++++++++++++------------- includes/Api/Flags.php | 2 +- includes/Flag.php | 2 +- includes/Helper.php | 2 +- includes/Settings.php | 2 +- plugin.php | 4 +- src/components/snippets/PhpSnippet.tsx | 4 +- tests/integration/FlagTest.php | 2 +- tests/integration/FlagsApiTest.php | 2 +- tests/unit/FlagTest.php | 2 +- tests/unit/FlagsTest.php | 2 +- tests/unit/HelperTest.php | 2 +- tests/unit/SettingsTest.php | 2 +- 14 files changed, 77 insertions(+), 77 deletions(-) diff --git a/composer.json b/composer.json index b2121f8..abd05bc 100644 --- a/composer.json +++ b/composer.json @@ -20,14 +20,14 @@ }, "autoload": { "psr-4": { - "MR\\FeatureFlags\\": [ + "CodeB\\FeatureFlags\\": [ "includes/" ] } }, "autoload-dev": { "psr-4": { - "MR\\FeatureFlags\\Tests\\": "tests/unit/" + "CodeB\\FeatureFlags\\Tests\\": "tests/unit/" } }, "config": { diff --git a/composer.lock b/composer.lock index 8fd3236..f91fabb 100644 --- a/composer.lock +++ b/composer.lock @@ -830,16 +830,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.0.0", + "version": "v5.0.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc" + "reference": "2218c2252c874a4624ab2f613d86ac32d227bc69" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4a21235f7e56e713259a6f76bf4b5ea08502b9dc", - "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/2218c2252c874a4624ab2f613d86ac32d227bc69", + "reference": "2218c2252c874a4624ab2f613d86ac32d227bc69", "shasum": "" }, "require": { @@ -882,9 +882,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.1" }, - "time": "2024-01-07T17:17:35+00:00" + "time": "2024-02-21T19:24:10+00:00" }, { "name": "pdepend/pdepend", @@ -1124,16 +1124,16 @@ }, { "name": "php-stubs/wordpress-stubs", - "version": "v6.4.1", + "version": "v6.4.3", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "6d6063cf9464a306ca2a0529705d41312b08500b" + "reference": "6105bdab2f26c0204fe90ecc53d5684754550e8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/6d6063cf9464a306ca2a0529705d41312b08500b", - "reference": "6d6063cf9464a306ca2a0529705d41312b08500b", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/6105bdab2f26c0204fe90ecc53d5684754550e8f", + "reference": "6105bdab2f26c0204fe90ecc53d5684754550e8f", "shasum": "" }, "require-dev": { @@ -1142,9 +1142,9 @@ "php": "^7.4 || ~8.0.0", "php-stubs/generator": "^0.8.3", "phpdocumentor/reflection-docblock": "^5.3", - "phpstan/phpstan": "^1.10.12", + "phpstan/phpstan": "^1.10.49", "phpunit/phpunit": "^9.5", - "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.8" + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.11" }, "suggest": { "paragonie/sodium_compat": "Pure PHP implementation of libsodium", @@ -1165,9 +1165,9 @@ ], "support": { "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.4.1" + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.4.3" }, - "time": "2023-11-10T00:33:47+00:00" + "time": "2024-02-11T18:56:19+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -1638,16 +1638,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.25.0", + "version": "1.26.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240" + "reference": "231e3186624c03d7e7c890ec662b81e6b0405227" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bd84b629c8de41aa2ae82c067c955e06f1b00240", - "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/231e3186624c03d7e7c890ec662b81e6b0405227", + "reference": "231e3186624c03d7e7c890ec662b81e6b0405227", "shasum": "" }, "require": { @@ -1679,22 +1679,22 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.25.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.26.0" }, - "time": "2024-01-04T17:06:16+00:00" + "time": "2024-02-23T16:05:55+00:00" }, { "name": "phpstan/phpstan", - "version": "1.10.57", + "version": "1.10.59", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e" + "reference": "e607609388d3a6d418a50a49f7940e8086798281" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1627b1d03446904aaa77593f370c5201d2ecc34e", - "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e607609388d3a6d418a50a49f7940e8086798281", + "reference": "e607609388d3a6d418a50a49f7940e8086798281", "shasum": "" }, "require": { @@ -1743,7 +1743,7 @@ "type": "tidelift" } ], - "time": "2024-01-24T11:51:34+00:00" + "time": "2024-02-20T13:59:13+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -2163,16 +2163,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.16", + "version": "9.6.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3767b2c56ce02d01e3491046f33466a1ae60a37f" + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3767b2c56ce02d01e3491046f33466a1ae60a37f", - "reference": "3767b2c56ce02d01e3491046f33466a1ae60a37f", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1a156980d78a6666721b7e8e8502fe210b587fcd", + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd", "shasum": "" }, "require": { @@ -2246,7 +2246,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.16" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.17" }, "funding": [ { @@ -2262,7 +2262,7 @@ "type": "tidelift" } ], - "time": "2024-01-19T07:03:14+00:00" + "time": "2024-02-23T13:14:51+00:00" }, { "name": "psr/container", @@ -3456,16 +3456,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.8.1", + "version": "3.9.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "14f5fff1e64118595db5408e946f3a22c75807f7" + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/14f5fff1e64118595db5408e946f3a22c75807f7", - "reference": "14f5fff1e64118595db5408e946f3a22c75807f7", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", "shasum": "" }, "require": { @@ -3532,7 +3532,7 @@ "type": "open_collective" } ], - "time": "2024-01-11T20:47:48+00:00" + "time": "2024-02-16T15:06:51+00:00" }, { "name": "swissspidy/phpstan-no-private", @@ -3587,16 +3587,16 @@ }, { "name": "symfony/config", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "206482ff3ed450495b1d5b7bad1bc3a852def96f" + "reference": "6ea4affc27f2086c9d16b92ab5429ce1e3c38047" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/206482ff3ed450495b1d5b7bad1bc3a852def96f", - "reference": "206482ff3ed450495b1d5b7bad1bc3a852def96f", + "url": "https://api.github.com/repos/symfony/config/zipball/6ea4affc27f2086c9d16b92ab5429ce1e3c38047", + "reference": "6ea4affc27f2086c9d16b92ab5429ce1e3c38047", "shasum": "" }, "require": { @@ -3642,7 +3642,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.4.3" + "source": "https://github.com/symfony/config/tree/v6.4.4" }, "funding": [ { @@ -3658,20 +3658,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T13:26:27+00:00" + "time": "2024-02-26T07:52:26+00:00" }, { "name": "symfony/dependency-injection", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "6871811c5a5c5e180244ddb689746446db02c05b" + "reference": "6236e5e843cb763e9d0f74245678b994afea5363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/6871811c5a5c5e180244ddb689746446db02c05b", - "reference": "6871811c5a5c5e180244ddb689746446db02c05b", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/6236e5e843cb763e9d0f74245678b994afea5363", + "reference": "6236e5e843cb763e9d0f74245678b994afea5363", "shasum": "" }, "require": { @@ -3723,7 +3723,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.4.3" + "source": "https://github.com/symfony/dependency-injection/tree/v6.4.4" }, "funding": [ { @@ -3739,7 +3739,7 @@ "type": "tidelift" } ], - "time": "2024-01-30T08:32:12+00:00" + "time": "2024-02-22T20:27:10+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4190,16 +4190,16 @@ }, { "name": "symfony/var-exporter", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "a8c12b5448a5ac685347f5eeb2abf6a571ec16b8" + "reference": "0bd342e24aef49fc82a21bd4eedd3e665d177e5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/a8c12b5448a5ac685347f5eeb2abf6a571ec16b8", - "reference": "a8c12b5448a5ac685347f5eeb2abf6a571ec16b8", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/0bd342e24aef49fc82a21bd4eedd3e665d177e5b", + "reference": "0bd342e24aef49fc82a21bd4eedd3e665d177e5b", "shasum": "" }, "require": { @@ -4245,7 +4245,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.4.3" + "source": "https://github.com/symfony/var-exporter/tree/v6.4.4" }, "funding": [ { @@ -4261,26 +4261,26 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:51:35+00:00" + "time": "2024-02-26T08:37:45+00:00" }, { "name": "szepeviktor/phpstan-wordpress", - "version": "v1.3.2", + "version": "v1.3.3", "source": { "type": "git", "url": "https://github.com/szepeviktor/phpstan-wordpress.git", - "reference": "b8516ed6bab7ec50aae981698ce3f67f1be2e45a" + "reference": "f7ff091331bc00c5688fe4ce0c4d51d06fa61553" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/b8516ed6bab7ec50aae981698ce3f67f1be2e45a", - "reference": "b8516ed6bab7ec50aae981698ce3f67f1be2e45a", + "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/f7ff091331bc00c5688fe4ce0c4d51d06fa61553", + "reference": "f7ff091331bc00c5688fe4ce0c4d51d06fa61553", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", "php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0", - "phpstan/phpstan": "^1.10.30", + "phpstan/phpstan": "^1.10.31", "symfony/polyfill-php73": "^1.12.0" }, "require-dev": { @@ -4321,9 +4321,9 @@ ], "support": { "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", - "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.3.2" + "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.3.3" }, - "time": "2023-10-16T17:23:56+00:00" + "time": "2024-02-26T13:55:50+00:00" }, { "name": "theseer/tokenizer", diff --git a/includes/Api/Flags.php b/includes/Api/Flags.php index c8ad57d..80357e6 100644 --- a/includes/Api/Flags.php +++ b/includes/Api/Flags.php @@ -8,7 +8,7 @@ declare(strict_types = 1); -namespace MR\FeatureFlags\Api; +namespace CodeB\FeatureFlags\Api; use WP_Error; use WP_REST_Server; diff --git a/includes/Flag.php b/includes/Flag.php index 1feabc0..1293855 100644 --- a/includes/Flag.php +++ b/includes/Flag.php @@ -8,7 +8,7 @@ declare(strict_types = 1); -namespace MR\FeatureFlags; +namespace CodeB\FeatureFlags; /** * Utils class for feature flags diff --git a/includes/Helper.php b/includes/Helper.php index e9f0bc3..8138e4d 100644 --- a/includes/Helper.php +++ b/includes/Helper.php @@ -8,7 +8,7 @@ declare(strict_types = 1); -namespace MR\FeatureFlags; +namespace CodeB\FeatureFlags; /** * Class FeatureFlags diff --git a/includes/Settings.php b/includes/Settings.php index d8bcd30..b586056 100644 --- a/includes/Settings.php +++ b/includes/Settings.php @@ -8,7 +8,7 @@ declare(strict_types = 1); -namespace MR\FeatureFlags; +namespace CodeB\FeatureFlags; /** * Class Settings diff --git a/plugin.php b/plugin.php index 03c421d..10facd6 100644 --- a/plugin.php +++ b/plugin.php @@ -19,9 +19,9 @@ declare( strict_types = 1 ); -namespace MR\FeatureFlags; +namespace CodeB\FeatureFlags; -use MR\FeatureFlags\Api\Flags; +use CodeB\FeatureFlags\Api\Flags; // If this file is called directly, abort. if ( ! defined( 'WPINC' ) ) { diff --git a/src/components/snippets/PhpSnippet.tsx b/src/components/snippets/PhpSnippet.tsx index 4e6c985..e872f3f 100644 --- a/src/components/snippets/PhpSnippet.tsx +++ b/src/components/snippets/PhpSnippet.tsx @@ -5,8 +5,8 @@ import Clipboard from '../common/Clipboard'; export default function ({ flag }: { flag: string }): JSX.Element { const phpSnippet = useMemo(() => { - return `use MR\\FeatureFlags\\Flag; -if ( class_exists( '\\MR\\FeatureFlags\\Flag' ) && Flag::is_enabled( '${flag}' ) ) { + return `use CodeB\\FeatureFlags\\Flag; +if ( class_exists( '\\CodeB\\FeatureFlags\\Flag' ) && Flag::is_enabled( '${flag}' ) ) { // php code goes here... }`; }, [flag]); diff --git a/tests/integration/FlagTest.php b/tests/integration/FlagTest.php index 37c7b2a..aab2651 100644 --- a/tests/integration/FlagTest.php +++ b/tests/integration/FlagTest.php @@ -1,5 +1,5 @@