mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 12:55:26 +01:00
37 lines
931 B
PHP
37 lines
931 B
PHP
<?php
|
|
namespace Psalm\Tests;
|
|
|
|
class ForTest extends TestCase
|
|
{
|
|
use Traits\FileCheckerValidCodeParseTestTrait;
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function providerFileCheckerValidCodeParse()
|
|
{
|
|
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;',
|
|
],
|
|
];
|
|
}
|
|
}
|