From 9d5caf2ecafd19d40b2d93b0b75e8cfc0c984a1e Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Tue, 17 Jan 2023 09:36:02 +0100 Subject: [PATCH] Use proper docblock types --- .../Auth/Access/HandlesAuthorization.php | 8 ++++---- .../Broadcasting/Broadcasters/RedisBroadcaster.php | 2 +- src/Illuminate/Foundation/Console/DocsCommand.php | 14 +++++++------- src/Illuminate/Foundation/Vite.php | 2 +- src/Illuminate/Foundation/helpers.php | 2 +- src/Illuminate/Support/Lottery.php | 5 +++-- .../Validation/InvokableValidationRule.php | 2 +- .../View/Compilers/Concerns/CompilesHelpers.php | 2 +- tests/Foundation/FoundationDocsCommandTest.php | 2 +- 9 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/Illuminate/Auth/Access/HandlesAuthorization.php b/src/Illuminate/Auth/Access/HandlesAuthorization.php index fc71cf15f1ce..ed2162459a44 100644 --- a/src/Illuminate/Auth/Access/HandlesAuthorization.php +++ b/src/Illuminate/Auth/Access/HandlesAuthorization.php @@ -32,8 +32,8 @@ protected function deny($message = null, $code = null) * Deny with a HTTP status code. * * @param int $status - * @param ?string $message - * @param ?int $code + * @param string|null $message + * @param int|null $code * @return \Illuminate\Auth\Access\Response */ public function denyWithStatus($status, $message = null, $code = null) @@ -44,8 +44,8 @@ public function denyWithStatus($status, $message = null, $code = null) /** * Deny with a 404 HTTP status code. * - * @param ?string $message - * @param ?int $code + * @param string|null $message + * @param int|null $code * @return \Illuminate\Auth\Access\Response */ public function denyAsNotFound($message = null, $code = null) diff --git a/src/Illuminate/Broadcasting/Broadcasters/RedisBroadcaster.php b/src/Illuminate/Broadcasting/Broadcasters/RedisBroadcaster.php index 5ae2e03c8f44..03245eac6e6f 100644 --- a/src/Illuminate/Broadcasting/Broadcasters/RedisBroadcaster.php +++ b/src/Illuminate/Broadcasting/Broadcasters/RedisBroadcaster.php @@ -23,7 +23,7 @@ class RedisBroadcaster extends Broadcaster /** * The Redis connection to use for broadcasting. * - * @var ?string + * @var string|null */ protected $connection = null; diff --git a/src/Illuminate/Foundation/Console/DocsCommand.php b/src/Illuminate/Foundation/Console/DocsCommand.php index e8e1646f4d46..9b3960595f8d 100644 --- a/src/Illuminate/Foundation/Console/DocsCommand.php +++ b/src/Illuminate/Foundation/Console/DocsCommand.php @@ -190,7 +190,7 @@ protected function page() /** * Determine the page to open. * - * @return ?string + * @return string|null */ protected function resolvePage() { @@ -216,7 +216,7 @@ protected function didNotRequestPage() /** * Ask the user which page they would like to open. * - * @return ?string + * @return string|null */ protected function askForPage() { @@ -226,7 +226,7 @@ protected function askForPage() /** * Ask the user which page they would like to open via a custom strategy. * - * @return ?string + * @return string|null */ protected function askForPageViaCustomStrategy() { @@ -246,7 +246,7 @@ protected function askForPageViaCustomStrategy() /** * Ask the user which page they would like to open using autocomplete. * - * @return ?string + * @return string|null */ protected function askForPageViaAutocomplete() { @@ -267,7 +267,7 @@ protected function askForPageViaAutocomplete() /** * Guess the page the user is attempting to open. * - * @return ?string + * @return string|null */ protected function guessPage() { @@ -293,7 +293,7 @@ protected function guessPage() * The section the user specifically asked to open. * * @param string $page - * @return ?string + * @return string|null */ protected function section($page) { @@ -316,7 +316,7 @@ protected function didNotRequestSection() * Guess the section the user is attempting to open. * * @param string $page - * @return ?string + * @return string|null */ protected function guessSection($page) { diff --git a/src/Illuminate/Foundation/Vite.php b/src/Illuminate/Foundation/Vite.php index a14ef52589c2..dfc92c77e8f5 100644 --- a/src/Illuminate/Foundation/Vite.php +++ b/src/Illuminate/Foundation/Vite.php @@ -113,7 +113,7 @@ public function cspNonce() /** * Generate or set a Content Security Policy nonce to apply to all generated tags. * - * @param ?string $nonce + * @param string|null $nonce * @return string */ public function useCspNonce($nonce = null) diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index 4b017433fe21..8540f487473a 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -456,7 +456,7 @@ function event(...$args) /** * Get a faker instance. * - * @param ?string $locale + * @param string|null $locale * @return \Faker\Generator */ function fake($locale = null) diff --git a/src/Illuminate/Support/Lottery.php b/src/Illuminate/Support/Lottery.php index 5fe1f3e82e89..2d4ca4c4258c 100644 --- a/src/Illuminate/Support/Lottery.php +++ b/src/Illuminate/Support/Lottery.php @@ -45,7 +45,8 @@ class Lottery * Create a new Lottery instance. * * @param int|float $chances - * @param ?int $outOf + * @param int|null $outOf + * @return void */ public function __construct($chances, $outOf = null) { @@ -62,7 +63,7 @@ public function __construct($chances, $outOf = null) * Create a new Lottery instance. * * @param int|float $chances - * @param ?int $outOf + * @param int|null $outOf * @return static */ public static function odds($chances, $outOf = null) diff --git a/src/Illuminate/Validation/InvokableValidationRule.php b/src/Illuminate/Validation/InvokableValidationRule.php index 8ca83f0a5a80..97eb23363986 100644 --- a/src/Illuminate/Validation/InvokableValidationRule.php +++ b/src/Illuminate/Validation/InvokableValidationRule.php @@ -153,7 +153,7 @@ public function setValidator($validator) * Create a pending potentially translated string. * * @param string $attribute - * @param ?string $message + * @param string|null $message * @return \Illuminate\Translation\PotentiallyTranslatedString */ protected function pendingPotentiallyTranslatedString($attribute, $message) diff --git a/src/Illuminate/View/Compilers/Concerns/CompilesHelpers.php b/src/Illuminate/View/Compilers/Concerns/CompilesHelpers.php index 6c6fcd996830..f217f59bea89 100644 --- a/src/Illuminate/View/Compilers/Concerns/CompilesHelpers.php +++ b/src/Illuminate/View/Compilers/Concerns/CompilesHelpers.php @@ -52,7 +52,7 @@ protected function compileMethod($method) /** * Compile the "vite" statements into valid PHP. * - * @param ?string $arguments + * @param string|null $arguments * @return string */ protected function compileVite($arguments) diff --git a/tests/Foundation/FoundationDocsCommandTest.php b/tests/Foundation/FoundationDocsCommandTest.php index 9bca29ad7a82..c26674239e83 100644 --- a/tests/Foundation/FoundationDocsCommandTest.php +++ b/tests/Foundation/FoundationDocsCommandTest.php @@ -14,7 +14,7 @@ class FoundationDocsCommandTest extends TestCase /** * The URL opened by the command. * - * @var ?string + * @var string|null */ protected $openedUrl;