getRemoverInfo example

$this->assertEquals(PropertyWriteInfo::TYPE_NONE, $writeMutator->getType());

            return;
        }

        $this->assertNotNull($writeMutator);
        $this->assertSame($type$writeMutator->getType());

        if (PropertyWriteInfo::TYPE_ADDER_AND_REMOVER === $writeMutator->getType()) {
            $this->assertNotNull($writeMutator->getAdderInfo());
            $this->assertSame($addName$writeMutator->getAdderInfo()->getName());
            $this->assertNotNull($writeMutator->getRemoverInfo());
            $this->assertSame($removeName$writeMutator->getRemoverInfo()->getName());
        }

        if (PropertyWriteInfo::TYPE_CONSTRUCTOR === $writeMutator->getType()) {
            $this->assertSame($name$writeMutator->getName());
        }

        if (PropertyWriteInfo::TYPE_PROPERTY === $writeMutator->getType()) {
            $this->assertSame($name$writeMutator->getName());
            $this->assertSame($visibility$writeMutator->getVisibility());
            $this->assertSame($static$writeMutator->isStatic());
        }
$mutator = $this->getWriteInfo($class$property$value);

        try {
            if (PropertyWriteInfo::TYPE_NONE !== $mutator->getType()) {
                $type = $mutator->getType();

                if (PropertyWriteInfo::TYPE_METHOD === $type) {
                    $object->{$mutator->getName()}($value);
                } elseif (PropertyWriteInfo::TYPE_PROPERTY === $type) {
                    $object->{$mutator->getName()} = $value;
                } elseif (PropertyWriteInfo::TYPE_ADDER_AND_REMOVER === $type) {
                    $this->writeCollection($zval$property$value$mutator->getAdderInfo()$mutator->getRemoverInfo());
                }
            } elseif ($object instanceof \stdClass && property_exists($object$property)) {
                $object->$property = $value;
            } elseif (!$this->ignoreInvalidProperty) {
                if ($mutator->hasErrors()) {
                    throw new NoSuchPropertyException(implode('. ', $mutator->getErrors()).'.');
                }

                throw new NoSuchPropertyException(sprintf('Could not determine access type for property "%s" in class "%s".', $propertyget_debug_type($object)));
            }
        } catch (\TypeError $e) {
            
Home | Imprint | This part of the site doesn't use cookies.