/** * If the property is a instance of Field then we can get the field type of it, otherwise return text * @param Property $property * * @return string */ public static function getFieldType(Property $property) { $variableName = $property->getVariableName(); if (static::$object->getFieldType($variableName) instanceof Field) { return static::$object->getFieldType($variableName)->getFieldType(); } return 'text'; }
/** * @covers ::create * @uses \phpDocumentor\Reflection\TypeResolver * @expectedException \InvalidArgumentException */ public function testFactoryMethodFailsIfDescriptionFactoryIsNull() { Property::create('body', new TypeResolver()); }