public function testFinal() { $class = new PhpClass(); $this->assertFalse($class->isFinal()); $this->assertSame($class, $class->setFinal(true)); $this->assertTrue($class->isFinal()); $this->assertSame($class, $class->setFinal(false)); $this->assertFalse($class->isFinal()); }
private function buildSignature(PhpClass $model) { if ($model->isAbstract()) { $this->writer->write('abstract '); } if ($model->isFinal()) { $this->writer->write('final '); } $this->writer->write('class '); $this->writer->write($model->getName()); if ($parentClassName = $model->getParentClassName()) { $this->writer->write(' extends ' . $parentClassName); } if ($model->hasInterfaces()) { $this->writer->write(' implements '); $this->writer->write(implode(', ', $model->getInterfaces()->toArray())); } }