Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Use Reflection\FileReflection without including file? #71

Open
RSully opened this issue Jun 27, 2016 · 2 comments
Open

Use Reflection\FileReflection without including file? #71

RSully opened this issue Jun 27, 2016 · 2 comments

Comments

@RSully
Copy link

RSully commented Jun 27, 2016

From zendframework/zendframework#6860 which was just closed:

It looks like FileReflection uses token_get_all(file_get_contents($file)) to actually scan the file, so I am a little lost by the requirement of includeing it.

I am trying to fix some PHP classes programmatically, all of which have the same class name in the global namespace. To do this I was planning to reflect the files, get the class reflection, and instantiate the class generator from that to make my changes. Of course, since reflecting the file requires including it, I cannot do this right now, as it would have to re-declare the classes.

/cc @sasezaki @adamlundrigan who had activity on previous issue

@RSully
Copy link
Author

RSully commented Jun 27, 2016

updated link to code at this new repo:

'File %s must be required before it can be reflected',

@RSully RSully changed the title Use Zend\Code\Reflection\FileReflection without including file? Use Reflection\FileReflection without including file? Jun 27, 2016
@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-code; a new issue has been opened at laminas/laminas-code#25.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants