privatefunctionsupports(string $class): bool { $class = new \ReflectionClass($class);
// We look for at least one non-static property
do{ foreach($class->getProperties()as$property){ if(!$property->isStatic()){ return true; } } }while($class = $class->getParentClass());
/**
* Returns the time the class was last modified, testing traits and parents
*/ privatefunctiongetLastModification(ReflectionClass $class): int { $filename = $class->getFileName();
privatefunctioncomputeHash(): string { try{ $this->classReflector ??= new \ReflectionClass($this->className); }catch(\ReflectionException){ // the class does not exist anymore
return false; } $hash = hash_init('xxh128');
/**
* Associates a type and a service id if applicable.
*/ privatefunctionset(string $type, string $id): void { // is this already a type/class that is known to match multiple services?
if(isset($this->ambiguousServiceTypes[$type])){