From b5028f9ad299272e38ddc3d863feac5d54bcdece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20DELSOL?= Date: Thu, 24 Mar 2022 06:32:56 +0100 Subject: [PATCH 1/2] Upgrade PHP CS Fixer --- .php_cs => .php-cs-fixer.php | 2 +- composer.json | 2 +- src/Created.php | 2 +- src/Element.php | 12 ++++++------ src/Expires.php | 2 +- src/Nonce.php | 6 +++--- src/Password.php | 8 ++++---- src/Security.php | 10 +++++----- src/Timestamp.php | 4 ++-- src/Username.php | 2 +- src/UsernameToken.php | 6 +++--- 11 files changed, 28 insertions(+), 28 deletions(-) rename .php_cs => .php-cs-fixer.php (85%) mode change 100755 => 100644 diff --git a/.php_cs b/.php-cs-fixer.php old mode 100755 new mode 100644 similarity index 85% rename from .php_cs rename to .php-cs-fixer.php index a2d2922..56564b1 --- a/.php_cs +++ b/.php-cs-fixer.php @@ -4,7 +4,7 @@ ->exclude('vendor') ->in(__DIR__); -return PhpCsFixer\Config::create() +return (new PhpCsFixer\Config()) ->setUsingCache(false) ->setRules(array( '@PhpCsFixer' => true, diff --git a/composer.json b/composer.json index 4ff3584..bdcfe1a 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,7 @@ "phpstan": "vendor/bin/phpstan analyze src --level=6" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0", + "friendsofphp/php-cs-fixer": "^3.0", "phpstan/phpstan": "^1.4", "phpunit/phpunit": "^9" }, diff --git a/src/Created.php b/src/Created.php index fe58bcf..3917f3f 100644 --- a/src/Created.php +++ b/src/Created.php @@ -6,7 +6,7 @@ class Created extends Element { - const NAME = 'Created'; + public const NAME = 'Created'; public function __construct(int $timestamp, string $namespace = self::NS_WSSU) { diff --git a/src/Element.php b/src/Element.php index d965bcf..c6a706d 100644 --- a/src/Element.php +++ b/src/Element.php @@ -15,13 +15,13 @@ */ class Element { - const NS_WSSE = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'; + public const NS_WSSE = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'; - const NS_WSSE_NAME = 'wsse'; + public const NS_WSSE_NAME = 'wsse'; - const NS_WSSU = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'; + public const NS_WSSU = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'; - const NS_WSSU_NAME = 'wssu'; + public const NS_WSSU_NAME = 'wssu'; protected string $name = ''; @@ -79,7 +79,7 @@ public function __construct(string $name, string $namespace, $value = null, arra * * @param bool $asDomElement returns elements as a \DOMElement or as a string * - * @return DOMElement|string|false + * @return DOMElement|false|string */ protected function __toSend(bool $asDomElement = false) { @@ -207,7 +207,7 @@ public function setTimestampValue(int $timestampValue): self /** * Returns the element to send as WS-Security header. * - * @return DOMElement|string|false + * @return DOMElement|false|string */ public function toSend() { diff --git a/src/Expires.php b/src/Expires.php index a738282..6729f3f 100644 --- a/src/Expires.php +++ b/src/Expires.php @@ -6,7 +6,7 @@ class Expires extends Element { - const NAME = 'Expires'; + public const NAME = 'Expires'; public function __construct(int $timestamp, int $expiresIn = 3600, string $namespace = self::NS_WSSU) { diff --git a/src/Nonce.php b/src/Nonce.php index ccac5d3..6b6ae3e 100644 --- a/src/Nonce.php +++ b/src/Nonce.php @@ -6,11 +6,11 @@ class Nonce extends Element { - const NAME = 'Nonce'; + public const NAME = 'Nonce'; - const ATTRIBUTE_ENCODING_TYPE = 'EncodingType'; + public const ATTRIBUTE_ENCODING_TYPE = 'EncodingType'; - const NS_ENCODING = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary'; + public const NS_ENCODING = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary'; public function __construct(string $nonce, string $namespace = self::NS_WSSE) { diff --git a/src/Password.php b/src/Password.php index a482402..7e25111 100644 --- a/src/Password.php +++ b/src/Password.php @@ -6,13 +6,13 @@ class Password extends Element { - const NAME = 'Password'; + public const NAME = 'Password'; - const ATTRIBUTE_TYPE = 'Type'; + public const ATTRIBUTE_TYPE = 'Type'; - const TYPE_PASSWORD_DIGEST = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest'; + public const TYPE_PASSWORD_DIGEST = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest'; - const TYPE_PASSWORD_TEXT = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'; + public const TYPE_PASSWORD_TEXT = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'; protected string $typeValue; diff --git a/src/Security.php b/src/Security.php index c1b3285..6e010aa 100644 --- a/src/Security.php +++ b/src/Security.php @@ -8,13 +8,13 @@ class Security extends Element { - const NAME = 'Security'; + public const NAME = 'Security'; - const ATTRIBUTE_MUST_UNDERSTAND = ':mustunderstand'; + public const ATTRIBUTE_MUST_UNDERSTAND = ':mustunderstand'; - const ATTRIBUTE_ACTOR = ':actor'; + public const ATTRIBUTE_ACTOR = ':actor'; - const ENV_NAMESPACE = 'SOAP-ENV'; + public const ENV_NAMESPACE = 'SOAP-ENV'; protected ?UsernameToken $usernameToken = null; @@ -38,7 +38,7 @@ public function __construct(bool $mustUnderstand = false, ?string $actor = null, * * @param bool $asDomElement returns elements as a DOMElement or as a string * - * @return DOMElement|string|false + * @return DOMElement|false|string */ protected function __toSend(bool $asDomElement = false) { diff --git a/src/Timestamp.php b/src/Timestamp.php index 4862963..a8a910a 100644 --- a/src/Timestamp.php +++ b/src/Timestamp.php @@ -8,7 +8,7 @@ class Timestamp extends Element { - const NAME = 'Timestamp'; + public const NAME = 'Timestamp'; protected ?Created $created; @@ -24,7 +24,7 @@ public function __construct(string $namespace = self::NS_WSSU) * * @param bool $asDomElement returns elements as a DOMElement or as a string * - * @return DOMElement|string|false + * @return DOMElement|false|string */ protected function __toSend(bool $asDomElement = false) { diff --git a/src/Username.php b/src/Username.php index ada2228..c0d5cc4 100644 --- a/src/Username.php +++ b/src/Username.php @@ -6,7 +6,7 @@ class Username extends Element { - const NAME = 'Username'; + public const NAME = 'Username'; public function __construct(string $username, string $namespace = self::NS_WSSE) { diff --git a/src/UsernameToken.php b/src/UsernameToken.php index d6dd833..e7999d2 100644 --- a/src/UsernameToken.php +++ b/src/UsernameToken.php @@ -8,9 +8,9 @@ class UsernameToken extends Element { - const NAME = 'UsernameToken'; + public const NAME = 'UsernameToken'; - const ATTRIBUTE_ID = 'Id'; + public const ATTRIBUTE_ID = 'Id'; protected ?Username $username = null; @@ -32,7 +32,7 @@ public function __construct(?string $id = null, string $namespace = self::NS_WSS * * @param bool $asDomElement returns elements as a DOMElement or as a string * - * @return DOMElement|string|false + * @return DOMElement|false|string */ protected function __toSend(bool $asDomElement = false) { From acfb3493e4bdac7cda4f58bdc58b88f0a290aa2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20DELSOL?= Date: Thu, 24 Mar 2022 06:36:22 +0100 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22ebafa..98112bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## 2.0.4 - 2022/03/24 +- Upgrade PHP CS Fixer + ## 2.0.3 - 2022/03/24 - Update badges - Remove Travis CI settings