Skip to content

Commit

Permalink
Removed default values from method signatures
Browse files Browse the repository at this point in the history
As optional before required params is forbidden in PHP9 these signatures
needed to be changed and the functionality of the method adapted
accordingly to still retain the original behaviour.
  • Loading branch information
Alexander Wozniak authored and glensc committed Mar 13, 2021
1 parent ff59908 commit 3a5b578
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 8 additions & 1 deletion packages/zend-pdf/library/Zend/Pdf/Element/Reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,15 @@ class Zend_Pdf_Element_Reference extends Zend_Pdf_Element
* @param Zend_Pdf_ElementFactory $factory
* @throws Zend_Pdf_Exception
*/
public function __construct($objNum, $genNum = 0, Zend_Pdf_Element_Reference_Context $context, Zend_Pdf_ElementFactory $factory)
public function __construct($objNum, $genNum, Zend_Pdf_Element_Reference_Context $context, Zend_Pdf_ElementFactory $factory)
{
/**
* This was changed as PHP8 errors out if there's an optional parameter before a required param
*/
if (empty($genNum)) {
$genNum = 0;
}

if ( !(is_integer($objNum) && $objNum > 0) ) {
// require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Object number must be positive integer');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,12 @@ public function clearMessages($queueName = '')
* @param Zend_Service_WindowsAzure_Storage_QueueMessage $message Message to delete from queue. A message retrieved using "peekMessages" can NOT be deleted!
* @throws Zend_Service_WindowsAzure_Exception
*/
public function deleteMessage($queueName = '', Zend_Service_WindowsAzure_Storage_QueueMessage $message)
public function deleteMessage($queueName, Zend_Service_WindowsAzure_Storage_QueueMessage $message)
{
if ($queueName === '') {
/**
* This was changed as PHP8 errors out if there's an optional parameter before a required param
*/
if (empty($queueName)) {
// require_once 'Zend/Service/WindowsAzure/Exception.php';
throw new Zend_Service_WindowsAzure_Exception('Queue name is not specified.');
}
Expand Down

0 comments on commit 3a5b578

Please sign in to comment.