Exemplo n.º 1
0
 public function create()
 {
     $definition = new Definition($this->className);
     $definition->setClass($this->nameSpace . '\\' . $this->className);
     $definition->setAbstract(true);
     $properties = $this->extractProperties();
     $definition->setProperties($properties);
     $methods = $this->extractMethods();
     $definition->setMethods($methods);
     $definition->addInterface('\\Serializable');
     $definition->addMethod($this->createSerialize());
     $definition->addMethod($this->createUnserialize());
     return $definition;
 }
Exemplo n.º 2
0
 public function testDocComment()
 {
     $definition = new Definition('Class1');
     $definition->setDocComment('myDoc');
     $this->assertSame('myDoc', $definition->getDocComment());
 }
Exemplo n.º 3
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testRemoveConstantBynameShouldThrowException()
 {
     $definition = new Definition('Class1');
     $definition->removeConstantByName('X');
 }
Exemplo n.º 4
0
 /**
  * Constructor.
  *
  * @param string                   $class  The class.
  * @param Mandango\Mondator\Output $output The output.
  *
  * @api
  */
 public function __construct($class, Output $output)
 {
     parent::__construct($class);
     $this->setOutput($output);
 }