Skip to content

Internal class reflections#80

Merged
Ocramius merged 30 commits intomasterfrom
internal-class-reflections
Jul 22, 2015
Merged

Internal class reflections#80
Ocramius merged 30 commits intomasterfrom
internal-class-reflections

Conversation

@asgrim
Copy link
Copy Markdown
Member

@asgrim asgrim commented Jul 20, 2015

This PR fixes #38

  • AggregateSourceLocators can be nested now (Reflector\Generic will recurse through them in a flat ordered way)
  • I had to modify the behaviour of the SourceLocators slightly so that they don't throw exceptions, but merely return null. This is so that when we loop through the AggregateSourceLocator, we don't break the loop.
  • By default PhpInternalSourceLocator gets added to all calls to reflect(). Can be disabled by a paramter
  • A new magic const is defined as a flag to notify ReflectionClass that the LocatedSource originated from the PhpInternalSourceLocator (thus isInternal() === true)

Todo

  • Needs the rest of the internal classes implemented...
  • ~~~Need to implement functions too...~~~
  • More path coverage for PhpInternalSourceLocator

@asgrim asgrim self-assigned this Jul 20, 2015
@asgrim asgrim added this to the 1.0.0 milestone Jul 20, 2015
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just if ($sourceLocator instanceof Traversable) {?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'cuz AggregateSourceLocator is not Traversable?

@Ocramius Ocramius changed the title [WIP] Internal class reflections Internal class reflections Jul 22, 2015
Ocramius added a commit that referenced this pull request Jul 22, 2015
@Ocramius Ocramius merged commit a5bcb25 into master Jul 22, 2015
@Ocramius Ocramius deleted the internal-class-reflections branch July 22, 2015 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create ReflectionFunctions/ReflectionClasses from internal definitions

2 participants