Factory vs Extractor for source loading
masterThere are two ways to build objects from existing code, depending on whether you need access to method bodies or default values:
Factory: Uses reflection only. It does not perform I/O or requirenikic/php-parser. It is fast but cannot access method bodies or parameter defaults.Extractor: Parses source code usingnikic/php-parser. It is required when you need to access bodies or defaults. You must explicitly opt-in using.withBodies(). Ifphp-parseris not installed, theExtractorconstructor will throw aNotSupportedException.
Warning on Member Relocation: When using ClassManipulator::inheritMethod() or implement(), the library copies members without rewriting types or bodies. Because self, static, and parent are kept verbatim, they may silently refer to the wrong class in the new context.