- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
79 lines
2.9 KiB
PHP
79 lines
2.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Framework\Reflection\Contracts;
|
|
|
|
use App\Framework\Core\ValueObjects\ClassName;
|
|
use App\Framework\Reflection\Collections\PropertyCollection;
|
|
|
|
/**
|
|
* Interface for property-related reflection operations
|
|
*/
|
|
interface PropertyReflector
|
|
{
|
|
/**
|
|
* Get properties for a class
|
|
*
|
|
* @param ClassName $className The class name to get properties for
|
|
* @return PropertyCollection Collection of properties
|
|
*/
|
|
public function getProperties(ClassName $className): PropertyCollection;
|
|
|
|
/**
|
|
* Get a specific property for a class
|
|
*
|
|
* @param ClassName $className The class name to get the property for
|
|
* @param string $propertyName The property name to get
|
|
* @return \ReflectionProperty The property
|
|
* @throws \ReflectionException If the property does not exist
|
|
*/
|
|
public function getProperty(ClassName $className, string $propertyName): \ReflectionProperty;
|
|
|
|
/**
|
|
* Check if a class has a specific property
|
|
*
|
|
* @param ClassName $className The class name to check
|
|
* @param string $propertyName The property name to check for
|
|
* @return bool True if the class has the property, false otherwise
|
|
*/
|
|
public function hasProperty(ClassName $className, string $propertyName): bool;
|
|
|
|
/**
|
|
* Get properties with a specific attribute
|
|
*
|
|
* @param ClassName $className The class name to get properties for
|
|
* @param string $attributeClass The attribute class to filter by
|
|
* @return PropertyCollection Collection of properties with the attribute
|
|
*/
|
|
public function getPropertiesWithAttribute(ClassName $className, string $attributeClass): PropertyCollection;
|
|
|
|
/**
|
|
* Get property attributes
|
|
*
|
|
* @param ClassName $className The class name containing the property
|
|
* @param string $propertyName The property name to get attributes for
|
|
* @param string|null $attributeClass Optional attribute class to filter by
|
|
* @return array<\ReflectionAttribute<object>> Array of property attributes
|
|
*/
|
|
public function getPropertyAttributes(ClassName $className, string $propertyName, ?string $attributeClass = null): array;
|
|
|
|
/**
|
|
* Get property type
|
|
*
|
|
* @param ClassName $className The class name containing the property
|
|
* @param string $propertyName The property name to get the type for
|
|
* @return \ReflectionType|null The property type, or null if not typed
|
|
*/
|
|
public function getPropertyType(ClassName $className, string $propertyName): ?\ReflectionType;
|
|
|
|
/**
|
|
* Get property default value
|
|
*
|
|
* @param ClassName $className The class name containing the property
|
|
* @param string $propertyName The property name to get the default value for
|
|
* @return mixed The property default value, or null if not set
|
|
*/
|
|
public function getPropertyDefaultValue(ClassName $className, string $propertyName): mixed;
|
|
}
|