@@ -12,8 +12,7 @@ discard block |
||
| 12 | 12 | function get_private_property($object, $property) |
| 13 | 13 | { |
| 14 | 14 | $reflObj = is_object($object) ? |
| 15 | - new \ReflectionObject($object) : |
|
| 16 | - new \ReflectionClass($object); |
|
| 15 | + new \ReflectionObject($object) : new \ReflectionClass($object); |
|
| 17 | 16 | |
| 18 | 17 | $reflProp = $reflObj->getProperty($property); |
| 19 | 18 | $reflProp->setAccessible(true); |
@@ -46,8 +45,7 @@ discard block |
||
| 46 | 45 | function call_private_method_array($object, $method, array $args) |
| 47 | 46 | { |
| 48 | 47 | $reflObj = is_object($object) ? |
| 49 | - new \ReflectionObject($object) : |
|
| 50 | - new \ReflectionClass($object); |
|
| 48 | + new \ReflectionObject($object) : new \ReflectionClass($object); |
|
| 51 | 49 | |
| 52 | 50 | $reflMethod = $reflObj->getMethod($method); |
| 53 | 51 | $reflMethod->setAccessible(true); |
@@ -47,15 +47,15 @@ |
||
| 47 | 47 | */ |
| 48 | 48 | function inet_to_bits($inet) |
| 49 | 49 | { |
| 50 | - $unpacked = unpack('A16', $inet); |
|
| 51 | - $unpacked = str_split($unpacked[1]); |
|
| 52 | - $binaryip = ''; |
|
| 50 | + $unpacked = unpack('A16', $inet); |
|
| 51 | + $unpacked = str_split($unpacked[1]); |
|
| 52 | + $binaryip = ''; |
|
| 53 | 53 | |
| 54 | - foreach ($unpacked as $char) { |
|
| 55 | - $binaryip .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT); |
|
| 56 | - } |
|
| 54 | + foreach ($unpacked as $char) { |
|
| 55 | + $binaryip .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT); |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - return $binaryip; |
|
| 58 | + return $binaryip; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | if ($ipv !== $cidrv) return false; |
| 20 | 20 | |
| 21 | - $fn = __NAMESPACE__ . "\\ipv{$ipv}_in_cidr"; |
|
| 21 | + $fn = __NAMESPACE__."\\ipv{$ipv}_in_cidr"; |
|
| 22 | 22 | return $fn($ip, $cidr); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | return $function($argsStr); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | -CODE; |
|
| 52 | +code; |
|
| 53 | 53 | |
| 54 | 54 | unset($params, $args); |
| 55 | 55 | } |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
| 3 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
| 4 | 4 | |
| 5 | -require_once __DIR__ . '/../src/array_functions.php'; |
|
| 6 | -require_once __DIR__ . '/../src/case_functions.php'; |
|
| 7 | -require_once __DIR__ . '/../src/class_functions.php'; |
|
| 8 | -require_once __DIR__ . '/../src/string_functions.php'; |
|
| 9 | -require_once __DIR__ . '/../src/server_functions.php'; |
|
| 10 | -require_once __DIR__ . '/../src/file_functions.php'; |
|
| 5 | +require_once __DIR__.'/../src/array_functions.php'; |
|
| 6 | +require_once __DIR__.'/../src/case_functions.php'; |
|
| 7 | +require_once __DIR__.'/../src/class_functions.php'; |
|
| 8 | +require_once __DIR__.'/../src/string_functions.php'; |
|
| 9 | +require_once __DIR__.'/../src/server_functions.php'; |
|
| 10 | +require_once __DIR__.'/../src/file_functions.php'; |
|
| 11 | 11 | |
| 12 | 12 | $userFunctions = get_defined_functions()['user']; |
| 13 | 13 | $jasnyFunctions = []; |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | $params[] = join(' ', array_filter([ |
| 35 | 35 | $param->getClass(), |
| 36 | 36 | $param->isArray() ? 'array' : null, |
| 37 | - '$' . $param->getName(), |
|
| 38 | - $param->isDefaultValueAvailable() ? '= ' . var_export($param->getDefaultValue(), true) : null |
|
| 37 | + '$'.$param->getName(), |
|
| 38 | + $param->isDefaultValueAvailable() ? '= '.var_export($param->getDefaultValue(), true) : null |
|
| 39 | 39 | ])); |
| 40 | 40 | |
| 41 | - $args[] = '$' . $param->getName(); |
|
| 41 | + $args[] = '$'.$param->getName(); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $paramStr = join(', ', $params); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | unset($params, $args); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | -file_put_contents(dirname(__DIR__) . '/src/global.php', "<?php\n\n" . join("\n", $code)); |
|
| 59 | +file_put_contents(dirname(__DIR__).'/src/global.php', "<?php\n\n".join("\n", $code)); |
|
| 60 | 60 | |
| 61 | 61 | echo "Created src/global.php\n"; |
| 62 | 62 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | while (!feof($handle)) { |
| 23 | 23 | $cur = fread($handle, $len); |
| 24 | 24 | |
| 25 | - if (strpos($prev . $cur, $str) !== false) { |
|
| 25 | + if (strpos($prev.$cur, $str) !== false) { |
|
| 26 | 26 | $valid = true; |
| 27 | 27 | break; |
| 28 | 28 | } |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | $step1 = strtr($quoted, ['\?' => '[^/]', '\*' => '[^/]*', '/\*\*' => '(?:/.*)?', '#' => '\d+', '\[' => '[', |
| 49 | 49 | '\]' => ']', '\-' => '-', '\{' => '{', '\}' => '}']); |
| 50 | 50 | |
| 51 | - $step2 = preg_replace_callback('~{[^}]+}~', function ($part) { |
|
| 52 | - return '(?:' . substr(strtr($part[0], ',', '|'), 1, -1) . ')'; |
|
| 51 | + $step2 = preg_replace_callback('~{[^}]+}~', function($part) { |
|
| 52 | + return '(?:'.substr(strtr($part[0], ',', '|'), 1, -1).')'; |
|
| 53 | 53 | }, $step1); |
| 54 | 54 | |
| 55 | 55 | $regex = rawurldecode($step2); |