protected function createAttributeByProperty(AttributeAnnotation $annotation, \ReflectionProperty $property): Attribute
    {
        $name = ($annotation->name === null)
            ? $property->getName()
            : $annotation->name;

        $getter = ($annotation->getter === null)
            ? $this->resolveGetter($property)
            : $annotation->getter;

        $setter = ($annotation->setter === null)
            ? $this->resolveSetter($property)
            : $annotation->setter;

        $attribute = new Attribute($name, $getter);
        $attribute->setPropertyName($property->getName());

        if ($setter !== null) {
            $attribute->setSetter($setter);
        }

        $this->processAttributeOptions($annotation, $attribute);

        return $attribute;
    }
protected function createAttributeByProperty(AttributeAnnotation $annotation, \ReflectionProperty $property): Attribute
    {
        $name = ($annotation->name === null)
            ? $property->getName()
            : $annotation->name;

        $getter = ($annotation->getter === null)
            ? $this->resolveGetter($property)
            : $annotation->getter;

        $setter = ($annotation->setter === null)
            ? $this->resolveSetter($property)
            : $annotation->setter;

        $attribute = new Attribute($name, $getter);
        $attribute->setPropertyName($property->getName());

        if ($setter !== null) {
            $attribute->setSetter($setter);
        }

        $this->processAttributeOptions($annotation, $attribute);

        return $attribute;
    }
protected function createAttributeByProperty ( AttributeAnnotation $ annotation , \ ReflectionProperty $ property ) : Attribute { $ name = ( $ annotation -> name === null ) ? $ property -> getName ( ) : $ annotation -> name ; $ getter = ( $ annotation -> getter === null ) ? $ this -> resolveGetter ( $ property ) : $ annotation -> getter ; $ setter = ( $ annotation -> setter === null ) ? $ this -> resolveSetter ( $ property ) : $ annotation -> setter ; $ attribute = new Attribute ( $ name , $ getter ) ; $ attribute -> setPropertyName ( $ property -> getName ( ) ) ; if ( $ setter !== null ) { $ attribute -> setSetter ( $ setter ) ; } $ this -> processAttributeOptions ( $ annotation , $ attribute ) ; return $ attribute ; }
Create attribute by annotation of property

@param  AttributeAnnotation $annotation
@param  \ReflectionProperty $property
@return Attribute
Create attribute by annotation of property