/** * The magic wakeup method will be called by PHP's runtime environment when * a serialized instance of this class was unserialized. This implementation * of the wakeup method will register this object in the the global class * context. * * @return void */ public function __wakeup() { parent::__wakeup(); $this->context->registerTrait($this); }
/** * testMagicWakeupSetsSourceFileOnChildMethods * * @return void */ public function testMagicWakeupSetsSourceFileOnChildMethods() { $class = new ASTClass(__CLASS__); $class->setCache(new MemoryCacheDriver()); $method = new ASTMethod(__FUNCTION__); $class->addMethod($method); $class->setContext($this->getMock('PDepend\\Source\\Builder\\BuilderContext')); $file = new ASTCompilationUnit(__FILE__); $class->setCompilationUnit($file); $class->__wakeup(); $this->assertSame($file, $method->getCompilationUnit()); }
/** * The magic wakeup method will be called by PHP's runtime environment when * a serialized instance of this class was unserialized. This implementation * of the wakeup method will register this object in the the global class * context. * * @return void */ public function __wakeup() { $this->methods = null; foreach ($this->nodes as $node) { $node->setParent($this); } parent::__wakeup(); }