Remove scalar typehints to support PHP5

This commit is contained in:
Alexander Nell 2020-02-25 17:48:27 +01:00
parent 29fff4e012
commit e8d2b2e81e
5 changed files with 12 additions and 12 deletions

View File

@ -38,7 +38,7 @@ class CallQueueListening extends Listening implements UsageInformationAble {
public function triggerCallback() { public function triggerCallback() {
$params = func_get_args(); $params = func_get_args();
if ($this->triggerCallbackWithParams($params, false) === false) { if ($this->triggerCallbackWithParams($params, false) === false) {
if ($this->$errorMethod != null) { if ($this->errorMethod != null) {
call_user_func($this->errorMethod, $this->method); call_user_func($this->errorMethod, $this->method);
} }
@ -54,7 +54,7 @@ class CallQueueListening extends Listening implements UsageInformationAble {
* @param array $params * @param array $params
* @return mixed * @return mixed
*/ */
public function triggerCallbackWithParams(array $params, bool $callErrorMethod = true) { public function triggerCallbackWithParams(array $params, $callErrorMethod = true) {
$result = call_user_func_array($this->getUserFunction(), $params); $result = call_user_func_array($this->getUserFunction(), $params);
if ($callErrorMethod && $result === false) { if ($callErrorMethod && $result === false) {
if ($this->errorMethod != null) { if ($this->errorMethod != null) {

View File

@ -41,7 +41,7 @@ class CallQueueManager implements UsageInformationAble {
* @param mixed $errorMethod * @param mixed $errorMethod
* @return bool * @return bool
*/ */
public function registerListening(CallQueueListener $listener, $methods, $errorMethod = null, bool $important = false) { public function registerListening(CallQueueListener $listener, $methods, $errorMethod = null, $important = false) {
if ($errorMethod != null && !CallQueueListening::checkValidCallback($listener, $errorMethod)) { if ($errorMethod != null && !CallQueueListening::checkValidCallback($listener, $errorMethod)) {
trigger_error("Given Listener (" . get_class($listener) . ") can't handle Queue Call Callback (No Error Method '{$errorMethod}')!"); trigger_error("Given Listener (" . get_class($listener) . ") can't handle Queue Call Callback (No Error Method '{$errorMethod}')!");
return false; return false;
@ -96,7 +96,7 @@ class CallQueueManager implements UsageInformationAble {
* @param string $method * @param string $method
* @return bool * @return bool
*/ */
public function hasListening(CallQueueListener $listener, string $method) { public function hasListening(CallQueueListener $listener, $method) {
foreach ($this->queueListenings as $listening) { foreach ($this->queueListenings as $listening) {
if ($listening->listener === $listener && $listening->method === $method) { if ($listening->listener === $listener && $listening->method === $method) {
return true; return true;

View File

@ -127,7 +127,7 @@ class CommandManager implements CallbackListener, UsageInformationAble {
* @param bool $adminCommand * @param bool $adminCommand
* @param CommandListener $listener * @param CommandListener $listener
*/ */
public function disableCommand($commandName, bool $adminCommand, CommandListener $listener) { public function disableCommand($commandName, $adminCommand, CommandListener $listener) {
if (is_array($commandName)) { if (is_array($commandName)) {
foreach ($commandName as $command) { foreach ($commandName as $command) {
$this->disableCommand($command, $adminCommand, $listener); $this->disableCommand($command, $adminCommand, $listener);
@ -163,7 +163,7 @@ class CommandManager implements CallbackListener, UsageInformationAble {
* @param bool $adminCommand * @param bool $adminCommand
* @param CommandListener $listener * @param CommandListener $listener
*/ */
public function enableCommand($commandName, bool $adminCommand, CommandListener $listener) { public function enableCommand($commandName, $adminCommand, CommandListener $listener) {
if (is_array($commandName)) { if (is_array($commandName)) {
foreach ($commandName as $command) { foreach ($commandName as $command) {
$this->enableCommand($command, $adminCommand, $listener); $this->enableCommand($command, $adminCommand, $listener);
@ -198,7 +198,7 @@ class CommandManager implements CallbackListener, UsageInformationAble {
* @param bool $adminCommand * @param bool $adminCommand
* @return bool|array * @return bool|array
*/ */
public function isCommandEnabled($commandName, bool $adminCommand) { public function isCommandEnabled($commandName, $adminCommand) {
if (is_array($commandName)) { if (is_array($commandName)) {
$results = array(); $results = array();
foreach ($commandName as $command) { foreach ($commandName as $command) {

View File

@ -244,7 +244,7 @@ abstract class FileUtil {
* @param string $path * @param string $path
* @return string * @return string
*/ */
public static function shortenPath(string $path) { public static function shortenPath($path) {
$root = substr($path, 0, 1) === '/'; $root = substr($path, 0, 1) === '/';
$path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path); $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
$parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen'); $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');

View File

@ -20,7 +20,7 @@ abstract class DataUtil {
* @param string $root * @param string $root
* @return string * @return string
*/ */
public static function buildXmlStandaloneFromArray(array $a, string $root = '') { public static function buildXmlStandaloneFromArray(array $a, $root = '') {
$domDocument = new \DOMDocument("1.0", "utf-8"); $domDocument = new \DOMDocument("1.0", "utf-8");
$domDocument->xmlStandalone = true; $domDocument->xmlStandalone = true;
@ -70,7 +70,7 @@ abstract class DataUtil {
* @param bool $recurse * @param bool $recurse
* @return array * @return array
*/ */
public static function implodePositions(array $a, bool $recurse = true) { public static function implodePositions(array $a, $recurse = true) {
$result = array(); $result = array();
foreach ($a as $key => $value) { foreach ($a as $key => $value) {
if (is_array($value)) { if (is_array($value)) {
@ -95,7 +95,7 @@ abstract class DataUtil {
* @param string $prefix (used for recursion) * @param string $prefix (used for recursion)
* @return array * @return array
*/ */
public static function flattenArray(array $a, string $delimiter = '.', string $prefix = '') { public static function flattenArray(array $a, $delimiter = '.', $prefix = '') {
$result = array(); $result = array();
foreach ($a as $key => $value) foreach ($a as $key => $value)
{ {
@ -121,7 +121,7 @@ abstract class DataUtil {
* @param string $delimiter * @param string $delimiter
* @return array * @return array
*/ */
public static function unflattenArray(array $a, string $delimiter = '.') { public static function unflattenArray(array $a, $delimiter = '.') {
$result = array(); $result = array();
foreach ($a as $key => $value) { foreach ($a as $key => $value) {
if (!is_string($key)) { if (!is_string($key)) {