From: Eileen McNaughton Date: Sun, 16 Jan 2022 22:21:51 +0000 (+1300) Subject: Run stricter phpcs on Civi dir X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4dbdebf03227e5ee15345d8f45166f7388eb2615;p=civicrm-core.git Run stricter phpcs on Civi dir --- diff --git a/Civi/API/Exception/NotImplementedException.php b/Civi/API/Exception/NotImplementedException.php index b8f253f13e..6deb57071d 100644 --- a/Civi/API/Exception/NotImplementedException.php +++ b/Civi/API/Exception/NotImplementedException.php @@ -16,7 +16,7 @@ class NotImplementedException extends \API_Exception { * Extra params to return. eg an extra array of ids. It is not mandatory, * but can help the computer using the api. Keep in mind the api consumer * isn't to be trusted. eg. the database password is NOT a good extra data. - * @param \Exception|NULL $previous + * @param \Exception|null $previous * A previous exception which caused this new exception. */ public function __construct($message, $extraParams = [], \Exception $previous = NULL) { diff --git a/Civi/API/Exception/UnauthorizedException.php b/Civi/API/Exception/UnauthorizedException.php index 4e3bdbf737..12e44bda3d 100644 --- a/Civi/API/Exception/UnauthorizedException.php +++ b/Civi/API/Exception/UnauthorizedException.php @@ -16,7 +16,7 @@ class UnauthorizedException extends \API_Exception { * Extra params to return. eg an extra array of ids. It is not mandatory, * but can help the computer using the api. Keep in mind the api consumer * isn't to be trusted. eg. the database password is NOT a good extra data. - * @param \Exception|NULL $previous + * @param \Exception|null $previous * A previous exception which caused this new exception. */ public function __construct($message, $extraParams = [], \Exception $previous = NULL) { diff --git a/Civi/API/Subscriber/DynamicFKAuthorization.php b/Civi/API/Subscriber/DynamicFKAuthorization.php index a4b92bd3ef..225a00b402 100644 --- a/Civi/API/Subscriber/DynamicFKAuthorization.php +++ b/Civi/API/Subscriber/DynamicFKAuthorization.php @@ -119,7 +119,7 @@ class DynamicFKAuthorization implements EventSubscriberInterface { * See docblock in DynamicFKAuthorization::$lookupDelegateSql. * @param string $lookupCustomFieldSql * See docblock in DynamicFKAuthorization::$lookupCustomFieldSql. - * @param array|NULL $allowedDelegates + * @param array|null $allowedDelegates * e.g. "civicrm_mailing","civicrm_activity"; NULL to allow any. */ public function __construct($kernel, $entityName, $actions, $lookupDelegateSql, $lookupCustomFieldSql, $allowedDelegates = NULL) { diff --git a/Civi/Api4/Event/ValidateValuesEvent.php b/Civi/Api4/Event/ValidateValuesEvent.php index 8368a97ca5..20b3c7de13 100644 --- a/Civi/Api4/Event/ValidateValuesEvent.php +++ b/Civi/Api4/Event/ValidateValuesEvent.php @@ -124,7 +124,7 @@ class ValidateValuesEvent extends GenericHookEvent { * If the error is multi-field (e.g. mismatched password-confirmation), then use an array. * If the error is independent of any field, then use []. * @param string $name - * @param string|NULL $message + * @param string|null $message * @return $this */ public function addError($recordKey, $field, string $name, string $message = NULL): self { diff --git a/Civi/Api4/Service/Schema/Joinable/Joinable.php b/Civi/Api4/Service/Schema/Joinable/Joinable.php index 6b5aed9e82..076707504e 100644 --- a/Civi/Api4/Service/Schema/Joinable/Joinable.php +++ b/Civi/Api4/Service/Schema/Joinable/Joinable.php @@ -244,7 +244,7 @@ class Joinable { } /** - * @param int|NULL $serialize + * @param int|null $serialize * * @return $this */ diff --git a/Civi/Core/AssetBuilder.php b/Civi/Core/AssetBuilder.php index aa40a097f4..a67569364d 100644 --- a/Civi/Core/AssetBuilder.php +++ b/Civi/Core/AssetBuilder.php @@ -241,7 +241,7 @@ class AssetBuilder { /** * Determine the local path of a cache file. * - * @param string|NULL $fileName + * @param string|null $fileName * Ex: 'angular.abcd1234abcd1234.json'. * @return string * URL. @@ -257,7 +257,7 @@ class AssetBuilder { /** * Determine the URL of a cache file. * - * @param string|NULL $fileName + * @param string|null $fileName * Ex: 'angular.abcd1234abcd1234.json'. * @return string * URL. diff --git a/Civi/Core/Paths.php b/Civi/Core/Paths.php index aaab990d38..478141eb12 100644 --- a/Civi/Core/Paths.php +++ b/Civi/Core/Paths.php @@ -232,7 +232,7 @@ class Paths { * The result data may not meet the preference -- if the setting * refers to an external domain, then the result will be * absolute (regardless of preference). - * @param bool|NULL $ssl + * @param bool|null $ssl * NULL to autodetect. TRUE to force to SSL. * @return FALSE|string * The URL for $value (string), or FALSE if the $value is not specified. diff --git a/Civi/Core/SqlTrigger/StaticTriggers.php b/Civi/Core/SqlTrigger/StaticTriggers.php index e7e7a50165..c9867ed85f 100644 --- a/Civi/Core/SqlTrigger/StaticTriggers.php +++ b/Civi/Core/SqlTrigger/StaticTriggers.php @@ -58,7 +58,7 @@ class StaticTriggers { * * @param array $info * See hook_civicrm_triggerInfo. - * @param string|NULL $tableFilter + * @param string|null $tableFilter * See hook_civicrm_triggerInfo. */ public function alterTriggerInfo(&$info, $tableFilter = NULL) { diff --git a/Civi/Core/SqlTrigger/TimestampTriggers.php b/Civi/Core/SqlTrigger/TimestampTriggers.php index f7730e940c..606bf0c737 100644 --- a/Civi/Core/SqlTrigger/TimestampTriggers.php +++ b/Civi/Core/SqlTrigger/TimestampTriggers.php @@ -119,7 +119,7 @@ class TimestampTriggers { * * @param array $info * See hook_civicrm_triggerInfo. - * @param string|NULL $tableFilter + * @param string|null $tableFilter * See hook_civicrm_triggerInfo. */ public function alterTriggerInfo(&$info, $tableFilter = NULL) { diff --git a/Civi/Crypto/CryptoRegistry.php b/Civi/Crypto/CryptoRegistry.php index 393e234b97..27f0a9de8f 100644 --- a/Civi/Crypto/CryptoRegistry.php +++ b/Civi/Crypto/CryptoRegistry.php @@ -193,7 +193,7 @@ class CryptoRegistry { /** * @param CipherSuiteInterface $cipherSuite * The encryption/decryption callback/handler - * @param string[]|NULL $names + * @param string[]|null $names * Symbolic names. Ex: 'aes-cbc' * If NULL, probe $cipherSuite->getNames() */ diff --git a/Civi/Schema/Traits/GuiSpecTrait.php b/Civi/Schema/Traits/GuiSpecTrait.php index 1a1db81e42..1a084f8fc2 100644 --- a/Civi/Schema/Traits/GuiSpecTrait.php +++ b/Civi/Schema/Traits/GuiSpecTrait.php @@ -104,14 +104,14 @@ trait GuiSpecTrait { } /** - * @param string|NULL $helpPre + * @param string|null $helpPre */ public function setHelpPre($helpPre) { $this->helpPre = is_string($helpPre) && strlen($helpPre) ? $helpPre : NULL; } /** - * @param string|NULL $helpPost + * @param string|null $helpPost */ public function setHelpPost($helpPost) { $this->helpPost = is_string($helpPost) && strlen($helpPost) ? $helpPost : NULL; diff --git a/Civi/Test.php b/Civi/Test.php index a0d6769747..3deca30fbc 100644 --- a/Civi/Test.php +++ b/Civi/Test.php @@ -50,7 +50,7 @@ class Test { /** * Get the data source used for testing. * - * @param string|NULL $part + * @param string|null $part * One of NULL, 'hostspec', 'port', 'username', 'password', 'database'. * @return string|array|NULL * If $part is omitted, return full DSN array. diff --git a/Civi/Test/EventCheck.php b/Civi/Test/EventCheck.php index 6254201ed2..d60a5e01d8 100644 --- a/Civi/Test/EventCheck.php +++ b/Civi/Test/EventCheck.php @@ -27,7 +27,7 @@ class EventCheck extends Assert { /** * Determine whether this check should be used during the current test. * - * @param \PHPUnit\Framework\Test|NULL $test + * @param \PHPUnit\Framework\Test|null $test * * @return bool|string * FALSE: The check will be completely skipped. @@ -46,7 +46,7 @@ class EventCheck extends Assert { } /** - * @param \PHPUnit\Framework\Test|NULL $test + * @param \PHPUnit\Framework\Test|null $test */ public function setTest($test): void { $this->test = $test; @@ -61,7 +61,7 @@ class EventCheck extends Assert { * Ex: [`array`, `NULL`, `CRM_Core_DAO`] * @param mixed $value * The variable to check - * @param string|NULL $msg + * @param string|null $msg * @see \CRM_Utils_Type::validatePhpType */ public function assertType($types, $value, ?string $msg = NULL) { diff --git a/Civi/Test/HttpTestTrait.php b/Civi/Test/HttpTestTrait.php index 18f1dad115..99e6eb122e 100644 --- a/Civi/Test/HttpTestTrait.php +++ b/Civi/Test/HttpTestTrait.php @@ -117,7 +117,7 @@ trait HttpTestTrait { /** * @param $expectCode - * @param \Psr\Http\Message\ResponseInterface|NULL $response + * @param \Psr\Http\Message\ResponseInterface|null $response * If NULL, then it uses the last response. * * @return $this @@ -132,7 +132,7 @@ trait HttpTestTrait { /** * @param $expectType - * @param \Psr\Http\Message\ResponseInterface|NULL $response + * @param \Psr\Http\Message\ResponseInterface|null $response * If NULL, then it uses the last response. * * @return $this @@ -146,7 +146,7 @@ trait HttpTestTrait { } /** - * @param \Psr\Http\Message\ResponseInterface|NULL $response + * @param \Psr\Http\Message\ResponseInterface|null $response * @return \Psr\Http\Message\ResponseInterface */ protected function resolveResponse($response) { diff --git a/Civi/Token/Event/TokenRegisterEvent.php b/Civi/Token/Event/TokenRegisterEvent.php index 730ddb616c..f46e207a87 100644 --- a/Civi/Token/Event/TokenRegisterEvent.php +++ b/Civi/Token/Event/TokenRegisterEvent.php @@ -51,7 +51,7 @@ class TokenRegisterEvent extends TokenEvent { * Register a new token. * * @param array|string $paramsOrField - * @param NULL|string $label + * @param null|string $label * @return TokenRegisterEvent */ public function register($paramsOrField, $label = NULL) { diff --git a/Civi/Token/TokenProcessor.php b/Civi/Token/TokenProcessor.php index 93c1e01c1a..97e4bd3647 100644 --- a/Civi/Token/TokenProcessor.php +++ b/Civi/Token/TokenProcessor.php @@ -165,7 +165,7 @@ class TokenProcessor { /** * Add a row of data. * - * @param array|NULL $context + * @param array|null $context * Optionally, initialize the context for this row. * Ex: ['contact_id' => 123]. * @return TokenRow @@ -283,7 +283,7 @@ class TokenProcessor { * * @param string $field * Ex: 'contactId'. - * @param string|NULL $subfield + * @param string|null $subfield * @return array * Ex: [12, 34, 56]. */ diff --git a/Civi/WorkflowMessage/FieldSpec.php b/Civi/WorkflowMessage/FieldSpec.php index 7e7b4ffe13..7672ed8802 100644 --- a/Civi/WorkflowMessage/FieldSpec.php +++ b/Civi/WorkflowMessage/FieldSpec.php @@ -69,7 +69,7 @@ class FieldSpec { /** * Enable export/import in alternative scopes. * - * @param string|array|NULL $scope + * @param string|array|null $scope * Ex: 'tplParams' * Ex: 'tplParams as foo_bar' * Ex: 'tplParams as contact_id, TokenProcessor as contactId'