public function testWithHintAndNullableFalse() { $prop = new Prop('test', Hint::STRING, false); $this->assertEquals('test', $prop->getName()); $this->assertEquals(Hint::STRING, $prop->getHint()); $this->assertFalse($prop->getNullable()); }
/** * @param Prop $property * @return static * @throws \Exception */ protected final function _prop(Prop $property) { $name = $property->getName(); if (!property_exists($this, $name)) { throw new \InvalidArgumentException("Property does not exists"); } if (isset($this->__props[$name])) { throw new \Exception("Override Property is not allowed, to enhance stability!"); } $this->__props[$name] = $property; return $this; }
/** * @param Prop $prop * @param string $namespace * @return string */ public static function generatePhpDoc(Prop $prop, $namespace) { $name = $prop->getName(); return '* @method ' . static::getPhpDocHint($prop, $namespace) . static::PREFIX . ucfirst($name) . '()'; }