@@ -33,6 +33,9 @@ discard block |
||
33 | 33 | private $file; |
34 | 34 | private $line; |
35 | 35 | |
36 | + /** |
|
37 | + * @param integer $statusCode |
|
38 | + */ |
|
36 | 39 | public static function create(\Exception $exception, $statusCode = null, array $headers = array()) |
37 | 40 | { |
38 | 41 | return static::createFromThrowable($exception, $statusCode, $headers); |
@@ -110,6 +113,9 @@ discard block |
||
110 | 113 | return $this->class; |
111 | 114 | } |
112 | 115 | |
116 | + /** |
|
117 | + * @param string $class |
|
118 | + */ |
|
113 | 119 | public function setClass($class) |
114 | 120 | { |
115 | 121 | $this->class = $class; |
@@ -140,6 +146,9 @@ discard block |
||
140 | 146 | return $this->message; |
141 | 147 | } |
142 | 148 | |
149 | + /** |
|
150 | + * @param string $message |
|
151 | + */ |
|
143 | 152 | public function setMessage($message) |
144 | 153 | { |
145 | 154 | $this->message = $message; |
@@ -150,6 +159,9 @@ discard block |
||
150 | 159 | return $this->code; |
151 | 160 | } |
152 | 161 | |
162 | + /** |
|
163 | + * @param integer $code |
|
164 | + */ |
|
153 | 165 | public function setCode($code) |
154 | 166 | { |
155 | 167 | $this->code = $code; |
@@ -196,6 +208,10 @@ discard block |
||
196 | 208 | $this->setTrace($throwable->getTrace(), $throwable->getFile(), $throwable->getLine()); |
197 | 209 | } |
198 | 210 | |
211 | + /** |
|
212 | + * @param string $file |
|
213 | + * @param integer $line |
|
214 | + */ |
|
199 | 215 | public function setTrace($trace, $file, $line) |
200 | 216 | { |
201 | 217 | $this->trace = array(); |
@@ -36,6 +36,9 @@ discard block |
||
36 | 36 | private $caughtLength; |
37 | 37 | private $fileLinkFormat; |
38 | 38 | |
39 | + /** |
|
40 | + * @param string $fileLinkFormat |
|
41 | + */ |
|
39 | 42 | public function __construct(bool $debug = true, string $charset = null, $fileLinkFormat = null) |
40 | 43 | { |
41 | 44 | $this->debug = $debug; |
@@ -342,6 +345,10 @@ discard block |
||
342 | 345 | EOF; |
343 | 346 | } |
344 | 347 | |
348 | + /** |
|
349 | + * @param string $content |
|
350 | + * @param string $css |
|
351 | + */ |
|
345 | 352 | private function decorate($content, $css) |
346 | 353 | { |
347 | 354 | return <<<EOF |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $caughtLength = $this->caughtLength = 0; |
115 | 115 | |
116 | - ob_start(function ($buffer) { |
|
116 | + ob_start(function($buffer){ |
|
117 | 117 | $this->caughtBuffer = $buffer; |
118 | 118 | |
119 | 119 | return ''; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | // Empty loop, everything is in the condition |
125 | 125 | } |
126 | 126 | if (isset($this->caughtBuffer[0])) { |
127 | - ob_start(function ($buffer) { |
|
127 | + ob_start(function($buffer){ |
|
128 | 128 | if ($this->caughtLength) { |
129 | 129 | // use substr_replace() instead of substr() for mbstring overloading resistance |
130 | 130 | $cleanBuffer = substr_replace($buffer, '', 0, $this->caughtLength); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $caughtLength = $this->caughtLength = 0; |
115 | 115 | |
116 | - ob_start(function ($buffer) { |
|
116 | + ob_start(function ($buffer){ |
|
117 | 117 | $this->caughtBuffer = $buffer; |
118 | 118 | |
119 | 119 | return ''; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | // Empty loop, everything is in the condition |
125 | 125 | } |
126 | 126 | if (isset($this->caughtBuffer[0])) { |
127 | - ob_start(function ($buffer) { |
|
127 | + ob_start(function ($buffer){ |
|
128 | 128 | if ($this->caughtLength) { |
129 | 129 | // use substr_replace() instead of substr() for mbstring overloading resistance |
130 | 130 | $cleanBuffer = substr_replace($buffer, '', 0, $this->caughtLength); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | <div class="container"> |
214 | 214 | <h1>$title</h1> |
215 | 215 | </div> |
216 | -EOF; |
|
216 | +eof; |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | $content = ''; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | <p class="break-long-words trace-message">%s</p> |
236 | 236 | </th></tr></thead> |
237 | 237 | <tbody> |
238 | -EOF |
|
238 | +eof |
|
239 | 239 | , $ind, $total, $class, $message); |
240 | 240 | foreach ($e['trace'] as $trace) { |
241 | 241 | $content .= '<tr><td>'; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | <div class="container"> |
275 | 275 | $content |
276 | 276 | </div> |
277 | -EOF; |
|
277 | +eof; |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | /** |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | body { background-color: #fff; color: #222; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; } |
290 | 290 | .container { margin: 30px; max-width: 600px; } |
291 | 291 | h1 { color: #dc3545; font-size: 24px; } |
292 | -EOF; |
|
292 | +eof; |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | return <<<'EOF' |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | @media (min-width: 575px) { |
340 | 340 | .hidden-xs-down { display: initial; } |
341 | 341 | } |
342 | -EOF; |
|
342 | +eof; |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | private function decorate($content, $css) |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $content |
357 | 357 | </body> |
358 | 358 | </html> |
359 | -EOF; |
|
359 | +eof; |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | private function formatClass($class) |
@@ -120,6 +120,10 @@ |
||
120 | 120 | } |
121 | 121 | |
122 | 122 | // dummy function to test trace in error handler. |
123 | + |
|
124 | + /** |
|
125 | + * @param ErrorHandlerTest $that |
|
126 | + */ |
|
123 | 127 | private static function triggerNotice($that) |
124 | 128 | { |
125 | 129 | $that->assertSame('', $foo.$foo.$bar); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | 'type' => E_USER_WARNING, |
79 | 79 | 'message' => 'Hello', |
80 | 80 | 'file' => __FILE__, |
81 | - 'line' => __LINE__ - 5, |
|
81 | + 'line' => __LINE__ -5, |
|
82 | 82 | ); |
83 | 83 | $this->assertSame($expected, error_get_last()); |
84 | 84 | } catch (\Exception $e) { |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | |
219 | 219 | $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); |
220 | 220 | |
221 | - $warnArgCheck = function ($logLevel, $message, $context) { |
|
221 | + $warnArgCheck = function($logLevel, $message, $context){ |
|
222 | 222 | $this->assertEquals('info', $logLevel); |
223 | 223 | $this->assertEquals('User Deprecated: foo', $message); |
224 | 224 | $this->assertArrayHasKey('exception', $context); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); |
245 | 245 | |
246 | 246 | $line = null; |
247 | - $logArgCheck = function ($level, $message, $context) use (&$line) { |
|
247 | + $logArgCheck = function($level, $message, $context) use (&$line) { |
|
248 | 248 | $this->assertEquals('Notice: Undefined variable: undefVar', $message); |
249 | 249 | $this->assertArrayHasKey('exception', $context); |
250 | 250 | $exception = $context['exception']; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $handler->setDefaultLogger($logger, E_NOTICE); |
267 | 267 | $handler->screamAt(E_NOTICE); |
268 | 268 | unset($undefVar); |
269 | - $line = __LINE__ + 1; |
|
269 | + $line = __LINE__ +1; |
|
270 | 270 | @$undefVar++; |
271 | 271 | |
272 | 272 | restore_error_handler(); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | |
304 | 304 | public function testHandleDeprecation() |
305 | 305 | { |
306 | - $logArgCheck = function ($level, $message, $context) { |
|
306 | + $logArgCheck = function($level, $message, $context){ |
|
307 | 307 | $this->assertEquals(LogLevel::INFO, $level); |
308 | 308 | $this->assertArrayHasKey('exception', $context); |
309 | 309 | $exception = $context['exception']; |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); |
334 | 334 | |
335 | - $logArgCheck = function ($level, $message, $context) { |
|
335 | + $logArgCheck = function($level, $message, $context){ |
|
336 | 336 | $this->assertSame('Uncaught Exception: foo', $message); |
337 | 337 | $this->assertArrayHasKey('exception', $context); |
338 | 338 | $this->assertInstanceOf(\Exception::class, $context['exception']); |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | $this->assertSame($exception, $e); |
354 | 354 | } |
355 | 355 | |
356 | - $handler->setExceptionHandler(function ($e) use ($exception) { |
|
356 | + $handler->setExceptionHandler(function($e) use ($exception) { |
|
357 | 357 | $this->assertSame($exception, $e); |
358 | 358 | }); |
359 | 359 | |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | ->method('log') |
428 | 428 | ->with(LogLevel::CRITICAL, 'Uncaught Exception: Foo message', array('exception' => $exception)); |
429 | 429 | |
430 | - $handler->setExceptionHandler(function () use ($handler, $mockLogger) { |
|
430 | + $handler->setExceptionHandler(function() use ($handler, $mockLogger) { |
|
431 | 431 | $handler->setDefaultLogger($mockLogger); |
432 | 432 | }); |
433 | 433 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | |
449 | 449 | $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); |
450 | 450 | |
451 | - $logArgCheck = function ($level, $message, $context) { |
|
451 | + $logArgCheck = function($level, $message, $context){ |
|
452 | 452 | $this->assertEquals('Fatal Parse Error: foo', $message); |
453 | 453 | $this->assertArrayHasKey('exception', $context); |
454 | 454 | $this->assertInstanceOf(\Exception::class, $context['exception']); |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | $exception = new \Error("Class 'Foo' not found"); |
480 | 480 | |
481 | 481 | $handler = new ErrorHandler(); |
482 | - $handler->setExceptionHandler(function () use (&$args) { |
|
482 | + $handler->setExceptionHandler(function() use (&$args) { |
|
483 | 483 | $args = \func_get_args(); |
484 | 484 | }); |
485 | 485 | |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | public function testCustomExceptionHandler() |
496 | 496 | { |
497 | 497 | $handler = new ErrorHandler(); |
498 | - $handler->setExceptionHandler(function ($e) use ($handler) { |
|
498 | + $handler->setExceptionHandler(function($e) use ($handler) { |
|
499 | 499 | $handler->handleException($e); |
500 | 500 | }); |
501 | 501 |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | |
219 | 219 | $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); |
220 | 220 | |
221 | - $warnArgCheck = function ($logLevel, $message, $context) { |
|
221 | + $warnArgCheck = function ($logLevel, $message, $context){ |
|
222 | 222 | $this->assertEquals('info', $logLevel); |
223 | 223 | $this->assertEquals('User Deprecated: foo', $message); |
224 | 224 | $this->assertArrayHasKey('exception', $context); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); |
245 | 245 | |
246 | 246 | $line = null; |
247 | - $logArgCheck = function ($level, $message, $context) use (&$line) { |
|
247 | + $logArgCheck = function ($level, $message, $context) use (&$line){ |
|
248 | 248 | $this->assertEquals('Notice: Undefined variable: undefVar', $message); |
249 | 249 | $this->assertArrayHasKey('exception', $context); |
250 | 250 | $exception = $context['exception']; |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | |
304 | 304 | public function testHandleDeprecation() |
305 | 305 | { |
306 | - $logArgCheck = function ($level, $message, $context) { |
|
306 | + $logArgCheck = function ($level, $message, $context){ |
|
307 | 307 | $this->assertEquals(LogLevel::INFO, $level); |
308 | 308 | $this->assertArrayHasKey('exception', $context); |
309 | 309 | $exception = $context['exception']; |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); |
334 | 334 | |
335 | - $logArgCheck = function ($level, $message, $context) { |
|
335 | + $logArgCheck = function ($level, $message, $context){ |
|
336 | 336 | $this->assertSame('Uncaught Exception: foo', $message); |
337 | 337 | $this->assertArrayHasKey('exception', $context); |
338 | 338 | $this->assertInstanceOf(\Exception::class, $context['exception']); |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | $this->assertSame($exception, $e); |
354 | 354 | } |
355 | 355 | |
356 | - $handler->setExceptionHandler(function ($e) use ($exception) { |
|
356 | + $handler->setExceptionHandler(function ($e) use ($exception){ |
|
357 | 357 | $this->assertSame($exception, $e); |
358 | 358 | }); |
359 | 359 | |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | ->method('log') |
428 | 428 | ->with(LogLevel::CRITICAL, 'Uncaught Exception: Foo message', array('exception' => $exception)); |
429 | 429 | |
430 | - $handler->setExceptionHandler(function () use ($handler, $mockLogger) { |
|
430 | + $handler->setExceptionHandler(function () use ($handler, $mockLogger){ |
|
431 | 431 | $handler->setDefaultLogger($mockLogger); |
432 | 432 | }); |
433 | 433 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | |
449 | 449 | $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); |
450 | 450 | |
451 | - $logArgCheck = function ($level, $message, $context) { |
|
451 | + $logArgCheck = function ($level, $message, $context){ |
|
452 | 452 | $this->assertEquals('Fatal Parse Error: foo', $message); |
453 | 453 | $this->assertArrayHasKey('exception', $context); |
454 | 454 | $this->assertInstanceOf(\Exception::class, $context['exception']); |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | $exception = new \Error("Class 'Foo' not found"); |
480 | 480 | |
481 | 481 | $handler = new ErrorHandler(); |
482 | - $handler->setExceptionHandler(function () use (&$args) { |
|
482 | + $handler->setExceptionHandler(function () use (&$args){ |
|
483 | 483 | $args = \func_get_args(); |
484 | 484 | }); |
485 | 485 | |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | public function testCustomExceptionHandler() |
496 | 496 | { |
497 | 497 | $handler = new ErrorHandler(); |
498 | - $handler->setExceptionHandler(function ($e) use ($handler) { |
|
498 | + $handler->setExceptionHandler(function ($e) use ($handler){ |
|
499 | 499 | $handler->handleException($e); |
500 | 500 | }); |
501 | 501 |
@@ -12,8 +12,8 @@ |
||
12 | 12 | namespace Symfony\Component\Debug\Tests; |
13 | 13 | |
14 | 14 | use PHPUnit\Framework\TestCase; |
15 | -use Symfony\Component\Debug\Exception\OutOfMemoryException; |
|
16 | 15 | use Symfony\Component\Debug\ExceptionHandler; |
16 | +use Symfony\Component\Debug\Exception\OutOfMemoryException; |
|
17 | 17 | use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; |
18 | 18 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; |
19 | 19 |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | $handler->handle($exception); |
110 | 110 | |
111 | - $handler->setHandler(function ($e) use ($exception) { |
|
111 | + $handler->setHandler(function($e) use ($exception) { |
|
112 | 112 | $this->assertSame($exception, $e); |
113 | 113 | }); |
114 | 114 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | ->expects($this->once()) |
125 | 125 | ->method('sendPhpResponse'); |
126 | 126 | |
127 | - $handler->setHandler(function ($e) { |
|
127 | + $handler->setHandler(function($e){ |
|
128 | 128 | $this->fail('OutOfMemoryException should bypass the handler'); |
129 | 129 | }); |
130 | 130 |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | $handler->handle($exception); |
110 | 110 | |
111 | - $handler->setHandler(function ($e) use ($exception) { |
|
111 | + $handler->setHandler(function ($e) use ($exception){ |
|
112 | 112 | $this->assertSame($exception, $e); |
113 | 113 | }); |
114 | 114 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | ->expects($this->once()) |
125 | 125 | ->method('sendPhpResponse'); |
126 | 126 | |
127 | - $handler->setHandler(function ($e) { |
|
127 | + $handler->setHandler(function ($e){ |
|
128 | 128 | $this->fail('OutOfMemoryException should bypass the handler'); |
129 | 129 | }); |
130 | 130 |
@@ -558,7 +558,7 @@ |
||
558 | 558 | * |
559 | 559 | * This method implements the IteratorAggregate interface. |
560 | 560 | * |
561 | - * @return \Iterator|SplFileInfo[] An iterator |
|
561 | + * @return \Traversable An iterator |
|
562 | 562 | * |
563 | 563 | * @throws \LogicException if the in() method has not been called |
564 | 564 | */ |
@@ -64,7 +64,7 @@ |
||
64 | 64 | /** |
65 | 65 | * Same as IteratorTestCase::assertIterator with foreach usage. |
66 | 66 | * |
67 | - * @param array $expected |
|
67 | + * @param string[] $expected |
|
68 | 68 | * @param \Traversable $iterator |
69 | 69 | */ |
70 | 70 | protected function assertIteratorInForeach($expected, \Traversable $iterator) |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | { |
20 | 20 | // set iterator_to_array $use_key to false to avoid values merge |
21 | 21 | // this made FinderTest::testAppendWithAnArray() fail with GnuFinderAdapter |
22 | - $values = array_map(function (\SplFileInfo $fileinfo) { return str_replace('/', \DIRECTORY_SEPARATOR, $fileinfo->getPathname()); }, iterator_to_array($iterator, false)); |
|
22 | + $values = array_map(function(\SplFileInfo $fileinfo){ return str_replace('/', \DIRECTORY_SEPARATOR, $fileinfo->getPathname()); }, iterator_to_array($iterator, false)); |
|
23 | 23 | |
24 | - $expected = array_map(function ($path) { return str_replace('/', \DIRECTORY_SEPARATOR, $path); }, $expected); |
|
24 | + $expected = array_map(function($path){ return str_replace('/', \DIRECTORY_SEPARATOR, $path); }, $expected); |
|
25 | 25 | |
26 | 26 | sort($values); |
27 | 27 | sort($expected); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | protected function assertOrderedIterator($expected, \Traversable $iterator) |
33 | 33 | { |
34 | - $values = array_map(function (\SplFileInfo $fileinfo) { return $fileinfo->getPathname(); }, iterator_to_array($iterator)); |
|
34 | + $values = array_map(function(\SplFileInfo $fileinfo){ return $fileinfo->getPathname(); }, iterator_to_array($iterator)); |
|
35 | 35 | |
36 | 36 | $this->assertEquals($expected, array_values($values)); |
37 | 37 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | protected function assertOrderedIteratorForGroups($expected, \Traversable $iterator) |
50 | 50 | { |
51 | - $values = array_values(array_map(function (\SplFileInfo $fileinfo) { return $fileinfo->getPathname(); }, iterator_to_array($iterator))); |
|
51 | + $values = array_values(array_map(function(\SplFileInfo $fileinfo){ return $fileinfo->getPathname(); }, iterator_to_array($iterator))); |
|
52 | 52 | |
53 | 53 | foreach ($expected as $subarray) { |
54 | 54 | $temp = array(); |
@@ -16,26 +16,67 @@ discard block |
||
16 | 16 | define('MB_CASE_LOWER', 1); |
17 | 17 | define('MB_CASE_TITLE', 2); |
18 | 18 | |
19 | + /** |
|
20 | + * @return string |
|
21 | + */ |
|
19 | 22 | function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); } |
20 | 23 | function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); } |
24 | + |
|
25 | + /** |
|
26 | + * @param string $s |
|
27 | + * @param string $charset |
|
28 | + * @param string $transferEnc |
|
29 | + * @param string $lf |
|
30 | + */ |
|
21 | 31 | function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } |
22 | 32 | function mb_decode_numericentity($s, $convmap, $enc = null) { return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); } |
23 | 33 | function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) { return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); } |
34 | + |
|
35 | + /** |
|
36 | + * @param integer $mode |
|
37 | + * @param string $enc |
|
38 | + */ |
|
24 | 39 | function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); } |
25 | 40 | function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); } |
41 | + |
|
42 | + /** |
|
43 | + * @param string $lang |
|
44 | + */ |
|
26 | 45 | function mb_language($lang = null) { return p\Mbstring::mb_language($lang); } |
27 | 46 | function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } |
28 | 47 | function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } |
48 | + |
|
49 | + /** |
|
50 | + * @param string $var |
|
51 | + * @param string $encoding |
|
52 | + */ |
|
29 | 53 | function mb_check_encoding($var = null, $encoding = null) { return p\Mbstring::mb_check_encoding($var, $encoding); } |
30 | 54 | function mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); } |
31 | 55 | function mb_detect_order($encodingList = null) { return p\Mbstring::mb_detect_order($encodingList); } |
32 | 56 | function mb_parse_str($s, &$result = array()) { parse_str($s, $result); } |
57 | + |
|
58 | + /** |
|
59 | + * @return string |
|
60 | + */ |
|
33 | 61 | function mb_strlen($s, $enc = null) { return p\Mbstring::mb_strlen($s, $enc); } |
34 | 62 | function mb_strpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); } |
63 | + |
|
64 | + /** |
|
65 | + * @param string $enc |
|
66 | + */ |
|
35 | 67 | function mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); } |
68 | + |
|
69 | + /** |
|
70 | + * @param string $enc |
|
71 | + */ |
|
36 | 72 | function mb_strtoupper($s, $enc = null) { return p\Mbstring::mb_strtoupper($s, $enc); } |
37 | 73 | function mb_substitute_character($char = null) { return p\Mbstring::mb_substitute_character($char); } |
38 | 74 | function mb_substr($s, $start, $length = 2147483647, $enc = null) { return p\Mbstring::mb_substr($s, $start, $length, $enc); } |
75 | + |
|
76 | + /** |
|
77 | + * @param string $s |
|
78 | + * @param string $needle |
|
79 | + */ |
|
39 | 80 | function mb_stripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); } |
40 | 81 | function mb_stristr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_stristr($s, $needle, $part, $enc); } |
41 | 82 | function mb_strrchr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); } |
@@ -49,6 +90,10 @@ discard block |
||
49 | 90 | function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); } |
50 | 91 | function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); } |
51 | 92 | function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); } |
93 | + |
|
94 | + /** |
|
95 | + * @param string $fromEncoding |
|
96 | + */ |
|
52 | 97 | function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); } |
53 | 98 | } |
54 | 99 | if (!function_exists('mb_chr')) { |
@@ -16,43 +16,43 @@ |
||
16 | 16 | define('MB_CASE_LOWER', 1); |
17 | 17 | define('MB_CASE_TITLE', 2); |
18 | 18 | |
19 | - function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); } |
|
20 | - function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); } |
|
21 | - function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } |
|
22 | - function mb_decode_numericentity($s, $convmap, $enc = null) { return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); } |
|
23 | - function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) { return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); } |
|
24 | - function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); } |
|
25 | - function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); } |
|
26 | - function mb_language($lang = null) { return p\Mbstring::mb_language($lang); } |
|
27 | - function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } |
|
28 | - function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } |
|
29 | - function mb_check_encoding($var = null, $encoding = null) { return p\Mbstring::mb_check_encoding($var, $encoding); } |
|
30 | - function mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); } |
|
31 | - function mb_detect_order($encodingList = null) { return p\Mbstring::mb_detect_order($encodingList); } |
|
32 | - function mb_parse_str($s, &$result = array()) { parse_str($s, $result); } |
|
33 | - function mb_strlen($s, $enc = null) { return p\Mbstring::mb_strlen($s, $enc); } |
|
34 | - function mb_strpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); } |
|
35 | - function mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); } |
|
36 | - function mb_strtoupper($s, $enc = null) { return p\Mbstring::mb_strtoupper($s, $enc); } |
|
37 | - function mb_substitute_character($char = null) { return p\Mbstring::mb_substitute_character($char); } |
|
38 | - function mb_substr($s, $start, $length = 2147483647, $enc = null) { return p\Mbstring::mb_substr($s, $start, $length, $enc); } |
|
39 | - function mb_stripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); } |
|
40 | - function mb_stristr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_stristr($s, $needle, $part, $enc); } |
|
41 | - function mb_strrchr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); } |
|
42 | - function mb_strrichr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); } |
|
43 | - function mb_strripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); } |
|
44 | - function mb_strrpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); } |
|
45 | - function mb_strstr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strstr($s, $needle, $part, $enc); } |
|
46 | - function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } |
|
47 | - function mb_http_output($enc = null) { return p\Mbstring::mb_http_output($enc); } |
|
48 | - function mb_strwidth($s, $enc = null) { return p\Mbstring::mb_strwidth($s, $enc); } |
|
49 | - function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); } |
|
50 | - function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); } |
|
51 | - function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); } |
|
52 | - function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); } |
|
19 | + function mb_convert_encoding($s, $to, $from = null){ return p\Mbstring::mb_convert_encoding($s, $to, $from); } |
|
20 | + function mb_decode_mimeheader($s){ return p\Mbstring::mb_decode_mimeheader($s); } |
|
21 | + function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null){ return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } |
|
22 | + function mb_decode_numericentity($s, $convmap, $enc = null){ return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); } |
|
23 | + function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false){ return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); } |
|
24 | + function mb_convert_case($s, $mode, $enc = null){ return p\Mbstring::mb_convert_case($s, $mode, $enc); } |
|
25 | + function mb_internal_encoding($enc = null){ return p\Mbstring::mb_internal_encoding($enc); } |
|
26 | + function mb_language($lang = null){ return p\Mbstring::mb_language($lang); } |
|
27 | + function mb_list_encodings(){ return p\Mbstring::mb_list_encodings(); } |
|
28 | + function mb_encoding_aliases($encoding){ return p\Mbstring::mb_encoding_aliases($encoding); } |
|
29 | + function mb_check_encoding($var = null, $encoding = null){ return p\Mbstring::mb_check_encoding($var, $encoding); } |
|
30 | + function mb_detect_encoding($str, $encodingList = null, $strict = false){ return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); } |
|
31 | + function mb_detect_order($encodingList = null){ return p\Mbstring::mb_detect_order($encodingList); } |
|
32 | + function mb_parse_str($s, &$result = array()){ parse_str($s, $result); } |
|
33 | + function mb_strlen($s, $enc = null){ return p\Mbstring::mb_strlen($s, $enc); } |
|
34 | + function mb_strpos($s, $needle, $offset = 0, $enc = null){ return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); } |
|
35 | + function mb_strtolower($s, $enc = null){ return p\Mbstring::mb_strtolower($s, $enc); } |
|
36 | + function mb_strtoupper($s, $enc = null){ return p\Mbstring::mb_strtoupper($s, $enc); } |
|
37 | + function mb_substitute_character($char = null){ return p\Mbstring::mb_substitute_character($char); } |
|
38 | + function mb_substr($s, $start, $length = 2147483647, $enc = null){ return p\Mbstring::mb_substr($s, $start, $length, $enc); } |
|
39 | + function mb_stripos($s, $needle, $offset = 0, $enc = null){ return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); } |
|
40 | + function mb_stristr($s, $needle, $part = false, $enc = null){ return p\Mbstring::mb_stristr($s, $needle, $part, $enc); } |
|
41 | + function mb_strrchr($s, $needle, $part = false, $enc = null){ return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); } |
|
42 | + function mb_strrichr($s, $needle, $part = false, $enc = null){ return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); } |
|
43 | + function mb_strripos($s, $needle, $offset = 0, $enc = null){ return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); } |
|
44 | + function mb_strrpos($s, $needle, $offset = 0, $enc = null){ return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); } |
|
45 | + function mb_strstr($s, $needle, $part = false, $enc = null){ return p\Mbstring::mb_strstr($s, $needle, $part, $enc); } |
|
46 | + function mb_get_info($type = 'all'){ return p\Mbstring::mb_get_info($type); } |
|
47 | + function mb_http_output($enc = null){ return p\Mbstring::mb_http_output($enc); } |
|
48 | + function mb_strwidth($s, $enc = null){ return p\Mbstring::mb_strwidth($s, $enc); } |
|
49 | + function mb_substr_count($haystack, $needle, $enc = null){ return p\Mbstring::mb_substr_count($haystack, $needle, $enc); } |
|
50 | + function mb_output_handler($contents, $status){ return p\Mbstring::mb_output_handler($contents, $status); } |
|
51 | + function mb_http_input($type = ''){ return p\Mbstring::mb_http_input($type); } |
|
52 | + function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null){ return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); } |
|
53 | 53 | } |
54 | 54 | if (!function_exists('mb_chr')) { |
55 | - function mb_ord($s, $enc = null) { return p\Mbstring::mb_ord($s, $enc); } |
|
56 | - function mb_chr($code, $enc = null) { return p\Mbstring::mb_chr($code, $enc); } |
|
57 | - function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); } |
|
55 | + function mb_ord($s, $enc = null){ return p\Mbstring::mb_ord($s, $enc); } |
|
56 | + function mb_chr($code, $enc = null){ return p\Mbstring::mb_chr($code, $enc); } |
|
57 | + function mb_scrub($s, $enc = null){ $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); } |
|
58 | 58 | } |
@@ -16,43 +16,117 @@ |
||
16 | 16 | define('MB_CASE_LOWER', 1); |
17 | 17 | define('MB_CASE_TITLE', 2); |
18 | 18 | |
19 | - function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); } |
|
20 | - function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); } |
|
21 | - function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } |
|
22 | - function mb_decode_numericentity($s, $convmap, $enc = null) { return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); } |
|
23 | - function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) { return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); } |
|
24 | - function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); } |
|
25 | - function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); } |
|
26 | - function mb_language($lang = null) { return p\Mbstring::mb_language($lang); } |
|
27 | - function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } |
|
28 | - function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } |
|
29 | - function mb_check_encoding($var = null, $encoding = null) { return p\Mbstring::mb_check_encoding($var, $encoding); } |
|
30 | - function mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); } |
|
31 | - function mb_detect_order($encodingList = null) { return p\Mbstring::mb_detect_order($encodingList); } |
|
32 | - function mb_parse_str($s, &$result = array()) { parse_str($s, $result); } |
|
33 | - function mb_strlen($s, $enc = null) { return p\Mbstring::mb_strlen($s, $enc); } |
|
34 | - function mb_strpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); } |
|
35 | - function mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); } |
|
36 | - function mb_strtoupper($s, $enc = null) { return p\Mbstring::mb_strtoupper($s, $enc); } |
|
37 | - function mb_substitute_character($char = null) { return p\Mbstring::mb_substitute_character($char); } |
|
38 | - function mb_substr($s, $start, $length = 2147483647, $enc = null) { return p\Mbstring::mb_substr($s, $start, $length, $enc); } |
|
39 | - function mb_stripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); } |
|
40 | - function mb_stristr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_stristr($s, $needle, $part, $enc); } |
|
41 | - function mb_strrchr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); } |
|
42 | - function mb_strrichr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); } |
|
43 | - function mb_strripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); } |
|
44 | - function mb_strrpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); } |
|
45 | - function mb_strstr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strstr($s, $needle, $part, $enc); } |
|
46 | - function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } |
|
47 | - function mb_http_output($enc = null) { return p\Mbstring::mb_http_output($enc); } |
|
48 | - function mb_strwidth($s, $enc = null) { return p\Mbstring::mb_strwidth($s, $enc); } |
|
49 | - function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); } |
|
50 | - function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); } |
|
51 | - function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); } |
|
52 | - function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); } |
|
19 | + function mb_convert_encoding($s, $to, $from = null) |
|
20 | + { |
|
21 | +return p\Mbstring::mb_convert_encoding($s, $to, $from); } |
|
22 | + function mb_decode_mimeheader($s) |
|
23 | + { |
|
24 | +return p\Mbstring::mb_decode_mimeheader($s); } |
|
25 | + function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) |
|
26 | + { |
|
27 | +return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } |
|
28 | + function mb_decode_numericentity($s, $convmap, $enc = null) |
|
29 | + { |
|
30 | +return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); } |
|
31 | + function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) |
|
32 | + { |
|
33 | +return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); } |
|
34 | + function mb_convert_case($s, $mode, $enc = null) |
|
35 | + { |
|
36 | +return p\Mbstring::mb_convert_case($s, $mode, $enc); } |
|
37 | + function mb_internal_encoding($enc = null) |
|
38 | + { |
|
39 | +return p\Mbstring::mb_internal_encoding($enc); } |
|
40 | + function mb_language($lang = null) |
|
41 | + { |
|
42 | +return p\Mbstring::mb_language($lang); } |
|
43 | + function mb_list_encodings() |
|
44 | + { |
|
45 | +return p\Mbstring::mb_list_encodings(); } |
|
46 | + function mb_encoding_aliases($encoding) |
|
47 | + { |
|
48 | +return p\Mbstring::mb_encoding_aliases($encoding); } |
|
49 | + function mb_check_encoding($var = null, $encoding = null) |
|
50 | + { |
|
51 | +return p\Mbstring::mb_check_encoding($var, $encoding); } |
|
52 | + function mb_detect_encoding($str, $encodingList = null, $strict = false) |
|
53 | + { |
|
54 | +return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); } |
|
55 | + function mb_detect_order($encodingList = null) |
|
56 | + { |
|
57 | +return p\Mbstring::mb_detect_order($encodingList); } |
|
58 | + function mb_parse_str($s, &$result = array()) |
|
59 | + { |
|
60 | +parse_str($s, $result); } |
|
61 | + function mb_strlen($s, $enc = null) |
|
62 | + { |
|
63 | +return p\Mbstring::mb_strlen($s, $enc); } |
|
64 | + function mb_strpos($s, $needle, $offset = 0, $enc = null) |
|
65 | + { |
|
66 | +return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); } |
|
67 | + function mb_strtolower($s, $enc = null) |
|
68 | + { |
|
69 | +return p\Mbstring::mb_strtolower($s, $enc); } |
|
70 | + function mb_strtoupper($s, $enc = null) |
|
71 | + { |
|
72 | +return p\Mbstring::mb_strtoupper($s, $enc); } |
|
73 | + function mb_substitute_character($char = null) |
|
74 | + { |
|
75 | +return p\Mbstring::mb_substitute_character($char); } |
|
76 | + function mb_substr($s, $start, $length = 2147483647, $enc = null) |
|
77 | + { |
|
78 | +return p\Mbstring::mb_substr($s, $start, $length, $enc); } |
|
79 | + function mb_stripos($s, $needle, $offset = 0, $enc = null) |
|
80 | + { |
|
81 | +return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); } |
|
82 | + function mb_stristr($s, $needle, $part = false, $enc = null) |
|
83 | + { |
|
84 | +return p\Mbstring::mb_stristr($s, $needle, $part, $enc); } |
|
85 | + function mb_strrchr($s, $needle, $part = false, $enc = null) |
|
86 | + { |
|
87 | +return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); } |
|
88 | + function mb_strrichr($s, $needle, $part = false, $enc = null) |
|
89 | + { |
|
90 | +return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); } |
|
91 | + function mb_strripos($s, $needle, $offset = 0, $enc = null) |
|
92 | + { |
|
93 | +return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); } |
|
94 | + function mb_strrpos($s, $needle, $offset = 0, $enc = null) |
|
95 | + { |
|
96 | +return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); } |
|
97 | + function mb_strstr($s, $needle, $part = false, $enc = null) |
|
98 | + { |
|
99 | +return p\Mbstring::mb_strstr($s, $needle, $part, $enc); } |
|
100 | + function mb_get_info($type = 'all') |
|
101 | + { |
|
102 | +return p\Mbstring::mb_get_info($type); } |
|
103 | + function mb_http_output($enc = null) |
|
104 | + { |
|
105 | +return p\Mbstring::mb_http_output($enc); } |
|
106 | + function mb_strwidth($s, $enc = null) |
|
107 | + { |
|
108 | +return p\Mbstring::mb_strwidth($s, $enc); } |
|
109 | + function mb_substr_count($haystack, $needle, $enc = null) |
|
110 | + { |
|
111 | +return p\Mbstring::mb_substr_count($haystack, $needle, $enc); } |
|
112 | + function mb_output_handler($contents, $status) |
|
113 | + { |
|
114 | +return p\Mbstring::mb_output_handler($contents, $status); } |
|
115 | + function mb_http_input($type = '') |
|
116 | + { |
|
117 | +return p\Mbstring::mb_http_input($type); } |
|
118 | + function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) |
|
119 | + { |
|
120 | +return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); } |
|
53 | 121 | } |
54 | 122 | if (!function_exists('mb_chr')) { |
55 | - function mb_ord($s, $enc = null) { return p\Mbstring::mb_ord($s, $enc); } |
|
56 | - function mb_chr($code, $enc = null) { return p\Mbstring::mb_chr($code, $enc); } |
|
57 | - function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); } |
|
123 | + function mb_ord($s, $enc = null) |
|
124 | + { |
|
125 | +return p\Mbstring::mb_ord($s, $enc); } |
|
126 | + function mb_chr($code, $enc = null) |
|
127 | + { |
|
128 | +return p\Mbstring::mb_chr($code, $enc); } |
|
129 | + function mb_scrub($s, $enc = null) |
|
130 | + { |
|
131 | +$enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); } |
|
58 | 132 | } |
@@ -408,6 +408,9 @@ discard block |
||
408 | 408 | return self::mb_detect_encoding($var, array($encoding)) || false !== @iconv($encoding, $encoding, $var); |
409 | 409 | } |
410 | 410 | |
411 | + /** |
|
412 | + * @return string |
|
413 | + */ |
|
411 | 414 | public static function mb_detect_encoding($str, $encodingList = null, $strict = false) |
412 | 415 | { |
413 | 416 | if (null === $encodingList) { |
@@ -729,6 +732,9 @@ discard block |
||
729 | 732 | return $code; |
730 | 733 | } |
731 | 734 | |
735 | + /** |
|
736 | + * @param boolean $part |
|
737 | + */ |
|
732 | 738 | private static function getSubpart($pos, $part, $haystack, $encoding) |
733 | 739 | { |
734 | 740 | if (false === $pos) { |
@@ -771,6 +777,9 @@ discard block |
||
771 | 777 | return self::mb_convert_case($s[1], MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], MB_CASE_LOWER, 'UTF-8'); |
772 | 778 | } |
773 | 779 | |
780 | + /** |
|
781 | + * @param string $file |
|
782 | + */ |
|
774 | 783 | private static function getData($file) |
775 | 784 | { |
776 | 785 | if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | private static $internalEncoding = 'UTF-8'; |
74 | 74 | private static $caseFold = array( |
75 | 75 | array('µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"), |
76 | - array('μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'), |
|
76 | + array('μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'), |
|
77 | 77 | ); |
78 | 78 | |
79 | 79 | public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $vars = array(&$a, &$b, &$c, &$d, &$e, &$f); |
120 | 120 | |
121 | 121 | $ok = true; |
122 | - array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { |
|
122 | + array_walk_recursive($vars, function(&$v) use (&$ok, $toEncoding, $fromEncoding) { |
|
123 | 123 | if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { |
124 | 124 | $ok = false; |
125 | 125 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | if (null !== $encoding && !\is_scalar($encoding)) { |
154 | 154 | trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING); |
155 | 155 | |
156 | - return ''; // Instead of null (cf. mb_encode_numericentity). |
|
156 | + return ''; // Instead of null (cf. mb_encode_numericentity). |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | $s = (string) $s; |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $convmap[$i + 1] += $convmap[$i + 2]; |
181 | 181 | } |
182 | 182 | |
183 | - $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { |
|
183 | + $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function(array $m) use ($cnt, $convmap) { |
|
184 | 184 | $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; |
185 | 185 | for ($i = 0; $i < $cnt; $i += 4) { |
186 | 186 | if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | if (null !== $encoding && !\is_scalar($encoding)) { |
214 | 214 | trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING); |
215 | 215 | |
216 | - return null; // Instead of '' (cf. mb_decode_numericentity). |
|
216 | + return null; // Instead of '' (cf. mb_decode_numericentity). |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | if (null !== $is_hex && !\is_scalar($is_hex)) { |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $vars = array(&$a, &$b, &$c, &$d, &$e, &$f); |
120 | 120 | |
121 | 121 | $ok = true; |
122 | - array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { |
|
122 | + array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding){ |
|
123 | 123 | if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { |
124 | 124 | $ok = false; |
125 | 125 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $convmap[$i + 1] += $convmap[$i + 2]; |
181 | 181 | } |
182 | 182 | |
183 | - $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { |
|
183 | + $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap){ |
|
184 | 184 | $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; |
185 | 185 | for ($i = 0; $i < $cnt; $i += 4) { |
186 | 186 | if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { |
@@ -100,6 +100,9 @@ |
||
100 | 100 | return $this->display($io, $filesInfo); |
101 | 101 | } |
102 | 102 | |
103 | + /** |
|
104 | + * @param string $content |
|
105 | + */ |
|
103 | 106 | private function validate($content, $file = null) |
104 | 107 | { |
105 | 108 | $errors = array(); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | } elseif (!$info['valid']) { |
166 | 166 | ++$erroredFiles; |
167 | 167 | $io->text('<error> ERROR </error>'.($info['file'] ? sprintf(' in %s', $info['file']) : '')); |
168 | - $io->listing(array_map(function ($error) { |
|
168 | + $io->listing(array_map(function($error){ |
|
169 | 169 | // general document errors have a '-1' line number |
170 | 170 | return -1 === $error['line'] ? $error['message'] : sprintf('Line %d, Column %d: %s', $error['line'], $error['column'], $error['message']); |
171 | 171 | }, $info['messages'])); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | { |
186 | 186 | $errors = 0; |
187 | 187 | |
188 | - array_walk($filesInfo, function (&$v) use (&$errors) { |
|
188 | + array_walk($filesInfo, function(&$v) use (&$errors) { |
|
189 | 189 | $v['file'] = (string) $v['file']; |
190 | 190 | if (!$v['valid']) { |
191 | 191 | ++$errors; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | private function getDirectoryIterator($directory) |
232 | 232 | { |
233 | - $default = function ($directory) { |
|
233 | + $default = function($directory){ |
|
234 | 234 | return new \RecursiveIteratorIterator( |
235 | 235 | new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), |
236 | 236 | \RecursiveIteratorIterator::LEAVES_ONLY |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | |
247 | 247 | private function isReadable($fileOrDirectory) |
248 | 248 | { |
249 | - $default = function ($fileOrDirectory) { |
|
249 | + $default = function($fileOrDirectory){ |
|
250 | 250 | return is_readable($fileOrDirectory); |
251 | 251 | }; |
252 | 252 |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | } elseif (!$info['valid']) { |
166 | 166 | ++$erroredFiles; |
167 | 167 | $io->text('<error> ERROR </error>'.($info['file'] ? sprintf(' in %s', $info['file']) : '')); |
168 | - $io->listing(array_map(function ($error) { |
|
168 | + $io->listing(array_map(function ($error){ |
|
169 | 169 | // general document errors have a '-1' line number |
170 | 170 | return -1 === $error['line'] ? $error['message'] : sprintf('Line %d, Column %d: %s', $error['line'], $error['column'], $error['message']); |
171 | 171 | }, $info['messages'])); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | { |
186 | 186 | $errors = 0; |
187 | 187 | |
188 | - array_walk($filesInfo, function (&$v) use (&$errors) { |
|
188 | + array_walk($filesInfo, function (&$v) use (&$errors){ |
|
189 | 189 | $v['file'] = (string) $v['file']; |
190 | 190 | if (!$v['valid']) { |
191 | 191 | ++$errors; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | private function getDirectoryIterator($directory) |
232 | 232 | { |
233 | - $default = function ($directory) { |
|
233 | + $default = function ($directory){ |
|
234 | 234 | return new \RecursiveIteratorIterator( |
235 | 235 | new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), |
236 | 236 | \RecursiveIteratorIterator::LEAVES_ONLY |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | |
247 | 247 | private function isReadable($fileOrDirectory) |
248 | 248 | { |
249 | - $default = function ($fileOrDirectory) { |
|
249 | + $default = function ($fileOrDirectory){ |
|
250 | 250 | return is_readable($fileOrDirectory); |
251 | 251 | }; |
252 | 252 |
@@ -68,7 +68,7 @@ |
||
68 | 68 | <info>php %command.full_name% dirname</info> |
69 | 69 | <info>php %command.full_name% dirname --format=json</info> |
70 | 70 | |
71 | -EOF |
|
71 | +eof |
|
72 | 72 | ) |
73 | 73 | ; |
74 | 74 | } |