Resets properties of \Google\Protobuf\Compiler\CodeGeneratorRequest to default values


@param CodeGeneratorRequest $object

@throws \InvalidArgumentException

@return void
480651
public static function reset($object)
	{
		if (!($object instanceof CodeGeneratorRequest)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\Compiler\CodeGeneratorRequest.');
		}
		$object->fileToGenerate = NULL;
		$object->parameter = NULL;
		$object->protoFile = NULL;
	}
84386
public function populateObject($object, \stdClass $mapped, $meta=null)
    {
        if (!$meta instanceof Meta) {
            $meta = $this->getMeta($meta ?: get_class($object));
            if (!$meta) {
                throw new \InvalidArgumentException();
            }
        }

        $properties = $meta->getProperties();
        foreach ($mapped as $prop=>$value) {
            if (!isset($properties[$prop])) {
                throw new \UnexpectedValueException("Property $prop does not exist on class {$meta->class}");
            }
            $property = $properties[$prop];
            if (!isset($property['setter'])) {
                $object->{$prop} = $value;
            }
            else {
                // false setter means read only
                if ($property['setter'] !== false) {
                    call_user_func(array($object, $property['setter']), $value);
                }
            }
        }
    }
1071491
public function setObject($object)
    {
        if (!($object instanceof IRI) && !($object instanceof Value)) {
            throw new \InvalidArgumentException('Object must be an IRI or Value object');
        }

        $this->object = $object;
    }
387270
public static function reset($object)
	{
		if (!($object instanceof ServiceDescriptorProto)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\ServiceDescriptorProto.');
		}
		$object->name = NULL;
		$object->method = NULL;
		$object->options = NULL;
	}
466270
private function setObjectValue(&$object, FieldDefinition $fieldDefinition, $value): void
    {
        //using setter
        $accessor = new PropertyAccessor();
        $propertyName = $fieldDefinition->getOriginName();
        if (\is_array($object)) {
            $object[$propertyName ?? $fieldDefinition->getName()] = $value;
        } else {
            if ($accessor->isWritable($object, $propertyName)) {
                $accessor->setValue($object, $propertyName, $value);
            } else {
                //using reflection
                $refClass = new \ReflectionClass(\get_class($object));
                if ($refClass->hasProperty($object) && $property = $refClass->getProperty($object)) {
                    $property->setAccessible(true);
                    $property->setValue($object, $value);
                }
            }
        }
    }
678440
public function oxClone($object)
    {
        $classVariables = get_object_vars($object);
        foreach ($classVariables as $name => $value) {
            if (is_object($object->$name)) {
                $this->$name = clone $object->$name;
            } else {
                $this->$name = $object->$name;
            }
        }
    }
989879
public static function reset($object)
	{
		if (!($object instanceof FileOptions)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\FileOptions.');
		}
		$object->javaPackage = NULL;
		$object->javaOuterClassname = NULL;
		$object->javaMultipleFiles = NULL;
		$object->javaGenerateEqualsAndHash = NULL;
		$object->javaStringCheckUtf8 = NULL;
		$object->optimizeFor = NULL;
		$object->goPackage = NULL;
		$object->ccGenericServices = NULL;
		$object->javaGenericServices = NULL;
		$object->pyGenericServices = NULL;
		$object->deprecated = NULL;
		$object->ccEnableArenas = NULL;
		$object->objcClassPrefix = NULL;
		$object->csharpNamespace = NULL;
		$object->javananoUseDeprecatedPackage = NULL;
		$object->uninterpretedOption = NULL;
	}
379281
protected function beforeObjectIsStored($object)
    {
        if (!is_object($object)) {
            throw new \InvalidArgumentException(sprintf('You must only pass object to this container (%s), "%s" passed as parameter!', get_called_class(), gettype($object)), __LINE__);
        }
        $instanceOf = $this->objectClass();
        if (get_class($object) !== $this->objectClass() && !$object instanceof $instanceOf) {
            throw new \InvalidArgumentException(sprintf('Model of type "%s" does not match the object contained by this class: "%s"', get_class($object), $this->objectClass()), __LINE__);
        }
    }
649059
public static function setPropertyValues($object,$keyValueArray=[])
    {
        foreach ($keyValueArray as $name => $value){
            Convert::setPropertyValue($object, $name, $value);
        }
    }
698257
public static function reset($object)
	{
		if (!($object instanceof MethodDescriptorProto)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\MethodDescriptorProto.');
		}
		$object->name = NULL;
		$object->inputType = NULL;
		$object->outputType = NULL;
		$object->options = NULL;
		$object->clientStreaming = NULL;
		$object->serverStreaming = NULL;
	}
406668
public static function reset($object)
	{
		if (!($object instanceof FieldOptions)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\FieldOptions.');
		}
		$object->ctype = NULL;
		$object->packed = NULL;
		$object->jstype = NULL;
		$object->lazy = NULL;
		$object->deprecated = NULL;
		$object->weak = NULL;
		$object->uninterpretedOption = NULL;
	}
52880
public static function reset($object)
	{
		if (!($object instanceof EnumOptions)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\EnumOptions.');
		}
		$object->allowAlias = NULL;
		$object->deprecated = NULL;
		$object->uninterpretedOption = NULL;
	}
586891
public static function reset($object)
	{
		if (!($object instanceof EnumDescriptorProto)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\EnumDescriptorProto.');
		}
		$object->name = NULL;
		$object->value = NULL;
		$object->options = NULL;
	}
1185573
public function injectProperties($object, $propertiesDefinition){
        $properties= $this->parseProperties($propertiesDefinition);
        $reflection= new Reflection($object);
        $reflection->setProperties($properties, TRUE);
    }
232244
public function validateCode(ErrorElement $errorElement, $object)
    {
        $code = $object->getCode();
        $registry = $this->getConfigurationPool()->getContainer()->get('blast_core.code_generators');
        $codeGenerator = $registry->getCodeGenerator(Plot::class);
        if (!empty($code) && !$codeGenerator->validate($code)) {
            $msg = 'Wrong format for plot code. It shoud be: ' . $codeGenerator::getHelp();
            $errorElement
                ->with('code')
                    ->addViolation($msg)
                ->end()
            ;
        }
    }
114241
public function freeze($object, array &$objects = array())
    {
        if (!is_object($object)) {
            throw new InvalidArgumentException(1, 'object');
        }

        if ($object instanceof LazyProxy) {
            if ($object->isThawed()) {
                $object = $object->getObject();
            } else {
                return array('root' => $object->getId());
            }
        }

        // If the object has not been frozen before, generate a new UUID and
        // store it in the "special" __freezer_uuid property.
        if (!isset($object->{$this->idProperty})) {
            $object->{$this->idProperty} = $this->generateId();
        }

        if (!isset($object->__freezer)) {
            $object->__freezer = array();
        }

        $isDirty = $this->isDirty($object, true);
        $id      = (string)$object->{$this->idProperty};

        if (!isset($objects[$id])) {
            $objects[$id] = array(
                'class'   => get_class($object),
                'isDirty' => $isDirty,
                'state'   => array()
            );

            // Iterate over the properties of the object.
            $properties = call_user_func($this->propertyReader, $object);

            foreach ($properties as $name => $value) {
                if ($name !== $this->idProperty) {
                    if (is_array($value)) {
                        $this->freezeArray($value, $objects);
                    } elseif (is_object($value)) {
                        // Freeze the aggregated object.
                        $this->freeze($value, $objects);

                        // Replace $v with the aggregated object's id.
                        $value = '__freezer_' . $value->{$this->idProperty};
                    } elseif (is_resource($value)) {
                        $value = null;
                    }

                    // Store the attribute in the object's state array.
                    $objects[$id]['state'][$name] = $value;
                }
            }
        }

        return array('root' => $id, 'objects' => $objects);
    }
757903
public function offsetUnset($object)
    {
        if (!$object instanceof ObjectHandlable) {
            throw new \InvalidArgumentException('Object needs to implement ObjectHandlable');
        }

        unset($this->__data[$object->getHandle()]);
        return $this;
    }