[12.x] Add missing PHP return type declarations to Session, Config, and Console classes #57343
+19
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds missing PHP return type declarations to methods across Session, Config, and Console classes that previously only had docblock type annotations. This improves type safety, enhances IDE support, and aligns with modern PHP best practices.
Changes Made
Session Classes
src/Illuminate/Session/EncryptedStore.php
getEncrypter(): EncrypterContract
return type declarationsrc/Illuminate/Session/CacheBasedSessionHandler.php
getCache(): CacheContract
return type declarationsrc/Illuminate/Session/SessionManager.php
shouldBlock(): bool
return type declarationblockDriver(): ?string
return type declarationdefaultRouteBlockLockSeconds(): int
return type declarationdefaultRouteBlockWaitSeconds(): int
return type declarationgetSessionConfig(): array
return type declarationgetDefaultDriver(): ?string
return type declarationsetDefaultDriver(): void
return type declarationConfig Classes
src/Illuminate/Config/Repository.php
has(): bool
return type declarationget(): mixed
return type declarationgetMany(): array
return type declarationset(): void
return type declarationprepend(): void
return type declarationpush(): void
return type declarationall(): array
return type declarationConsole Classes
src/Illuminate/Cache/Console/PruneStaleTagsCommand.php
getArguments(): array
return type declarationsrc/Illuminate/Foundation/Console/ConfigMakeCommand.php
promptForMissingArgumentsUsing(): array
return type declarationsrc/Illuminate/Foundation/Console/ConfigCacheCommand.php
handle(): void
return type declarationBenefits
Testing
Checklist