1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Add checkable return type for Generator

This commit is contained in:
Matthew Brown 2016-10-20 11:31:39 -04:00
parent 23529a6f70
commit 74abadf6c7

View File

@ -30,6 +30,12 @@ class Php55Test extends PHPUnit_Framework_TestCase
public function testGenerator()
{
$stmts = self::$_parser->parse('<?php
/**
* @param int $start
* @param int $limit
* @param int $step
* @return int[]
*/
function xrange($start, $limit, $step = 1) {
for ($i = $start; $i <= $limit; $i += $step) {
yield $i;