diff --git a/composer.json b/composer.json index aff0b29..6d3b661 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "stellarwp/admin-notices", - "version": "1.0.0", + "version": "1.0.1", "description": "A handy package for easily displaying admin notices in WordPress with simple to complex visibility conditions", "minimum-stability": "stable", "license": "MIT", @@ -11,7 +11,7 @@ } ], "require": { - "psr/container": "2.0.1" + "psr/container": "1.1.1" }, "require-dev": { "codeception/module-asserts": "^1.0", diff --git a/composer.lock b/composer.lock index 7b497ca..b24eba9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,31 +4,26 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dfa4a08649eadcf508dd21a4b62b67c0", + "content-hash": "aa0fa25938897d68c374429306ed0a12", "packages": [ { "name": "psr/container", - "version": "2.0.1", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "2ae37329ee82f91efadc282cc2d527fd6065a5ef" + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/2ae37329ee82f91efadc282cc2d527fd6065a5ef", - "reference": "2ae37329ee82f91efadc282cc2d527fd6065a5ef", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", "shasum": "" }, "require": { "php": ">=7.2.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -55,9 +50,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.1" + "source": "https://github.com/php-fig/container/tree/1.1.1" }, - "time": "2021-03-24T13:40:57+00:00" + "time": "2021-03-05T17:36:06+00:00" } ], "packages-dev": [ @@ -1880,16 +1875,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.5", + "version": "1.12.6", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17" + "reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17", - "reference": "7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/dc4d2f145a88ea7141ae698effd64d9df46527ae", + "reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae", "shasum": "" }, "require": { @@ -1934,7 +1929,7 @@ "type": "github" } ], - "time": "2024-09-26T12:45:22+00:00" + "time": "2024-10-06T15:03:59+00:00" }, { "name": "phpunit/php-code-coverage", @@ -4855,29 +4850,37 @@ }, { "name": "symfony/service-contracts", - "version": "v1.1.2", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0" + "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/191afdcb5804db960d26d8566b7e9a2843cab3a0", - "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a2329596ddc8fd568900e3fc76cba42489ecc7f3", + "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" }, "suggest": { - "psr/container": "", "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -4910,9 +4913,23 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v1.1.2" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.3" }, - "time": "2019-05-28T07:50:59+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-04-21T15:04:16+00:00" }, { "name": "symfony/string", diff --git a/src/AdminNotice.php b/src/AdminNotice.php index ad73144..954101c 100644 --- a/src/AdminNotice.php +++ b/src/AdminNotice.php @@ -230,6 +230,26 @@ public function urgency($urgency): self return $this; } + public function asInfo(): self + { + return $this->urgency(NoticeUrgency::info()); + } + + public function asSuccess(): self + { + return $this->urgency(NoticeUrgency::success()); + } + + public function asWarning(): self + { + return $this->urgency(NoticeUrgency::warning()); + } + + public function asError(): self + { + return $this->urgency(NoticeUrgency::error()); + } + /** * Sets the notice to display without the standard WordPress wrapper * diff --git a/src/AdminNotices.php b/src/AdminNotices.php index 74a2d1c..8bedae9 100644 --- a/src/AdminNotices.php +++ b/src/AdminNotices.php @@ -12,12 +12,12 @@ class AdminNotices { /** - * @var ContainerInterface + * @var ContainerInterface|null */ protected static $container; /** - * @var NotificationsRegistrarInterface + * @var NotificationsRegistrarInterface|null */ protected static $registrar;