InputObjectTypeExtension :
- extend input Name Directives[Const]? InputFieldsDefinition
- extend input Name Directives[Const]

@return InputObjectTypeExtensionNode
@throws SyntaxErrorException
435382
protected function lexInputObjectTypeExtension(): InputObjectTypeExtensionNode
    {
        $start = $this->lexer->getToken();

        $this->expectKeyword(KeywordEnum::EXTEND);
        $this->expectKeyword(KeywordEnum::INPUT);

        $name       = $this->lexName();
        $directives = $this->lexDirectives(true);
        $fields     = $this->lexInputFieldsDefinition();

        if (empty($directives) && empty($fields)) {
            throw $this->unexpected();
        }

        return new InputObjectTypeExtensionNode($name, $directives, $fields, $this->createLocation($start));
    }
96565
private function initColumnTypeExtensions()
    {
        $this->columnTypeExtensions = [];

        foreach ($this->loadColumnTypeExtensions() as $extension) {
            if (!$extension instanceof ColumnTypeExtensionInterface) {
                throw new UnexpectedTypeException($extension, ColumnTypeExtensionInterface::class);
            }

            $type = $extension->getExtendedType();

            $this->columnTypeExtensions[$type][] = $extension;
        }
    }
1060677
private function buildInputDefinition() : InputDefinition
    {
        return new InputDefinition(
            [
                new InputOption(
                    'target',
                    't',
                    InputOption::VALUE_REQUIRED,
                    'Finds files which have changed since the current branch parted from the target branch '
                    . 'only. The Value has to be a commit-ish.',
                    false
                ),
                new InputOption(
                    'auto-target',
                    'a',
                    InputOption::VALUE_NONE,
                    'Finds Files which have changed since the current branch parted from the parent branch '
                    . 'only. It tries to find the parent branch by automagic.'
                ),
                new InputOption(
                    'blacklist-token',
                    'b',
                    InputOption::VALUE_REQUIRED,
                    'Name of the file which triggers the exclusion of the path',
                    ''
                ),
                new InputOption(
                    'whitelist-token',
                    'w',
                    InputOption::VALUE_REQUIRED,
                    'Name of the file which triggers the inclusion of the path',
                    ''
                ),
                new InputOption(
                    'filter',
                    'f',
                    InputOption::VALUE_REQUIRED,
                    'Filters the Filename. For example .php for PHP-Files',
                    ''
                ),
                new InputOption(
                    'exclusionList',
                    'e',
                    InputOption::VALUE_NONE,
                    'Gathers list of directories which should be excluded'
                ),
            ]
        );
    }
1356574
function extend() {
    var i,
        k,
        res = {},
        l = arguments.length;

    for (i = l - 1; i >= 0; i--)
      for (k in arguments[i])
        if (res[k] && isPlainObject(arguments[i][k]))
          res[k] = extend(arguments[i][k], res[k]);
        else
          res[k] = arguments[i][k];

    return res;
  }
467929
function extendFormatExtensions (extensionName, extensionValue) {
        if (typeof extensionName !== 'string' || !(extensionValue instanceof RegExp)) {
            throw new Error('extensionName or extensionValue undefined or not correct type');
        }

        if (revalidator.validate.formats.hasOwnProperty(extensionName) ||
            revalidator.validate.formats.hasOwnProperty(extensionName)) {
            var msg = 'extensionName: ' + extensionName + ' already exists in formatExtensions.';
            throw  new Error(msg);
        }

        revalidator.validate.formatExtensions[extensionName] = extensionValue;
    }
637038
public function NewObjectArg()
    {
        $token = $this->lexer->lookahead;
        $peek  = $this->lexer->glimpse();

        if ($token['type'] === Lexer::T_OPEN_PARENTHESIS && $peek['type'] === Lexer::T_SELECT) {
            $this->match(Lexer::T_OPEN_PARENTHESIS);
            $expression = $this->Subselect();
            $this->match(Lexer::T_CLOSE_PARENTHESIS);

            return $expression;
        }

        return $this->ScalarExpression();
    }
1109954
public function createObjectType() : ObjectConstructorCallbackDefiner
    {
        return new ObjectConstructorCallbackDefiner($this->class, function (callable $typeCallback) {
            $this->createObjectCallback = function (array $input) use ($typeCallback) {
                $className = $this->class->getClassName();

                /** @var ValueObject $valueObject */
                $valueObject = $typeCallback($input);

                if (!($valueObject instanceof $className)) {
                    throw InvalidReturnValueException::format(
                        'Invalid create object callback return value: expecting class compatible with %s, %s given',
                        $className, is_string($valueObject) ? $valueObject : Debug::getType($valueObject)
                    );
                }

                return $valueObject;
            };
        });
    }
1261767
final public static function formDefinition() : FinalizedFormObjectDefinition
    {
        $class = get_called_class();

        if (!isset(self::$definitions[$class])) {
            /** @var self $instance */
            $instance = (new \ReflectionClass($class))->newInstanceWithoutConstructor();
            $form     = new FormObjectDefinition(new ClassDefinition($instance, new \ReflectionClass(get_class($instance)), __CLASS__));
            $instance->defineForm($form);

            self::$definitions[$class] = $form->finalize();
        }

        return self::$definitions[$class];
    }
718374
def DefaultExtension(schema_obj, form_obj, schemata=None):
    """"""

    if schemata is None:
        schemata = ['systemconfig', 'profile', 'client']

    DefaultExtends = {
        'schema': {
            "properties/modules": [
                schema_obj
            ]
        },
        'form': {
            'modules': {
                'items/': form_obj
            }
        }
    }

    output = {}

    for schema in schemata:
        output[schema] = DefaultExtends

    return output
951213
public Object expand(Object input) {
        if (input instanceof List) {
            expandList((List<Object>) input);
            return input;
        } else if (input instanceof Map) {
            expandMap((Map<String, Object>) input);
            return input;
        } else if (input instanceof String) {
            return getJson((String) input);
        } else {
            return input;
        }
    }
1053394
public function asObjectDescriptor(): Primitive\ObjectDescriptor
    {
        if (!$this->_element instanceof Primitive\ObjectDescriptor) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(
                    Element::TYPE_OBJECT_DESCRIPTOR));
        }
        return $this->_element;
    }
641664
public function createObjectType() : ObjectConstructorCallbackDefiner
    {
        return new ObjectConstructorCallbackDefiner($this->class, function (callable $typeCallback) {
            $this->createObjectCallback = function (array $input) use ($typeCallback) {
                $className = $this->class->getClassName();

                /** @var TypedObject|string $instanceOrType */
                $instanceOrType = $typeCallback($input);

                if (is_string($instanceOrType)) {
                    if (class_exists($instanceOrType) && is_a($instanceOrType, $className, true)) {
                        $instanceOrType = $instanceOrType::definition()->newCleanInstance();
                    }
                }

                if (!($instanceOrType instanceof $className)) {
                    throw InvalidReturnValueException::format(
                        'Invalid create object callback return value: expecting class compatible with %s, %s given',
                        $className, is_string($instanceOrType) ? $instanceOrType : Debug::getType($instanceOrType)
                    );
                }

                return $instanceOrType;
            };
        });
    }
19656
private function initTypeExtensions()
    {
        $this->typeExtensions = [];

        foreach ($this->loadTypeExtensions() as $extension) {
            if (!$extension instanceof FormTypeExtensionInterface) {
                throw new UnexpectedTypeException($extension, 'Symfony\Component\Form\FormTypeExtensionInterface');
            }

            if (method_exists($extension, 'getExtendedTypes')) {
                $extendedTypes = [];

                foreach ($extension::getExtendedTypes() as $extendedType) {
                    $extendedTypes[] = $extendedType;
                }
            } else {
                @trigger_error(sprintf('Not implementing the static getExtendedTypes() method in %s when implementing the %s is deprecated since Symfony 4.2. The method will be added to the interface in 5.0.', \get_class($extension), FormTypeExtensionInterface::class), E_USER_DEPRECATED);

                $extendedTypes = [$extension->getExtendedType()];
            }

            foreach ($extendedTypes as $extendedType) {
                $this->typeExtensions[$extendedType][] = $extension;
            }
        }
    }
652199
public function extensionRequest(): ExtensionRequestValue
    {
        if (!$this->hasExtensionRequest()) {
            throw new \LogicException("No extension request attribute.");
        }
        return $this->firstOf(ExtensionRequestValue::OID)->first();
    }
703559
def _AddHasExtensionMethod(cls):
  """"""
  def HasExtension(self, extension_handle):
    _VerifyExtensionHandle(self, extension_handle)
    if extension_handle.label == _FieldDescriptor.LABEL_REPEATED:
      raise KeyError('"%s" is repeated.' % extension_handle.full_name)

    if extension_handle.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      value = self._fields.get(extension_handle)
      return value is not None and value._is_present_in_parent
    else:
      return extension_handle in self._fields
  cls.HasExtension = HasExtension
872185
function extend() {
    let arg = arguments,
        target = arg[0] || {},
        deep = false,
        length = arg.length,
        i = 1,
        value, attr,
        copyIsArray;

    if (isBoolean(target)) {
        deep = target;
        target = arg[1] || {};
        i++;
    }

    for (; i < length; i++) {
        for (attr in arg[i]) {

            value = arg[i][attr];

            if (deep && (isPlainObject(value) || (copyIsArray = isArray(value)))) {

                let src = target[attr];

                if (copyIsArray) {
                    copyIsArray = false;
                    src = isArray(src) ? src : [];
                } else {
                    src = isPlainObject(src) ? src : {};
                }

                target[attr] = extend(deep, src, value);

            } else {
                target[attr] = value;
            }
        }
    }

    return target;
}
883037
protected function determineExtensionName()
    {
        $reflectionClass   = new \ReflectionClass($this);
        $componentFilePath = dirname($reflectionClass->getFileName());

        // If the file path is invalid
        $extensionDirPosition = strpos($componentFilePath, 'ext'.DIRECTORY_SEPARATOR);
        if ($extensionDirPosition === false) {
            throw new \RuntimeException('Invalid component path', 1481360976);
        }

        // Extract the extension key
        $componentPath = explode(
            DIRECTORY_SEPARATOR,
            substr($componentFilePath, $extensionDirPosition + strlen('ext'.DIRECTORY_SEPARATOR))
        );
        $extensionKey  = array_shift($componentPath);

        // If the extension is unknown
        if (!in_array($extensionKey, ExtensionManagementUtility::getLoadedExtensionListArray())) {
            throw new \RuntimeException(sprintf('Unknown extension key "%s"', $extensionKey), 1481361198);
        }

        // Register the extension key & name
        $this->extensionKey  = $extensionKey;
        $this->extensionName = GeneralUtility::underscoredToUpperCamelCase($extensionKey);

        // Process the component path
        if (array_shift($componentPath) !== 'Components') {
            throw new \RuntimeException('Invalid component path', 1481360976);
        }
        $this->componentPath = array_map([static::class, 'expandComponentName'], $componentPath);
    }