protected function createAttributeByMethod(AttributeAnnotation $annotation, \ReflectionMethod $method): Attribute
    {
        $name = ($annotation->name === null)
            ? $this->resolveNameByMethod($method)
            : $annotation->name;

        $attribute = new Attribute($name, $method->getName());

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

        if ($annotation->type !== null) {
            $this->processDataType($annotation->type, $attribute);
        }

        return $attribute;
    }
protected function createAttributeByMethod(AttributeAnnotation $annotation, \ReflectionMethod $method): Attribute
    {
        $name = ($annotation->name === null)
            ? $this->resolveNameByMethod($method)
            : $annotation->name;

        $attribute = new Attribute($name, $method->getName());

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

        if ($annotation->type !== null) {
            $this->processDataType($annotation->type, $attribute);
        }

        return $attribute;
    }
protected function createAttributeByMethod ( AttributeAnnotation $ annotation , \ ReflectionMethod $ method ) : Attribute { $ name = ( $ annotation -> name === null ) ? $ this -> resolveNameByMethod ( $ method ) : $ annotation -> name ; $ attribute = new Attribute ( $ name , $ method -> getName ( ) ) ; if ( $ annotation -> setter !== null ) { $ attribute -> setSetter ( $ annotation -> setter ) ; } if ( $ annotation -> type !== null ) { $ this -> processDataType ( $ annotation -> type , $ attribute ) ; } return $ attribute ; }
Create attribute by annotation of method

@param  AttributeAnnotation $annotation
@param  \ReflectionMethod   $method
@return Attribute
Create attribute by annotation of method