src/ImmutabilityBehaviour.php
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
            ));
        }
    }
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
            ));
        }
    }
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 ) ) ; } }
Check properties accessibility.

@throws ImmutabilityViolationException
Check properties accessibility .