Symfony\Component\PropertyAccess\PropertyAccessor::isPropertyWritable PHP Method

isPropertyWritable() private method

Returns whether a property is writable in the given object.
private isPropertyWritable ( object $object, string $property ) : boolean
$object object The object to write to
$property string The property to write
return boolean Whether the property is writable
    private function isPropertyWritable($object, $property)
    {
        if (!is_object($object)) {
            return false;
        }

        $access = $this->getWriteAccessInfo(get_class($object), $property, array());

        return self::ACCESS_TYPE_METHOD === $access[self::ACCESS_TYPE]
            || self::ACCESS_TYPE_PROPERTY === $access[self::ACCESS_TYPE]
            || self::ACCESS_TYPE_ADDER_AND_REMOVER === $access[self::ACCESS_TYPE]
            || (!$access[self::ACCESS_HAS_PROPERTY] && property_exists($object, $property))
            || self::ACCESS_TYPE_MAGIC === $access[self::ACCESS_TYPE];
    }