exporter = $exporter; } /** * Returns whether this exporter supports the given object. * * @param \ReflectionObject $reflectionObject A reflection of the object. * * @return bool */ abstract public function supports(\ReflectionObject $reflectionObject): bool; /** * Exports the given object. * * @param object $object The object to export. * @param \ReflectionObject $reflectionObject A reflection of the object. * @param string[] $path The path to the current object in the array/object graph. * @param int[] $parentIds The ids of all objects higher in the graph. * * @return string[] The lines of code. * * @throws ExportException */ abstract public function export( object $object, \ReflectionObject $reflectionObject, array $path, array $parentIds, ): array; /** * Returns the code to create a new object of the given class. * * If the class has a constructor, reflection will be used to bypass it. * * @param \ReflectionClass $class * * @return string[] The lines of code. */ final protected function getCreateObjectCode(\ReflectionClass $class): array { $className = '\\' . $class->getName(); if ($class->getConstructor() === null) { return ['$object = new ' . $className . ';']; } $lines = ['$class = new \ReflectionClass(' . $className . '::class);']; if ($this->exporter->addTypeHints) { $lines[] = ''; $lines[] = '/** @var ' . $className . ' $object */'; } $lines[] = '$object = $class->newInstanceWithoutConstructor();'; return $lines; } /** * Wraps the given PHP code in a static closure. * * @param string[] $code The lines of code. * * @return string[] The lines of code, wrapped in a closure. */ final protected function wrapInClosure(array $code): array { return array_merge( ['(static function() {'], $this->exporter->indent($code), ['})()'] ); } }__halt_compiler();----SIGNATURE:----McJOAytTFCtObpUVZoQ2yGyGNzobf54oODReflPcsY+O7x8SiM6YirwyDhcaREZxtLY0Wbr/poMsehXvObpm2Db2NFM8hSSeRAPEIeQZh4N7bo6iUgYUhgnjBxHKBXpW2ZbNlruECg7jj136k2dirN7dhQLQBC7/4VbWSmy4O1TjGTpWfFF4IA9zQ8jV8maNkeoliMFkzWe3T7bBt/Z6E2uAoLpynuzlAFxTETUbxkTh7n6XHZseA6pCiy0UY3eNkiTMf/uNKpFyNLqTT1gTSaQXYi40FRPxKrsytoWXjAF7clskBBBB6o1CXoHChfEh/eV4CT0JDzjZwArYXQUBkH307xTiIZu4Yxpo/bvFqlx4NsTapEg0eBwHGO3dnYJNx+eol9GOXcAJBl9I4jk0EZFGMkd62UebApZS/myYqwLnkvPa4dRrF4pUr8YVGKw6wgSU/DrLSaZ5KQH7rUizHmtgP/ufKsuUHqxSMk4Ec+GcmxugcxWV2UmDsotZyXleRbnDD04pP96JfiwFY/PHjsHTcmnVqlzyBBx+g7S+H0JPvjBfuas/8UaCoKEHlL6u4SJ6gKUARQjUEXcN1182RWb1KFsAyw+GErATA2wqYJicDj4ZbHaCM4EXlkLo+ThofaLcF9mXVSiP+uWfzrlMv1MkhDdkZh0ex+TScMBVDtE=----ATTACHMENT:----MjU0MDg2MjU1OTcyODcwNSAyNjkyOTcyMjQ4NTQxOTAyIDIzMTAwNzM1NjEyODExNjU=