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;
|
|
|
|
}
|
|
|
|
}'
|
|
|
|
],
|
|
|
|
'echoAfterFor' => [
|
|
|
|
'<?php
|
|
|
|
for ($i = 0; $i < 5; $i++);
|
|
|
|
echo $i;'
|
|
|
|
]
|
|
|
|
];
|
2017-04-11 23:43:46 +02:00
|
|
|
}
|
2017-01-19 23:45:42 +01:00
|
|
|
}
|