2017-01-19 23:45:42 +01:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Tests;
|
|
|
|
|
2017-04-25 05:45:02 +02:00
|
|
|
class ForTest extends TestCase
|
2017-01-19 23:45:42 +01:00
|
|
|
{
|
2017-04-25 05:45:02 +02:00
|
|
|
use Traits\FileCheckerValidCodeParseTestTrait;
|
2017-01-19 23:45:42 +01:00
|
|
|
|
|
|
|
/**
|
2017-04-25 05:45:02 +02:00
|
|
|
* @return array
|
2017-01-19 23:45:42 +01:00
|
|
|
*/
|
2017-04-25 05:45:02 +02:00
|
|
|
public function providerFileCheckerValidCodeParse()
|
2017-01-19 23:45:42 +01:00
|
|
|
{
|
2017-04-25 05:45:02 +02:00
|
|
|
return [
|
|
|
|
'continueOutsideLoop' => [
|
|
|
|
'<?php
|
|
|
|
class Node {
|
|
|
|
/** @var Node|null */
|
|
|
|
public $next;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @return void */
|
|
|
|
function test(Node $head) {
|
|
|
|
for ($node = $head; $node; $node = $next) {
|
|
|
|
$next = $node->next;
|
|
|
|
$node->next = null;
|
|
|
|
}
|
2017-05-27 02:05:57 +02:00
|
|
|
}',
|
2017-04-25 05:45:02 +02:00
|
|
|
],
|
|
|
|
'echoAfterFor' => [
|
|
|
|
'<?php
|
|
|
|
for ($i = 0; $i < 5; $i++);
|
2017-05-27 02:05:57 +02:00
|
|
|
echo $i;',
|
|
|
|
],
|
2017-04-25 05:45:02 +02:00
|
|
|
];
|
2017-04-11 23:43:46 +02:00
|
|
|
}
|
2017-01-19 23:45:42 +01:00
|
|
|
}
|