Execute the minification rule.

@param \ArjanSchouten\HtmlMinifier\MinifyContext $context

@return \ArjanSchouten\HtmlMinifier\MinifyContext
429017
public function process(MinifyContext $context)
    {
        return $context->setContents(preg_replace_callback(
            '/
                =           # start matching by a equal sign
                \s*         # its valid to use whitespaces after the equals sign
                (["\'])?    # match a single or double quote and make it a capturing group for backreferencing
                    (
                            (?:(?=\1)|[^\\\\])*             # normal part of "unrolling the loop". Match no quote nor escaped char
                            (?:\\\\\1                       # match the escaped quote
                                (?:(?=\1)|[^\\\\])*         # normal part again
                            )*                              # special part of "unrolling the loop"
                    )       # use a the "unrolling the loop" technique to be able to skip escaped quotes like ="\""
                \1?         # match the same quote symbol as matched before
            /x', function ($match) {
            return $this->minifyAttribute($match);
        }, $context->getContents()));
    }
144845
public function initializeContext(Context $context)
    {
        if ($context instanceof ResourceContext) {
            $reflector = new ReflectionClass(get_class($context));

            if ($this->builder->getLoader() instanceof FileResourceLoader) {
                if ($this->builder->getLoader()->getBasePath() == null) {
                    $this->builder->getLoader()->setBasePath(dirname($reflector->getFileName()));
                }
            }

            if ($context->getResourceFactory()) {
                $this->builder->setFactory($context->getResourceFactory());
            }

            $context->setResourceBuilder($this->builder);
        }
    }
544459
public function commit(Context $context = null)
    {
        $this->getDBQueryBuilder($context)->go(null, 'commit');
        return $this;
    }
747486
public function setContext(Context $context)
    {
        $this->context = $context;

        if (empty($this->parameters['secret'])) {
            $this->parameters['secret'] = $context->getSecret();
        }

        return $this;
    }
548449
protected function _actionTogglesubscription($context)
    {
        if ($this->getItem()->subscribed(get_viewer())) {
            $ret = $this->_mixer->execute('unsubscribe', $context);
        } else {
            $ret = $this->_mixer->execute('subscribe', $context);
        }

        return $ret;
    }
1077284
protected function _actionBrowse($context)
    {
        if (!$context->query) {
            $context->query = $this->getRepository()->getQuery();
        }

        $query = $context->query;
        $query->order('open', 'DESC');

        if ($this->sort == 'priority') {
            $query->order('priority', 'DESC');
        }

        return parent::_actionBrowse($context);
    }
921255
public function execute($name, AnCommandContext $context)
    {
        $type = '';

        if ($context->caller) {
            $identifier = clone $context->caller->getIdentifier();

            if ($identifier->path) {
                $type = array_shift($identifier->path);
            } else {
                $type = $identifier->name;
            }
        }

        $parts = explode('.', $name);
        $method = !empty($type) ? '_'.$type.ucfirst(AnInflector::implode($parts)) : '_'.lcfirst(AnInflector::implode($parts));

        if (in_array($method, $this->getMethods())) {
            return $this->$method($context);
        }

        return true;
    }
1163655
public function run(Context $context = null)
    {
        $start = microtime(true);

        try {
            try {
                $this->logger->debug('kernel: start');
                $context = $context ?: $this->context();
                $context = $this->before($context);
                return $this->proceed($context);
            }
            catch(HttpException $event) {
                return $this->event($event, $context);
            }
        }
        catch(\Exception $error) {
            return $this->error($error, $context);
        }
        finally {
            $this->after($context);
            $this->logger->debug('kernel: end (' . number_format(microtime(true) - $start, 4) . 's)');
        }
    }
1171164
private function initializeInstance(Context $context)
    {
        foreach ($this->contextInitializers as $initializer) {
            $initializer->initializeContext($context);
        }
    }
1155657
protected function _beforeUpdate(DatabaseContext $context)
    {
        //Get the modified columns
        $modified  = $this->getTable()->filter($this->getProperties(true));

        if(!empty($modified)) {
            $this->_beforeInsert($context);
        }
    }
781988
public function process(MinifyContext $context)
    {
        $booleanAttributes = implode('|', (new HtmlBooleanAttributeRepository())->getAttributes());

        return $context->setContents(preg_replace_callback(
            '/
                \s                          # first match a whitespace which is an indication if its an attribute
                ('.$booleanAttributes.')    # match and capture a boolean attribute
                \s*
                =
                \s*
                ([\'"])?                    # optional to use a quote
                (\1|true|false|([\s>"\']))    # match the boolean attribute name again or true|false
                \2?                         # match the quote again
            /xi', function ($match) {
                if (isset($match[4])) {
                    return ' '.$match[1];
                }

                if ($match[3] == 'false') {
                    return '';
                }

                return ' '.$match[1];
            }, $context->getContents()));
    }
809839
public function create($context = null)
    {
        try {
            $this->context = strlen($context) ? $context : $this->getConfig('create[context]', self::CONTEXT_CREATE);
            $this->controller->pageTitle = $this->controller->pageTitle ?: $this->getLang(
                "{$this->context}[title]",
                'backend::lang.form.create_title'
            );

            $model = $this->controller->formCreateModelObject();
            $model = $this->controller->formExtendModel($model) ?: $model;

            $this->initForm($model);
        }
        catch (Exception $ex) {
            $this->controller->handleError($ex);
        }
    }
92490
protected function doExecute(AssertionContext $context)
    {
        $partyEntityDescriptor = $context->getProfileContext()->getPartyEntityDescriptor();

        $conditions = new Conditions();
        $conditions->setNotBefore($this->timeProvider->getTimestamp());
        $conditions->setNotOnOrAfter($conditions->getNotBeforeTimestamp() + $this->expirationSeconds);

        $audienceRestriction = new AudienceRestriction(array(
            $partyEntityDescriptor->getEntityID(),
        ));
        $conditions->addItem($audienceRestriction);

        $context->getAssertion()->setConditions($conditions);
    }
448854
public function run(ChainContext $context = null)
    {
        if (null === $context) {
            $context = new ArrayChainContext();
        }

        $this->getHead()->execute($context);

        return $context;
    }
792644
public function process($context)
    {
        $context->setContents($this->setCDataPlaceholder($context->getContents(), $context->getPlaceholderContainer()));

        return $context->setContents($this->setConditionalCommentsPlaceholder($context->getContents(), $context->getPlaceholderContainer()));
    }
246555
public static function minify($source, array $filters = null, array $plugins = null)
		{
		self::$errors = array();
		$minifier = new CssMinifier($source, $filters, $plugins);
		return $minifier->getMinified();
		}
116370
protected function render($context)
    {
        $this->runtime->pushContextArray($context);
        $result = $this->runtime->render($this->path . '/renderer');
        $this->runtime->popContext();
        return $result;
    }