getName(), $property->getDeclaringClass()->getName() ) ); } public static function nonReferenceableLocalizedReflectionProperties( ReflectionClass $class, Properties $properties ): self { return new self(sprintf( 'Cannot create references for following properties of class %s: %s', $class->getName(), implode(', ', array_map(static function (ReflectionProperty $property): string { return $property->getName(); }, $properties->getInstanceProperties())) )); } }