Skip to content

Commit

Permalink
Merge pull request #442 from sreichel/84-nullable
Browse files Browse the repository at this point in the history
PHP8.4: Implicitly nullable
  • Loading branch information
develart-projects authored Oct 8, 2024
2 parents 601e1ba + 28a3002 commit 91ee415
Show file tree
Hide file tree
Showing 166 changed files with 295 additions and 294 deletions.
3 changes: 2 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
->setFinder($finder)
->setRules([
'array_syntax' => ['syntax' => 'short'],
'modernize_types_casting' => true,
'logical_operators' => true,
'modernize_types_casting' => true,
'nullable_type_declaration_for_default_null_value' => true,
]);
18 changes: 9 additions & 9 deletions library/Zend/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ public function removeAll()
* @uses Zend_Acl::setRule()
* @return $this
*/
public function allow($roles = null, $resources = null, $privileges = null, Zend_Acl_Assert_Interface $assert = null)
public function allow($roles = null, $resources = null, $privileges = null, ?Zend_Acl_Assert_Interface $assert = null)
{
return $this->setRule(self::OP_ADD, self::TYPE_ALLOW, $roles, $resources, $privileges, $assert);
}
Expand All @@ -514,7 +514,7 @@ public function allow($roles = null, $resources = null, $privileges = null, Zend
* @uses Zend_Acl::setRule()
* @return $this
*/
public function deny($roles = null, $resources = null, $privileges = null, Zend_Acl_Assert_Interface $assert = null)
public function deny($roles = null, $resources = null, $privileges = null, ?Zend_Acl_Assert_Interface $assert = null)
{
return $this->setRule(self::OP_ADD, self::TYPE_DENY, $roles, $resources, $privileges, $assert);
}
Expand Down Expand Up @@ -600,7 +600,7 @@ public function removeDeny($roles = null, $resources = null, $privileges = null)
* @return $this
*/
public function setRule($operation, $type, $roles = null, $resources = null, $privileges = null,
Zend_Acl_Assert_Interface $assert = null)
?Zend_Acl_Assert_Interface $assert = null)
{
// ensure that the rule type is valid; normalize input to uppercase
$type = strtoupper($type);
Expand Down Expand Up @@ -919,7 +919,7 @@ protected function _getRoleRegistry()
* @param Zend_Acl_Resource_Interface $resource
* @return boolean|null
*/
protected function _roleDFSAllPrivileges(Zend_Acl_Role_Interface $role, Zend_Acl_Resource_Interface $resource = null)
protected function _roleDFSAllPrivileges(Zend_Acl_Role_Interface $role, ?Zend_Acl_Resource_Interface $resource = null)
{
$dfs = [
'visited' => [],
Expand Down Expand Up @@ -955,7 +955,7 @@ protected function _roleDFSAllPrivileges(Zend_Acl_Role_Interface $role, Zend_Acl
* @return boolean|null
* @throws Zend_Acl_Exception
*/
protected function _roleDFSVisitAllPrivileges(Zend_Acl_Role_Interface $role, Zend_Acl_Resource_Interface $resource = null,
protected function _roleDFSVisitAllPrivileges(Zend_Acl_Role_Interface $role, ?Zend_Acl_Resource_Interface $resource = null,
&$dfs = null)
{
if (null === $dfs) {
Expand Down Expand Up @@ -998,7 +998,7 @@ protected function _roleDFSVisitAllPrivileges(Zend_Acl_Role_Interface $role, Zen
* @return boolean|null
* @throws Zend_Acl_Exception
*/
protected function _roleDFSOnePrivilege(Zend_Acl_Role_Interface $role, Zend_Acl_Resource_Interface $resource = null,
protected function _roleDFSOnePrivilege(Zend_Acl_Role_Interface $role, ?Zend_Acl_Resource_Interface $resource = null,
$privilege = null)
{
if (null === $privilege) {
Expand Down Expand Up @@ -1044,7 +1044,7 @@ protected function _roleDFSOnePrivilege(Zend_Acl_Role_Interface $role, Zend_Acl_
* @return boolean|null
* @throws Zend_Acl_Exception
*/
protected function _roleDFSVisitOnePrivilege(Zend_Acl_Role_Interface $role, Zend_Acl_Resource_Interface $resource = null,
protected function _roleDFSVisitOnePrivilege(Zend_Acl_Role_Interface $role, ?Zend_Acl_Resource_Interface $resource = null,
$privilege = null, &$dfs = null)
{
if (null === $privilege) {
Expand Down Expand Up @@ -1098,7 +1098,7 @@ protected function _roleDFSVisitOnePrivilege(Zend_Acl_Role_Interface $role, Zend
* @param string $privilege
* @return string|null
*/
protected function _getRuleType(Zend_Acl_Resource_Interface $resource = null, Zend_Acl_Role_Interface $role = null,
protected function _getRuleType(?Zend_Acl_Resource_Interface $resource = null, ?Zend_Acl_Role_Interface $role = null,
$privilege = null)
{
// get the rules for the $resource and $role
Expand Down Expand Up @@ -1154,7 +1154,7 @@ protected function _getRuleType(Zend_Acl_Resource_Interface $resource = null, Ze
* @param boolean $create
* @return array|null
*/
protected function &_getRules(Zend_Acl_Resource_Interface $resource = null, Zend_Acl_Role_Interface $role = null,
protected function &_getRules(?Zend_Acl_Resource_Interface $resource = null, ?Zend_Acl_Role_Interface $role = null,
$create = false)
{
// create a reference to null
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Acl/Assert/Interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ interface Zend_Acl_Assert_Interface
* @param string $privilege
* @return boolean
*/
public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role = null, Zend_Acl_Resource_Interface $resource = null,
public function assert(Zend_Acl $acl, ?Zend_Acl_Role_Interface $role = null, ?Zend_Acl_Resource_Interface $resource = null,
$privilege = null);
}
4 changes: 2 additions & 2 deletions library/Zend/Auth/Adapter/DbTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface
* @param string $credentialColumn
* @param string $credentialTreatment
*/
public function __construct(Zend_Db_Adapter_Abstract $zendDb = null, $tableName = null, $identityColumn = null,
public function __construct(?Zend_Db_Adapter_Abstract $zendDb = null, $tableName = null, $identityColumn = null,
$credentialColumn = null, $credentialTreatment = null)
{
$this->_setDbAdapter($zendDb);
Expand Down Expand Up @@ -162,7 +162,7 @@ public function __construct(Zend_Db_Adapter_Abstract $zendDb = null, $tableName
* @return Zend_Auth_Adapter_DbTable
* @throws Zend_Auth_Adapter_Exception
*/
protected function _setDbAdapter(Zend_Db_Adapter_Abstract $zendDb = null)
protected function _setDbAdapter(?Zend_Db_Adapter_Abstract $zendDb = null)
{
$this->_zendDb = $zendDb;

Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Auth/Adapter/OpenId.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ class Zend_Auth_Adapter_OpenId implements Zend_Auth_Adapter_Interface
* object to perform HTTP or HTML form redirection
*/
public function __construct($id = null,
Zend_OpenId_Consumer_Storage $storage = null,
?Zend_OpenId_Consumer_Storage $storage = null,
$returnTo = null,
$root = null,
$extensions = null,
Zend_Controller_Response_Abstract $response = null) {
?Zend_Controller_Response_Abstract $response = null) {
$this->_id = $id;
$this->_storage = $storage;
$this->_returnTo = $returnTo;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public static function _makeFrontend($frontend, $frontendOptions = [], $customFr
* @param string $msg Message for the exception
* @throws Zend_Cache_Exception
*/
public static function throwException($msg, Exception $e = null)
public static function throwException($msg, ?Exception $e = null)
{
// For perfs reasons, we use this dynamic inclusion
require_once 'Zend/Cache/Exception.php';
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Captcha/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function generate();
* @param mixed $element
* @return string
*/
public function render(Zend_View_Interface $view = null, $element = null);
public function render(?Zend_View_Interface $view = null, $element = null);

/**
* Set captcha name
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Captcha/Dumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function getLabel()
* @param mixed $element
* @return string
*/
public function render(Zend_View_Interface $view = null, $element = null)
public function render(?Zend_View_Interface $view = null, $element = null)
{
return $this->getLabel() . ': <b>'
. strrev($this->getWord())
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Captcha/Figlet.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function generate()
* @param mixed $element
* @return string
*/
public function render(Zend_View_Interface $view = null, $element = null)
public function render(?Zend_View_Interface $view = null, $element = null)
{
return '<pre>'
. $this->_figlet->render($this->getWord())
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Captcha/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ protected function _gc()
* @param mixed $element
* @return string
*/
public function render(Zend_View_Interface $view = null, $element = null)
public function render(?Zend_View_Interface $view = null, $element = null)
{
$endTag = ' />';
if (($view instanceof Zend_View_Abstract) && !$view->doctype()->isXhtml()) {
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Captcha/ReCaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public function isValid($value, $context = null)
* @param mixed $element
* @return string
*/
public function render(Zend_View_Interface $view = null, $element = null)
public function render(?Zend_View_Interface $view = null, $element = null)
{
$name = null;
if ($element instanceof Zend_Form_Element) {
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Cloud/DocumentService/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function listCollections($options = null);
* @param null|array $options
* @return Zend_Cloud_DocumentService_DocumentSet
*/
public function listDocuments($collectionName, array $options = null);
public function listDocuments($collectionName, ?array $options = null);

/**
* Insert document
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Cloud/DocumentService/Adapter/SimpleDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function listCollections($options = null)
* @param array|null $options
* @return Zend_Cloud_DocumentService_DocumentSet
*/
public function listDocuments($collectionName, array $options = null)
public function listDocuments($collectionName, ?array $options = null)
{
$query = $this->select('*')->from($collectionName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ protected function _getDocumentFromArray($document, $collectionName = null)
* @param null|array $options
* @return array
*/
public function listDocuments($collectionName, array $options = null)
public function listDocuments($collectionName, ?array $options = null)
{
$select = $this->select()->from($collectionName);
return $this->query($collectionName, $select);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Cloud/Infrastructure/InstanceList.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Zend_Cloud_Infrastructure_InstanceList implements Countable, Iterator, Arr
* @param array $instances
* @return void
*/
public function __construct($adapter, array $instances = null)
public function __construct($adapter, ?array $instances = null)
{
if (!($adapter instanceof Zend_Cloud_Infrastructure_Adapter)) {
require_once 'Zend/Cloud/Infrastructure/Exception.php';
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Config/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ abstract class Zend_Config_Writer
*
* @param null|array $options
*/
public function __construct(array $options = null)
public function __construct(?array $options = null)
{
if (is_array($options)) {
$this->setOptions($options);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Config/Writer/FileAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function setExclusiveLock($exclusiveLock)
* @param bool $exclusiveLock
* @return void
*/
public function write($filename = null, Zend_Config $config = null, $exclusiveLock = null)
public function write($filename = null, ?Zend_Config $config = null, $exclusiveLock = null)
{
if ($filename !== null) {
$this->setFilename($filename);
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Controller/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public function dispatch($action)
* object to use
* @return Zend_Controller_Response_Abstract
*/
public function run(Zend_Controller_Request_Abstract $request = null, Zend_Controller_Response_Abstract $response = null)
public function run(?Zend_Controller_Request_Abstract $request = null, ?Zend_Controller_Response_Abstract $response = null)
{
if (null !== $request) {
$this->setRequest($request);
Expand Down Expand Up @@ -720,7 +720,7 @@ public function getAllParams()
* @deprecated Deprecated as of Zend Framework 1.7. Use
* forward() instead.
*/
final protected function _forward($action, $controller = null, $module = null, array $params = null)
final protected function _forward($action, $controller = null, $module = null, ?array $params = null)
{
$this->forward($action, $controller, $module, $params);
}
Expand Down Expand Up @@ -751,7 +751,7 @@ final protected function _forward($action, $controller = null, $module = null, a
* @param array $params
* @return void
*/
final public function forward($action, $controller = null, $module = null, array $params = null)
final public function forward($action, $controller = null, $module = null, ?array $params = null)
{
$request = $this->getRequest();

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Controller/Action/Helper/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ abstract class Zend_Controller_Action_Helper_Abstract
* @param Zend_Controller_Action $actionController
* @return $this
*/
public function setActionController(Zend_Controller_Action $actionController = null)
public function setActionController(?Zend_Controller_Action $actionController = null)
{
$this->_actionController = $actionController;
return $this;
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Controller/Action/Helper/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Zend_Controller_Action_Helper_Url extends Zend_Controller_Action_Helper_Ab
* @param array $params
* @return string
*/
public function simple($action, $controller = null, $module = null, array $params = null)
public function simple($action, $controller = null, $module = null, ?array $params = null)
{
$request = $this->getRequest();

Expand Down Expand Up @@ -110,7 +110,7 @@ public function url($urlOptions = [], $name = null, $reset = false, $encode = tr
* @param array $params
* @return string
*/
public function direct($action, $controller = null, $module = null, array $params = null)
public function direct($action, $controller = null, $module = null, ?array $params = null)
{
return $this->simple($action, $controller, $module, $params);
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Controller/Action/Helper/ViewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class Zend_Controller_Action_Helper_ViewRenderer extends Zend_Controller_Action_
* @param array $options
* @return void
*/
public function __construct(Zend_View_Interface $view = null, array $options = [])
public function __construct(?Zend_View_Interface $view = null, array $options = [])
{
if (null !== $view) {
$this->setView($view);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Controller/Dispatcher/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public function clearParams($name = null)
* @param Zend_Controller_Response_Abstract|null $response
* @return $this
*/
public function setResponse(Zend_Controller_Response_Abstract $response = null)
public function setResponse(?Zend_Controller_Response_Abstract $response = null)
{
$this->_response = $response;
return $this;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Controller/Dispatcher/Interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function clearParams($name = null);
* @param Zend_Controller_Response_Abstract|null $response
* @return void
*/
public function setResponse(Zend_Controller_Response_Abstract $response = null);
public function setResponse(?Zend_Controller_Response_Abstract $response = null);

/**
* Retrieve the response object, if any
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Controller/Front.php
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ public function returnResponse($flag = null)
* @param Zend_Controller_Response_Abstract|null $response
* @return void|Zend_Controller_Response_Abstract Returns response object if returnResponse() is true
*/
public function dispatch(Zend_Controller_Request_Abstract $request = null, Zend_Controller_Response_Abstract $response = null)
public function dispatch(?Zend_Controller_Request_Abstract $request = null, ?Zend_Controller_Response_Abstract $response = null)
{
if (!$this->getParam('noErrorHandler') && !$this->_plugins->hasPlugin('Zend_Controller_Plugin_ErrorHandler')) {
// Register with stack index of 100
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Controller/Plugin/ActionStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Zend_Controller_Plugin_ActionStack extends Zend_Controller_Plugin_Abstract
* @param string $key
* @return void
*/
public function __construct(Zend_Registry $registry = null, $key = null)
public function __construct(?Zend_Registry $registry = null, $key = null)
{
if (null === $registry) {
$registry = Zend_Registry::getInstance();
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Controller/Router/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public static function getInstance(Zend_Config $config)
* @param mixed|null $locale
*/
public function __construct(
$route, $defaults = [], $reqs = [], Zend_Translate $translator = null, $locale = null
$route, $defaults = [], $reqs = [], ?Zend_Translate $translator = null, $locale = null
)
{
$route = trim($route, $this->_urlDelimiter);
Expand Down Expand Up @@ -488,7 +488,7 @@ public function getVariables()
* @param Zend_Translate $translator
* @return void
*/
public static function setDefaultTranslator(Zend_Translate $translator = null)
public static function setDefaultTranslator(?Zend_Translate $translator = null)
{
self::$_defaultTranslator = $translator;
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Controller/Router/Route/Chain.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public function assemble($data = [], $reset = false, $encode = false)
* @param Zend_Controller_Request_Abstract|null $request
* @return void
*/
public function setRequest(Zend_Controller_Request_Abstract $request = null)
public function setRequest(?Zend_Controller_Request_Abstract $request = null)
{
$this->_request = $request;

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Controller/Router/Route/Hostname.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route
*
* @param Zend_Controller_Request_Abstract|null $request
*/
public function setRequest(Zend_Controller_Request_Abstract $request = null)
public function setRequest(?Zend_Controller_Request_Abstract $request = null)
{
$this->_request = $request;
}
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Controller/Router/Route/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ public static function getInstance(Zend_Config $config)
*/
public function __construct(
array $defaults = [],
Zend_Controller_Dispatcher_Interface $dispatcher = null,
Zend_Controller_Request_Abstract $request = null
?Zend_Controller_Dispatcher_Interface $dispatcher = null,
?Zend_Controller_Request_Abstract $request = null
)
{
$this->_defaults = $defaults;
Expand Down
Loading

0 comments on commit 91ee415

Please sign in to comment.