2019-06-18 12:31:44 +02:00
|
|
|
<?php
|
|
|
|
// Polyfill for some PHP 5 functions
|
|
|
|
function callMe($allable, ...$args)
|
|
|
|
{
|
|
|
|
return $allable(...$args);
|
|
|
|
}
|
2019-09-02 17:08:36 +02:00
|
|
|
function returnMe($res)
|
|
|
|
{
|
2019-06-18 12:31:44 +02:00
|
|
|
return $res;
|
|
|
|
}
|
2019-12-26 20:26:27 +01:00
|
|
|
function __coalesce($ifNotNull, $then)
|
|
|
|
{
|
2019-12-25 22:03:51 +01:00
|
|
|
return $ifNotNull ? $ifNotNull : $then;
|
|
|
|
}
|
2019-12-26 20:26:27 +01:00
|
|
|
function __destructure($list, $value)
|
|
|
|
{
|
2019-12-25 22:03:51 +01:00
|
|
|
$res = [];
|
|
|
|
foreach ($list as $key) {
|
2019-12-26 20:26:27 +01:00
|
|
|
if (\is_string($key)) {
|
2019-12-25 22:03:51 +01:00
|
|
|
$res []= $value[$key];
|
|
|
|
} else {
|
2019-12-26 20:26:27 +01:00
|
|
|
$res = \array_merge($res, __destructure($key, $value[$key]));
|
2019-12-25 22:03:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return $res;
|
|
|
|
}
|
2019-09-02 17:08:36 +02:00
|
|
|
if (!\function_exists('is_iterable')) {
|
|
|
|
function is_iterable($var)
|
|
|
|
{
|
|
|
|
return \is_array($var) || $var instanceof Traversable;
|
2019-06-18 12:31:44 +02:00
|
|
|
}
|
|
|
|
}
|
2019-09-02 17:08:36 +02:00
|
|
|
if (!\function_exists('error_clear_last')) {
|
|
|
|
function error_clear_last()
|
|
|
|
{
|
|
|
|
@\trigger_error("");
|
2019-06-21 16:04:05 +02:00
|
|
|
}
|
2019-06-21 12:16:48 +02:00
|
|
|
}
|
2019-12-13 14:40:48 +01:00
|
|
|
|
|
|
|
if (!\defined('MADELINEPROTO_TEST')) {
|
|
|
|
\define('MADELINEPROTO_TEST', 'NOT PONY');
|
|
|
|
}
|
2019-12-26 19:17:31 +01:00
|
|
|
trait MyCallableMaker
|
|
|
|
{
|
|
|
|
use \Amp\CallableMaker {
|
|
|
|
callableFromInstanceMethod as public;
|
|
|
|
callableFromStaticMethod as public;
|
|
|
|
}
|
|
|
|
}
|