[RFC] support for generators #115

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@docteurklein
Contributor

docteurklein commented Jul 21, 2014

I'm not even sure if this couldn't be applied to Iterators in general, or if it's the correct approach, but at least it resolves parts of the problem of phpspec/phpspec#379.

Also, custom phpspec matchers have to be used in order to check array like stuff.

@docteurklein docteurklein referenced this pull request in phpspec/phpspec Jul 21, 2014

Closed

Add support for php 5.5 generators #379

+ }
+
+ /**
+ * Forces class to implement Iterator interface.

This comment has been minimized.

@docteurklein

docteurklein Jul 22, 2014

Contributor

wrong description. yes, I comment my own pr :)

@docteurklein

docteurklein Jul 22, 2014

Contributor

wrong description. yes, I comment my own pr :)

This comment has been minimized.

@jakzal

jakzal Jul 22, 2014

Member

achievement unlocked ;)

@jakzal

jakzal Jul 22, 2014

Member

achievement unlocked ;)

+ */
+ public function getPriority()
+ {
+ return 200;

This comment has been minimized.

@docteurklein

docteurklein Jul 22, 2014

Contributor

100 should be enough, no ?

@docteurklein

docteurklein Jul 22, 2014

Contributor

100 should be enough, no ?

+use PhpSpec\ObjectBehavior;
+use Prophecy\Argument;
+
+class GeneratorPatchSpec extends ObjectBehavior

This comment has been minimized.

@stof

stof Aug 4, 2014

Member

This spec needs to be skipped on PHP 5.4 and older (as there is no generator there)

@stof

stof Aug 4, 2014

Member

This spec needs to be skipped on PHP 5.4 and older (as there is no generator there)

@stof

This comment has been minimized.

Show comment
Hide comment
@stof

stof Aug 4, 2014

Member

The patch is not registered currently

Member

stof commented Aug 4, 2014

The patch is not registered currently

@docteurklein

This comment has been minimized.

Show comment
Hide comment
@docteurklein

docteurklein Aug 4, 2014

Contributor

As stated in phpspec/phpspec#379, this patch seems useless. Or it would be useful only if a class extends (or is) a Generator.

Contributor

docteurklein commented Aug 4, 2014

As stated in phpspec/phpspec#379, this patch seems useless. Or it would be useful only if a class extends (or is) a Generator.

@docteurklein

This comment has been minimized.

Show comment
Hide comment
@docteurklein

docteurklein Aug 4, 2014

Contributor

Something we could do though, is to generalize array_* matchers to accept iterators, ArrayAccess, Traversable and the like.

Contributor

docteurklein commented Aug 4, 2014

Something we could do though, is to generalize array_* matchers to accept iterators, ArrayAccess, Traversable and the like.

@docteurklein

This comment has been minimized.

Show comment
Hide comment
@docteurklein

docteurklein Aug 16, 2014

Contributor

clsing for now, as this is useless.

Contributor

docteurklein commented Aug 16, 2014

clsing for now, as this is useless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment