BetterReflection\Reflection\ReflectionProperty::getName PHP Метод

getName() публичный Метод

Get the name of the property.
public getName ( ) : string
Результат string
    public function getName()
    {
        return $this->node->props[0]->name;
    }

Usage Example

 function it_has_properties(ReflectionClass $reflectionClass, ReflectionProperty $property, AnnotationScanner $annotations, TypeFactory $typeFactory)
 {
     $reflectionClass->getName()->willReturn('MyClass');
     $property->getName()->willReturn('id');
     $property->getDocBlockTypeStrings()->willReturn(['string']);
     $property->getDocComment()->willReturn('/** @Target("CLASS") */');
     $typeFactory->create(Argument::any(), Argument::type(Mixed::class), ['string'], false)->willReturn(new StringType());
     $reflectionClass->getProperties()->willReturn([$property]);
     $annotations->scanForAnnotations('/** @Target("CLASS") */', '/var/www/MyClass.php', $this->imports)->willReturn(new Annotations([new Target(['value' => "CLASS"])]));
     $this->properties()->shouldHaveSize(1);
 }
All Usage Examples Of BetterReflection\Reflection\ReflectionProperty::getName