private function checkPropertiesAccessibility(): void
    {
        $publicProperties = (new \ReflectionObject($this))->getProperties(\ReflectionProperty::IS_PUBLIC);
        if (\count($publicProperties) !== 0) {
            throw new ImmutabilityViolationException(\sprintf(
                'Class %s should not have public properties',
                static::class
            ));
        }
    }