@param string | \LaravelPlus\Extension\Specs\InputSpec $pathOrSpec
@param array                                           $in

@return \LaravelPlus\Extension\Specs\InputModel
10895
public function inputModel($pathOrSpec, array $in = null)
    {
        if (is_string($pathOrSpec)) {
            $spec = $this->make($pathOrSpec);
        }
        else {
            $spec = $pathOrSpec;
        }

        return new InputModel($spec, $in);
    }
1214646
private function organizeQueryParameters($inParameters = null)
    {
        $ctypeParameters = [];
        $metaParameters = [];
        if (is_array($inParameters)) {
            foreach ($inParameters as $key => $value) {
                if (in_array($key, ['page', 'limit', 'offset', 'returnsingle', 'printquery', 'paging', 'order'])) {
                    $metaParameters[$key] = $value;
                } else {
                    $ctypeParameters[$key] = $value;
                }
            }
        }

        return [$metaParameters, $ctypeParameters];
    }
377532
private function inputToNorm($value, string $path)
    {
        if (null === $this->inputTransformer) {
            $this->inputTransformer = $this->fieldConfig->getNormTransformer() ?? false;
        }

        if (false === $this->inputTransformer) {
            if (null !== $value && !is_scalar($value)) {
                $e = new \RuntimeException(
                    sprintf(
                        'Norm value of type %s is not a scalar value or null and not cannot be '.
                        'converted to a string. You must set a NormTransformer for field "%s" with type "%s".',
                        \gettype($value),
                        $this->fieldConfig->getName(),
                        \get_class($this->fieldConfig->getType()->getInnerType())
                    )
                );

                $error = new ConditionErrorMessage(
                    $path,
                    $this->fieldConfig->getOption('invalid_message', $e->getMessage()),
                    $this->fieldConfig->getOption('invalid_message', $e->getMessage()),
                    $this->fieldConfig->getOption('invalid_message_parameters', []),
                    null,
                    $e
                );

                $this->addError($error);

                return null;
            }

            return '' === $value ? null : $value;
        }

        try {
            return $this->inputTransformer->reverseTransform($value);
        } catch (TransformationFailedException $e) {
            $error = new ConditionErrorMessage(
                $path,
                $this->fieldConfig->getOption('invalid_message', $e->getMessage()),
                $this->fieldConfig->getOption('invalid_message', $e->getMessage()),
                $this->fieldConfig->getOption('invalid_message_parameters', []),
                null,
                $e
            );

            $this->addError($error);

            return null;
        }
    }
452673
protected static function inValues(array $scalars, RuleInterface $next = null): RuleInterface
    {
        return $next === null ? new ScalarInValues($scalars) : new AndOperator(static::inValues($scalars), $next);
    }
1298357
public static function KeyExists($key = null, array $inputArrayToSearch = null){

		//check for the existance of the implementation class
		self::setImplmentationClass();

		//set the input parameters in a try...catch block for better error handling
		try {

			//set the value of the key paramter to use for searching in the input array
			$key = ( ! is_null($key)) ? $key : self::$ArrayHelperClassInstance->getMethodArgs('key');

			//set the value fo the $inputArray parameter
			$inputArrayToSearch = ( ! is_null($inputArrayToSearch)) ? $inputArrayToSearch : self::$ArrayHelperClassInstance->getOutputElement();

			//check if null was supplied for the $key parameter
			if($key === null) throw new ArrayHelperException("NULL \$key value passed to ArrayHelper::KeyExists() method which checks if an array key exists. A valid string is expected!", 1);

			//check if null value was set for the inputArray paramter
			if($inputArrayToSearch === null) throw new ArrayHelperException("NULL \$array value passed to ArrayHelper::KeyExists() method which checks if an array key exists. A valid array is expected!", 1);
			
			//call the implementation class to check for defined key in the input array
			self::$ArrayHelperClassInstance->KeyExists($key, $inputArrayToSearch);

			//return the static instance
			return new static;

		} 

		//catch the error messages here
		catch (ArrayHelperException $ArrayHelperExceptionInstance) {

			//diplay the error message
			$ArrayHelperExceptionInstance->errorShow();
			
		}

	}
192555
private function normalizeSpecification(array $input)
    {
        $output = [];
        $mayBeChildless = null;
        
        foreach ($input as $key => $spec) {
            if ($key === 'attributes') {
                if (!is_array($spec)) {
                    throw new LogicException('Value under key '.$key.' have to be an array');
                }
                $output[$key] = [];
                foreach ($spec as $attrName => $attrSpec) {
                    if (is_string($attrName)) {
                        if (!is_array($attrSpec)) {
                            throw new LogicException('Attribute specification have to be an array');
                        }
                        
                        if (!empty($attrSpec['maxLength'])
                            && (!is_int($attrSpec['maxLength']) || $attrSpec['maxLength'] < 1)
                        ) {
                            throw new LogicException('Attribute constraint "maxLength" has to be an integer >= 1');
                        }
                        
                        if (!empty($attrSpec['enum']) && !is_array($attrSpec['enum'])) {
                            throw new LogicException('Attribute constraint "enum" has to be an array');
                        }
    
                        $output[$key][$attrName] = array_merge($this->defaultAttrSpec, $attrSpec);
                    } else {
                        $output[$key][$attrSpec] = $this->defaultAttrSpec;
                    }
                }
                
            } elseif ($key === 'children') {
                $output[$key] = [];
                foreach ($input[$key] as $childKey => $child) {
                    if (is_string($childKey)) {
                        if (!is_array($child)) {
                            throw new LogicException('Invalid child specification for key '.$childKey);
                        }
                        $output[$key][$childKey] = array_merge(
                            $this->defaultChildSpec,
                            $this->normalizeSpecification($child)
                        );
                        if ($mayBeChildless !== false) {
                            $mayBeChildless = $output[$key][$childKey]['mayBeChildless'];
                        }
                    } else {
                        $output[$key][$child] = $this->defaultChildSpec;
                        if ($mayBeChildless !== false) {
                            $mayBeChildless = $output[$key][$child]['mayBeChildless'];
                        }
                    }
                }
    
            } else {
                $output[$key] = $spec;
            }
        }
    
        if (!isset($output['mayBeChildless'])) {
            if ($mayBeChildless !== null) {
                $output['mayBeChildless'] = $mayBeChildless;
            } elseif (isset($this->defaultChildSpec['mayBeChildless'])) {
                $output['mayBeChildless'] = $this->defaultChildSpec['mayBeChildless'];
            }
        }
        
        return $output;
    }
799459
public function transform($in)
    {
        if (null !== $in && !is_array($in)) {
            $in = strtoupper($in);

            return array(
                'c1' => substr($in, 0, 4),
                'c2' => substr($in, 4, 4),
                'c3' => substr($in, 8, 4),
                'c4' => substr($in, 12, 4),
                'c5' => substr($in, 16, 4),
                'c6' => substr($in, 20, 4),
                'c7' => substr($in, 24, 3),
                'c8' => substr($in, 27),
            );
        }

        return $in;
    }
1031928
public function build(InputInterface $input, $path)
    {
        $voters = [
            new ExtendsParent,
            new YieldsFromParent,
            new StacksFromParent,
            new SectionsInParent,
        ];

        /** @var \Sven\ArtisanView\Voters\Voter $voter */
        foreach ($voters as $voter) {
            if (! $voter->canHandle($input)) {
                continue;
            }

            $voter->inPath($path)->run($input, $this);
        }

        return $this;
    }
915037
protected function toRuleRecursive(XType $type, $maxDepth, array $relations, array &$path)
    {

        if (!$type instanceof KeyValueType) {

            $rule = [];

            $this->addRequiredIfNotNull($type, $rule);

            $this->addGroupName($type, $rule);

            $this->addConstraints($type, $rule);

            return implode('|', $rule);
        }

        // Check if the depth would be higher then max
        if ((count($path)+1) > $maxDepth) {
            return $this->groupName($type);
        }

        return $this->keyValueTypeToRule($type, $maxDepth, $relations, $path);


    }
1338973
public function init(array $spec)
    {
        $dl = QRspec::rsDataCodes1($spec);
        $el = QRspec::rsEccCodes1($spec);
        $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el);


        $blockNo = 0;
        $dataPos = 0;
        $eccPos = 0;
        for($i=0; $i<QRspec::rsBlockNum1($spec); $i++) {
            $ecc = array_slice($this->ecccode,$eccPos);
            $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el,  $ecc, $rs);
            $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc);

            $dataPos += $dl;
            $eccPos += $el;
            $blockNo++;
        }

        if(QRspec::rsBlockNum2($spec) == 0)
            return 0;

        $dl = QRspec::rsDataCodes2($spec);
        $el = QRspec::rsEccCodes2($spec);
        $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el);

        if($rs == NULL) return -1;

        for($i=0; $i<QRspec::rsBlockNum2($spec); $i++) {
            $ecc = array_slice($this->ecccode,$eccPos);
            $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs);
            $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc);

            $dataPos += $dl;
            $eccPos += $el;
            $blockNo++;
        }

        return 0;
    }
833893
protected function setIn($key, $value, &$in)
    {
        $keys = explode($this->getSeparator(), $key, 2);
        if (count($keys) > 0) {
            if (! isset($in[$keys[0]])) {
                if (count($keys) >= 2) {
                    $in[$keys[0]] = array();
                }
            }
            if (count($keys) >= 2) {
                $this->setIn($keys[1], $value, $in[$keys[0]]);
            } else {
                $in[$keys[0]] = $value;
            }
        }
    }
507924
public function matchParamSet($pathInfo, $method = 'GET')
    {
        $params = $this->match($pathInfo, $method);
        $restParams = $this->matchRestParamSet($pathInfo, $method);
        return $params ? array_merge(array($params), $restParams) : $restParams;
    }
1087028
public function executeCommand($unOption,$inOption,$class,$pathFile)
    {
        $self = $this;
        if (!file_exists($pathFile)) {
            return $self->info("No Configuration\n");
        }
        require_once $pathFile;
        if ($unOption) {
            try {
                set_time_limit(0);
                $script = eval("return new \\$class();");
                $script->uninstall();
            } catch (\Exception $e) {
                return $self->error($e->getMessage() . "\n" . $e->getTraceAsString() . "\n");
            }
        }
        if ($inOption) {
            try {
                set_time_limit(0);
                $script = eval("return new \\$class();");
                $script->install();
            } catch (\Exception $e) {
                return $self->error($e->getMessage() . "\n" . $e->getTraceAsString() . "\n");
            }
        }
    }
399
public static function createPresets($path = null, $callback = null) {
        $moufManager = MoufManager::getMoufManager();
        $instances = $moufManager->findInstances('Mouf\\Utils\\Graphics\\MoufImagine\\Controller\\ImagePresetController');
        foreach ($instances as $instanceName) {
            $instance = $moufManager->getInstance($instanceName);
            if ($path && strpos($path, $instance->originalPath) !== false && $instance->createPresetsEnabled === true) {
                $imagePath = substr($path, strlen($instance->originalPath) + 1);
                $instance->image($imagePath);

                if(is_callable($callback)) {
                    $finalPath = ROOT_PATH . $instance->url . DIRECTORY_SEPARATOR . $imagePath;
                    $callback($finalPath);
                }
            }
        }
    }
385716
protected function matchValidators(ServerRequestInterface $request, $path, array &$parameters = array())
    {
        foreach($this->properties['validators'] as $validation)
        {
            if(is_string($validation)) {
                if(!isset(static::$classCaches[$validation])) {
                    /** @var Validator $validationObj */
                    $validationObj = new $validation;

                    if(!($validationObj instanceof Validator))
                        throw new InvalidArgumentException('The [' . $validation . '] validator must be type of [' . Validator::class . '].');
                } else {
                    $validationObj = static::$classCaches[$validation];
                }

                $flag = $validationObj->validate($parameters, $this, $request, $path);
            }
            else if(is_object($validation) && ($validation instanceof \Closure)) {
                $flag = $validation($parameters, $this, $request, $path);
            } else {
                throw new InvalidArgumentException('The validator must be type of [' . Validator::class . '] or [' . \Closure::class . ']');
            }

            if(!$flag || $flag === false)
                return false;
        }

        return true;
    }
977786
private function parseParametersFile($pathParametersFile)
    {
        $this->parameters = parse_ini_file($pathParametersFile, true);

        if (isset($this->parameters['environment'])) {
            $this->setEnvironment($this->parameters['environment']);
        }

        if (isset($this->parameters['login'])) {
            $this->setLogin($this->parameters['login']);
        }

        if (isset($this->parameters['password'])) {
            $password = $this->parameters['password'];
            if (empty($this->parameters['isEncryptedPassword'])
            || $this->parameters['isEncryptedPassword'] === false
            || $this->parameters['isEncryptedPassword'] === 'false') {
                $password = $this->encryptPassword($password);
            }

            $this->setPassword($password);
        }

        if (isset($this->parameters['api_key'])) {
            $this->setApiKey($this->parameters['api_key']);
        }

        if (isset($this->parameters['ssl_enabled'])) {
            $this->setEnabledSSL($this->parameters['ssl_enabled']);

            $this->setCertClientLocation($this->parameters['cert_client_location']);
            $this->setCaChainClientLocation($this->parameters['ca_chain_client_location']);
            $this->setPrivateKeyClientLocation($this->parameters['private_key_client_location']);
            $this->setPrivateKeyClientPassword($this->parameters['private_key_client_password']);
        }

        return $this;
    }
1212202
public function compile($input, $path = null)
    {
        $compileEvent = new CompileEvent($input, $path ?: $this->getOption('filename'));
        $this->trigger($compileEvent);

        $input = $compileEvent->getInput();
        $path = $compileEvent->getPath();
        $this->importPaths = [];
        $includes = [];
        foreach ($this->getOption('includes') as $include) {
            $includes[] = $this->compileDocument(file_get_contents($include), $include);
        }

        $element = $this->compileDocument($input, $path);

        foreach (array_reverse($includes) as $include) {
            $element->prependChild($include);
        }

        $output = $this->getFormatter()->format($element);
        $output = $this->getFormatter()->formatDependencies().$output;

        $outputEvent = new OutputEvent($compileEvent, $output);
        $this->trigger($outputEvent);

        return $outputEvent->getOutput();
    }