Skip to content

Commit

Permalink
Make nullable parameters explicit.
Browse files Browse the repository at this point in the history
Implicitly nullable parameters will be deprecated in PHP 8.4.

This also fixes many cases where a doc comment didn't match reality.
  • Loading branch information
EreMaijala committed Sep 10, 2024
1 parent 7c7c9d0 commit a7e5e45
Show file tree
Hide file tree
Showing 761 changed files with 1,858 additions and 2,137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class UserAccountServiceFactory implements FactoryInterface
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if ($options !== null) {
throw new \Exception('Unexpected options sent to factory!');
Expand Down
4 changes: 2 additions & 2 deletions module/VuFind/src/VuFind/AjaxHandler/AbstractBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ abstract class AbstractBase implements AjaxHandlerInterface
/**
* Session settings
*
* @var SessionSettings
* @var ?SessionSettings
*/
protected $sessionSettings = null;

Expand All @@ -69,7 +69,7 @@ protected function disableSessionWrites()
* Format a response array.
*
* @param mixed $response Response data
* @param int $httpCode HTTP status code (omit for default)
* @param ?int $httpCode HTTP status code (omit for default)
*
* @return array
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AbstractIlsAndUserActionFactory implements \Laminas\ServiceManager\Factory
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
return new $requestedName(
$container->get(\VuFind\Session\Settings::class),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AbstractRelaisActionFactory implements \Laminas\ServiceManager\Factory\Fac
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class CommentRecordFactory implements \Laminas\ServiceManager\Factory\FactoryInt
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DeleteRecordCommentFactory implements \Laminas\ServiceManager\Factory\Fact
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/AjaxHandler/DoiLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class DoiLookup extends AbstractBase
/**
* View renderer
*
* @var RendererInterface
* @var ?RendererInterface
*/
protected $viewRenderer = null;

Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/AjaxHandler/DoiLookupFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DoiLookupFactory implements \Laminas\ServiceManager\Factory\FactoryInterfa
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class GetACSuggestionsFactory implements
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class GetIlsStatusFactory implements \Laminas\ServiceManager\Factory\FactoryInte
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
6 changes: 3 additions & 3 deletions module/VuFind/src/VuFind/AjaxHandler/GetItemStatuses.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ protected function pickValue($rawList, $mode, $msg, $transPrefix = false)
* Based on settings and the number of callnumbers, return callnumber handler
* Use callnumbers before pickValue is run.
*
* @param array $list Array of callnumbers.
* @param string $displaySetting config.ini setting -- first, all or msg
* @param ?array $list Array of callnumbers.
* @param ?string $displaySetting config.ini setting -- first, all or msg
*
* @return string
*/
protected function getCallnumberHandler($list = null, $displaySetting = null)
{
if ($displaySetting == 'msg' && count($list) > 1) {
if ($displaySetting == 'msg' && count($list ?? []) > 1) {
return false;
}
return $this->config->Item_Status->callnumber_handler ?? false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class GetItemStatusesFactory implements \Laminas\ServiceManager\Factory\FactoryI
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class GetRecordCommentsAsHTMLFactory implements \Laminas\ServiceManager\Factory\
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class GetRecordCoverFactory implements FactoryInterface
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
$config
= $container->get(\VuFind\Config\PluginManager::class)->get('config');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class GetRecordDetailsFactory implements \Laminas\ServiceManager\Factory\Factory
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class GetRecordRatingFactory implements \Laminas\ServiceManager\Factory\FactoryI
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class GetRecordTagsFactory implements \Laminas\ServiceManager\Factory\FactoryInt
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class GetRecordVersionsFactory implements \Laminas\ServiceManager\Factory\Factor
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class GetResolverLinksFactory implements \Laminas\ServiceManager\Factory\Factory
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class GetResultCountFactory implements \Laminas\ServiceManager\Factory\FactoryIn
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class GetSaveStatusesFactory implements \Laminas\ServiceManager\Factory\FactoryI
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class GetSearchResultsFactory implements \Laminas\ServiceManager\Factory\Factory
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class GetSideFacetsFactory implements \Laminas\ServiceManager\Factory\FactoryInt
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class GetUserFinesFactory extends AbstractIlsAndUserActionFactory implements Fac
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class GetUserTransactions extends AbstractIlsAndUserAction
/**
* Paginator
*
* @var \VuFind\ILS\PaginationHelper
* @var ?\VuFind\ILS\PaginationHelper
*/
protected $paginationHelper = null;

Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/AjaxHandler/GetVisDataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class GetVisDataFactory implements \Laminas\ServiceManager\Factory\FactoryInterf
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/AjaxHandler/KeepAliveFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class KeepAliveFactory implements \Laminas\ServiceManager\Factory\FactoryInterfa
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/AjaxHandler/RecommendFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class RecommendFactory implements \Laminas\ServiceManager\Factory\FactoryInterfa
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class SystemStatusFactory implements \Laminas\ServiceManager\Factory\FactoryInte
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/AjaxHandler/TagRecordFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class TagRecordFactory implements \Laminas\ServiceManager\Factory\FactoryInterfa
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options passed to factory.');
Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/Auth/AbstractBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ abstract class AbstractBase implements
/**
* Configuration settings
*
* @var \Laminas\Config\Config
* @var ?\Laminas\Config\Config
*/
protected $config = null;

Expand Down
4 changes: 2 additions & 2 deletions module/VuFind/src/VuFind/Auth/AlmaDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ class AlmaDatabase extends Database
/**
* Alma driver
*
* @var \VuFind\ILS\Driver\Alma
* @var ?\VuFind\ILS\Driver\Alma
*/
protected $almaDriver = null;

/**
* Alma config
*
* @var array
* @var ?array
*/
protected $almaConfig = null;

Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/Auth/CASFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CASFactory implements \Laminas\ServiceManager\Factory\FactoryInterface
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options sent to factory.');
Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/Auth/ChoiceAuthFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ChoiceAuthFactory implements \Laminas\ServiceManager\Factory\FactoryInterf
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options sent to factory.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class EmailAuthenticatorFactory implements \Laminas\ServiceManager\Factory\Facto
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options sent to factory.');
Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/Auth/EmailFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class EmailFactory implements \Laminas\ServiceManager\Factory\FactoryInterface
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options sent to factory.');
Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/Auth/FacebookFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class FacebookFactory implements \Laminas\ServiceManager\Factory\FactoryInterfac
public function __invoke(
ContainerInterface $container,
$requestedName,
array $options = null
?array $options = null
) {
if (!empty($options)) {
throw new \Exception('Unexpected options sent to factory.');
Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/Auth/ILS.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ILS extends AbstractBase
/**
* Catalog connection
*
* @var \VuFind\ILS\Connection
* @var ?\VuFind\ILS\Connection
*/
protected $catalog = null;

Expand Down
6 changes: 3 additions & 3 deletions module/VuFind/src/VuFind/Auth/ILSAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ILSAuthenticator implements DbServiceAwareInterface
/**
* Authentication manager
*
* @var Manager
* @var ?Manager
*/
protected $authManager = null;

Expand All @@ -77,14 +77,14 @@ class ILSAuthenticator implements DbServiceAwareInterface
/**
* Is encryption enabled?
*
* @var bool
* @var ?bool
*/
protected $encryptionEnabled = null;

/**
* Encryption key used for catalog passwords (null if encryption disabled):
*
* @var string
* @var ?string
*/
protected $encryptionKey = null;

Expand Down
Loading

0 comments on commit a7e5e45

Please sign in to comment.