$reflection */ public static function fromReflection(ReflectionClass $reflection): ClassDefinition { $properties = array_map( static fn (ReflectionProperty $reflection) => FakePropertyDefinition::fromReflection($reflection), $reflection->getProperties() ); $methods = array_map( static fn (ReflectionMethod $reflection) => FakeMethodDefinition::fromReflection($reflection), $reflection->getMethods() ); return new ClassDefinition( new ClassType($reflection->name), new FakeAttributes(), new Properties(...$properties), new Methods(...$methods) ); } }