src/StatedClass/Automated/Assertion/Assertion.php
public function isValid(ProxyInterface $proxy): bool
    {
        $asserted = true;

        $reflectionObject = new \ReflectionObject($proxy);
        //Browse properties assertion
        foreach ($this->propertiesAssertions as $property => $exceptedValue) {
            if (null !== $exceptedValue && \property_exists($proxy, $property)) {
                //If the property exists, get it's value via the Reflection api
                // (properties are often not accessible for public)
                $reflectionProperty = $reflectionObject->getProperty($property);
                $reflectionProperty->setAccessible(true);
                $propertyValue = $reflectionProperty->getValue($proxy);

                if (!\is_callable($exceptedValue)) {
                    //Not a callable, perform a equal test
                    $asserted &= $exceptedValue == $propertyValue;
                } else {
                    $asserted &= $exceptedValue($propertyValue);
                }
            } else {
                //If the property does not existn the assertion fail
                $asserted = false;
            }

            if (!$asserted) {
                //Stop at first fail
                break;
            }
        }

        return !empty($asserted);
    }
public function isValid(ProxyInterface $proxy): bool
    {
        $asserted = true;

        $reflectionObject = new \ReflectionObject($proxy);
        //Browse properties assertion
        foreach ($this->propertiesAssertions as $property => $exceptedValue) {
            if (null !== $exceptedValue && \property_exists($proxy, $property)) {
                //If the property exists, get it's value via the Reflection api
                // (properties are often not accessible for public)
                $reflectionProperty = $reflectionObject->getProperty($property);
                $reflectionProperty->setAccessible(true);
                $propertyValue = $reflectionProperty->getValue($proxy);

                if (!\is_callable($exceptedValue)) {
                    //Not a callable, perform a equal test
                    $asserted &= $exceptedValue == $propertyValue;
                } else {
                    $asserted &= $exceptedValue($propertyValue);
                }
            } else {
                //If the property does not existn the assertion fail
                $asserted = false;
            }

            if (!$asserted) {
                //Stop at first fail
                break;
            }
        }

        return !empty($asserted);
    }
{@inheritdoc}