1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00
psalm/tests/ForTest.php

37 lines
931 B
PHP
Raw Normal View History

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