Skip to content

Commit

Permalink
Merge pull request #63 from glensc/errcontext-php8
Browse files Browse the repository at this point in the history
Missing default values caused errorHandlerIgnore to fail under PHP 8.0
  • Loading branch information
falkenhawk authored Mar 13, 2021
2 parents c133dad + 74e8a3c commit cf0d9cb
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion tests/Zend/FilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function testUsageOfOldStaticFactory()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Form/Element/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ private function _convertIniToInteger($setting)
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/LocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ public function testEachDataFileShouldPresentAsLocaleData()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Translate/Adapter/ArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public function testLoadingFilesIntoCacheAfterwards()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Translate/Adapter/CsvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public function testSpecialChars()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Translate/Adapter/GettextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public function testPluralToSingular()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Translate/Adapter/IniTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public function testOptionLocaleFilename()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Translate/Adapter/QtTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public function testIsoEncoding()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Translate/Adapter/TbxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function testWithoutEncoding()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Translate/Adapter/TmxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public function testUseId()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Translate/Adapter/XliffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public function testIsoEncoding()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Translate/Adapter/XmlTmTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public function testWithoutEncoding()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext= array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/TranslateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ public function testSettingLogPriorityForLog()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccured = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Validate/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function testMaximumErrorMessageLength()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Validate/CcnumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function testGetMessages()
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccured = true;
}
Expand Down
8 changes: 6 additions & 2 deletions tests/Zend/Validate/DateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ public function testLocaleContructor()
*/
public function testNonStringValidation()
{
$this->assertFalse($this->_validator->isValid(array(1 => 1)));
try {
$this->assertFalse($this->_validator->isValid(array(1 => 1)));
} catch (Error $e) {
$this->assertTrue($e instanceof TypeError);
}
}

/**
Expand Down Expand Up @@ -251,7 +255,7 @@ public function testArrayVerification()
* @return void
* @group ZF-2789
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/ValidateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public function handleNotFoundError($errnum, $errstr)
* @param array $errcontext
* @return void
*/
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext)
public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $errcontext = array())
{
$this->_errorOccurred = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/View/Helper/Navigation/NavigationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public function testSetDefaultRoleThrowsExceptionWhenGivenAnArbitraryObject()
}

private $_errorMessage;
public function toStringErrorHandler($code, $msg, $file, $line, array $c)
public function toStringErrorHandler($code, $msg, $file, $line, array $c = array())
{
$this->_errorMessage = $msg;
}
Expand Down

0 comments on commit cf0d9cb

Please sign in to comment.