@param array $define

@return bool
969152
private function is_logical( $define ) {
		return $this->apply_filters( 'is_logical', 'physical' !== $this->app->utility->array_get( $define, 'delete', $this->app->get_config( 'config', 'default_delete_rule' ) ), $define );
	}
1053634
public function arrayToClassElement($definition)
    {
        $class = new Classes();
        if (isset($definition['docblock'])) {
            $docblock = $this->arrayToDocblockElement($definition['docblock']);
            $class->setDocbloc($docblock);
        }
        if (isset($definition['namespace'])) {
            $class->setNamespace($definition['namespace']);
        }
        if (isset($definition['name'])) {
            $class->setName($definition['name']);
        }
        if (isset($definition['extends'])) {
           $class->setExtends($definition['extends']);
        }
        if (isset($definition['implements'])) {
            foreach ($definition['implements'] as $interface) {
                $class->addImplements($interface);
            }
        }
        if (isset($definition['uses'])) {
            foreach ($definition['uses'] as $alias => $use) {
                $alias = is_string($alias) ? $alias : null;
                $class->addUse($use, $alias);
            }
        }
        if (isset($definition['functions'])) {
            foreach ($definition['functions'] as $definition) {
                $function = $this->arrayToFunctionElement($definition);
                $class->addFunction($function);
            }
        }
        return $class;
    }
1168722
private function write_definitions_to_cache(array $definitions) {

        // Preserve the selected sharing option when updating the definitions.
        // This is set by the user and should never come from caches.php.
        foreach ($definitions as $key => $definition) {
            unset($definitions[$key]['selectedsharingoption']);
            unset($definitions[$key]['userinputsharingkey']);
            if (isset($this->configdefinitions[$key]) && isset($this->configdefinitions[$key]['selectedsharingoption'])) {
                $definitions[$key]['selectedsharingoption'] = $this->configdefinitions[$key]['selectedsharingoption'];
            }
            if (isset($this->configdefinitions[$key]) && isset($this->configdefinitions[$key]['userinputsharingkey'])) {
                $definitions[$key]['userinputsharingkey'] = $this->configdefinitions[$key]['userinputsharingkey'];
            }
        }

        $this->configdefinitions = $definitions;
        foreach ($this->configdefinitionmappings as $key => $mapping) {
            if (!array_key_exists($mapping['definition'], $definitions)) {
                unset($this->configdefinitionmappings[$key]);
            }
        }
        $this->config_save();
    }
523242
public function set($name, $definition)
    {
        if (is_string($definition)) {
            if (strpos($definition, '/') !== false || preg_match('#^[\w\\\\]+$#', $definition) !== 1) {
                $definition = ['class' => $this->_interClassName($name), $definition, 'shared' => false];
            } else {
                if (strpos($definition, '\\') === false) {
                    $definition = $this->_completeClassName($name, $definition);
                }
                $definition = ['class' => $definition, 'shared' => false];
            }
        } elseif (is_array($definition)) {
            if (isset($definition['class'])) {
                if (strpos($definition['class'], '\\') === false) {
                    $definition['class'] = $this->_completeClassName($name, $definition['class']);
                }
            } elseif (isset($definition[0]) && count($definition) !== 1) {
                if (strpos($definition[0], '\\') === false) {
                    $definition[0] = $this->_completeClassName($name, $definition[0]);
                }
            } else {
                $definition['class'] = $this->_interClassName($name);
            }

            $definition['shared'] = false;
        } elseif (is_object($definition)) {
            $definition = ['class' => $definition, 'shared' => !$definition instanceof \Closure];
        } else {
            throw new UnexpectedValueException(['`:definition` definition is unknown', 'definition' => $name]);
        }

        $this->_definitions[$name] = $definition;

        return $this;
    }
676749
final public function check(array $options) {
        foreach ($options as $property => $value) {
            if ((is_array($value) && !in_array($this->$property, $value)) ||
                    (!is_array($value) && $this->$property !== $value))
                return false;
        }

        return true;
    }
189470
public static function run($definition) {
		$definition = Helper::isEnabledComponent($definition);
		if(!$definition) {
			return null;
		}
		$object = self::create($definition);
		if(method_exists($object, 'isEnabled') && !$object->isEnabled()) {
			return null;
		}
		$result = $object->run();
		return [
			'object' => $object,
			'config' => $definition,
			'result' => $result,
		];
	}
546311
private function hydrateDefinitionClass(Definition $definition, array &$definitionArray)
    {
        if (null !== $definition->getClass()) {
            $definitionArray['class'] = $definition->getClass();
        }
    }
1170230
public function equals(Definition $definition): bool
    {
        if (get_class($this) !== get_class($definition)) {
            return false;
        }

        if (null !== $this->type xor null !== $definition->type) {
            return false;
        }

        if (null !== $this->type && null !== $definition->type && !$this->type->equals($definition->type)) {
            return false;
        }

        if (null !== $this->moreInfo xor null !== $definition->moreInfo) {
            return false;
        }

        if (null !== $this->moreInfo && null !== $definition->moreInfo && !$this->moreInfo->equals($definition->moreInfo)) {
            return false;
        }

        if (null !== $this->extensions xor null !== $definition->extensions) {
            return false;
        }

        if (null !== $this->name xor null !== $definition->name) {
            return false;
        }

        if (null !== $this->description xor null !== $definition->description) {
            return false;
        }

        if (null !== $this->name) {
            if (count($this->name) !== count($definition->name)) {
                return false;
            }

            foreach ($this->name as $language => $value) {
                if (!isset($definition->name[$language])) {
                    return false;
                }

                if ($value !== $definition->name[$language]) {
                    return false;
                }
            }
        }

        if (null !== $this->description) {
            if (count($this->description) !== count($definition->description)) {
                return false;
            }

            foreach ($this->description as $language => $value) {
                if (!isset($definition->description[$language])) {
                    return false;
                }

                if ($value !== $definition->description[$language]) {
                    return false;
                }
            }
        }

        if (null !== $this->extensions && null !== $definition->extensions && !$this->extensions->equals($definition->extensions)) {
            return false;
        }

        return true;
    }
539480
public function applyDefaults($definition)
    {
        if (!is_array($definition)) {
            return $definition;
        }

        if (!isset($definition['component'])) {
            throw new AppException('Missing required "component" key in listener definition');
        }

        return array_merge($this->defaults, $definition);
    }
1313100
public function map($definition)
    {
        $fixed = preg_replace('/\s+/', ' ', $definition);
        if (empty($fixed)) {
            return;
        }
        
        $names = explode(' ', $fixed);
        $newArgs = [];
        foreach ($this->args as $key => $value) {
            if (!is_int($key) && in_array($key, $names)) {
                throw new \Exception("Duplicate key {$key}");
            }

            if (is_int($key) && isset($names[$key])) {
                //Map command
                $newArgs[$names[$key]] = $value;
            } else {
                //Ignore options
                $newArgs[$key] = $value;
            }
        }
        $this->args = $newArgs;
    }
101409
protected function containsRequestedGroup(array $sectionDefinition): bool
    {
        foreach ($this->filterForRequestedGroupCheck($sectionDefinition) as $commandDefinition) {
            if (array_intersect($commandDefinition['groups'], $this->groupsToBeExecuted)) {
                return true;
            }
        }

        return false;
    }
153411
protected function createTaxTypeFromDefinition(array $definition)
    {
        // Load the referenced zone.
        $definition['zone'] = $this->zoneRepository->get($definition['zone']);
        // Provide defaults.
        if (!isset($definition['compound'])) {
            $definition['compound'] = false;
        }
        if (!isset($definition['display_inclusive'])) {
            $definition['display_inclusive'] = false;
        }
        if (!isset($definition['rounding_mode'])) {
            $definition['rounding_mode'] = PHP_ROUND_HALF_UP;
        }

        $type = new TaxType();
        // Bind the closure to the TaxType object, giving it access to
        // its protected properties. Faster than both setters and reflection.
        $setValues = \Closure::bind(function ($definition) {
            $this->id = $definition['id'];
            $this->name = $definition['name'];
            $this->compound = $definition['compound'];
            $this->displayInclusive = $definition['display_inclusive'];
            $this->roundingMode = $definition['rounding_mode'];
            $this->zone = $definition['zone'];
            if (isset($definition['generic_label'])) {
                $this->genericLabel = $definition['generic_label'];
            }
            if (isset($definition['tag'])) {
                $this->tag = $definition['tag'];
            }
        }, $type, '\CommerceGuys\Tax\Model\TaxType');
        $setValues($definition);

        foreach ($definition['rates'] as $rateDefinition) {
            $rate = $this->createTaxRateFromDefinition($rateDefinition);
            $type->addRate($rate);
        }

        return $type;
    }
882451
public function newInputFilter(array $definition = array())
    {
        if (!empty($definition)) {
            $this->_definition = $definition;
        }
        $this->_inputFilter = new InputFilter();

        foreach ($this->_definition as $key => $item) {
            if (!is_string($key)) {
                $key = $item['name'];
            }
            $this->_addInput($item, $key);
        }

        return $this->_inputFilter;
    }
1067948
private function resolve($definition)
    {
        return !is_null($this->resolver) ? $this->resolver->resolve($definition) : $definition;
    }
795809
public function arrayToDocblockElement(array $definition)
    {
        $docblock = new Docblock();
        if (isset($definition['description'])) {
            $docblock->setDescription($definition['description']);
        }
        if (isset($definition['params'])) {
            foreach ($definition['params'] as $param => $infos) {
                $type = isset($infos['type']) ? $infos['type']: '';
                $description = isset($infos['description']) ? $infos['description'] : '';
                $docblock->addVar($param, $type, $description);
            }
        }
        if (isset($definition['return'])) {
            $docblock->addParam('return', $definition['return']);
        }
        if (isset($definition['infos'])) {
            foreach ($definition['infos'] as $name => $value) {
                $docblock->addParam($name, $value);
            }
        }
        return $docblock;
    }
57550
public function initialise(cache_definition $definition) {
        $this->definition = $definition;
        $this->cacheprefix = $this->storeprefix.$definition->generate_definition_hash().'__';
        return true;
    }
642625
private function setDefinitionFactory(Definition $definition, array $array)
    {
        if (isset($array['factory'])) {
            $factory = [];
            foreach ($array['factory'] as $argument) {
                $factory[] = $this->convertArgument($argument);
            }

            $definition->setFactory($factory);
        }
    }