Exemplo n.º 1
0
 /**
  * Add properties
  */
 function it_add_properties(CodeFactoryContract $factory, PHPProperty $property)
 {
     $factory->buildProperty($name = 'foo', $modifiers = 'bar')->willReturn($property)->shouldBeCalled();
     $this->property($name, $modifiers)->shouldReturn($this);
     $this->getProperties()->shouldBe([$property]);
 }
Exemplo n.º 2
0
 /**
  * Add a property to the class
  *
  * @param string $name
  * @param int    $modifiers
  *
  * @return $this
  */
 public function property($name, $modifiers = 0)
 {
     $this->properties[] = $this->codeFactory->buildProperty($name, $modifiers);
     return $this;
 }