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

Fixes issue #4747 - FileGenerator now properly generates files. #6302

Closed
wants to merge 4 commits into from

Conversation

steverhoades
Copy link
Contributor

This class appears to be very fragile and fragmented in terms of how it works. My guess is that there are edge cases that aren't covered in the unit tests.

I have added 2 new tokens for namespace and uses as well as a duplicate check on uses. In addition the fromReflection method no longer attempts to build the body as this is done via the generate method.

@steverhoades
Copy link
Contributor Author

It appears there is another random unit test failure not associated to the code change.

@steverhoades
Copy link
Contributor Author

I just want to note also that the setBody and getBody methods are kind of confusing for this class. In reality it is used to append to the content of the file.

See: https://github.com/steverhoades/zf2/blob/86f5f8f24e170f179a3267a17d41aea6b2c807bf/library/Zend/Code/Generator/FileGenerator.php#L368-L384

@Ocramius Ocramius self-assigned this Jul 28, 2014
@Ocramius Ocramius added this to the 2.3.2 milestone Jul 28, 2014
@Ocramius
Copy link
Member

Linking #4747

Ocramius added a commit that referenced this pull request Jul 28, 2014
@Ocramius Ocramius closed this in 9c136f0 Jul 28, 2014
@Ocramius
Copy link
Member

Merged, thanks!

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

Successfully merging this pull request may close these issues.

2 participants