@param string $html
@param bool $strict

@return ResponseInterface
490377
public function html(string $html, $strict = false): ResponseInterface
    {
        return $this->print($html, $strict ? 'text/html; charset=utf-8' : null);
    }
247406
public function html(string $body): ResponseInterface
    {
        $response = $this->responseFactory->createResponse();
        $response->getBody()->write($body);

        return $response->withHeader('Content-type', 'text/html; charset=UTF-8');
    }
935279
public static function toScalar($value, $strict = false)
    {
        if (is_scalar($value)) {
            return $value;
        }

        if (is_null($value)) {
            if (!$strict) {
                return $value;
            }
            throw new Exceptions\WrongParameterType(
                'Expected scalar or object with __toString method on strict mode, got ' . ValueDescriber::describe($value)
            );
        }

        return ToString::toString($value);
    }
913226
public function where($key, $value, bool $strict = true): ArrayCollection
    {
        return $this->filter(function ($item) use ($key, $value, $strict) {
            if (!isset($item[$key])) {
                return false;
            }

            return $strict ? $item[$key] === $value : $item[$key] == $value;
        });
    }
130542
public function where(array $criteria, $strict = false): CollectionInterface
    {
        return array_reduce(
            array_keys($criteria),
            function (GeneratorCollection $collection, $key) use ($criteria, $strict) {
                return $collection->filter(function ($item) use ($key, $criteria, $strict) {
                    if ($strict) {
                        return $item[$key] === $criteria[$key];
                    }

                    return $item[$key] == $criteria[$key];
                });
            },
            $this
        );
    }
1307814
public function hydrate(stdClass $input, $strict = false) {
        $this->strict = $strict;
        $failedStrict = [];
        foreach($input as $name => $value) {
            if ($this->strict && !property_exists($this,$name)){
                $failedStrict[$name] = $value;
            } else {
                $this->$name = $value;
            }
        }
        
        if (count($failedStrict)) {
            $this->strictError($failedStrict);
        }
    }
677688
public static function mbstringLoaded($strict = false)
	{
		static $extension, $polyfill;

		if(is_null($extension))
			$extension = extension_loaded('mbstring');

		if(is_null($polyfill))
			$polyfill = function_exists('mb_strlen');

		return ($extension || (!$strict && $polyfill));
	}
1155201
public function parseString(string $arguments, bool $strict = false) : array
    {
        $arguments = explode(' ', $arguments);

        return $this->parseArray($arguments, $strict);
    }
252124
public function load($option, $strict = false)
	{
		$option = $this->canonical($option);

		if (isset(self::$components[$option]))
		{
			return self::$components[$option];
		}

		// Do we have a database connection?
		if ($this->app->has('db'))
		{
			$db = $this->app->get('db');

			$query = $db->getQuery()
				->select('extension_id', 'id')
				->select('element', '"option"')
				->select('params')
				->select('enabled')
				->from('#__extensions')
				->whereEquals('type', 'component')
				->whereEquals('element', $option);

			$db->setQuery($query->toString());

			if (!$this->app->has('cache.store') || !($cache = $this->app['cache.store']))
			{
				$cache = new \Hubzero\Cache\Storage\None();
			}

			if (!($data = $cache->get('_system.' . $option)))
			{
				$data = $db->loadObject();
				$cache->put('_system.' . $option, $data, $this->app['config']->get('cachetime', 15));
			}

			self::$components[$option] = $data;

			if ($error = $db->getErrorMsg())
			{
				throw new Exception($this->app['language']->translate('JLIB_APPLICATION_ERROR_COMPONENT_NOT_LOADING', $option, $error), 500);
			}
		}

		// Create a default object
		if (empty(self::$components[$option]))
		{
			self::$components[$option] = new stdClass;
			self::$components[$option]->option  = $option;
			self::$components[$option]->enabled = $strict ? 0 : 1;
			self::$components[$option]->params  = '';
			self::$components[$option]->id      = 0;
		}

		// Convert the params to an object.
		if (is_string(self::$components[$option]->params))
		{
			self::$components[$option]->params = new Registry(self::$components[$option]->params);
		}

		return self::$components[$option];
	}
1031668
function search($needle, bool $strict = true) {
        return \array_search($needle, $this->data, $strict);
    }
947315
public static function getStatusBetween($from = null, $to = null, $strict = false, $strictTo = null)
    {
        $statusList = static::getStatusList();

        $strictFrom = $strict;
        $strictTo = isset($strictTo) ? (bool) $strictTo : $strict;

        // Remove status before given $from
        if (isset($from)) {
            static::checkAllowedStatus($from);
            foreach ($statusList as $key => $status) {
                if ($from !== $status) {
                    unset($statusList[$key]);
                } else {
                    if ($strictFrom) {
                        unset($statusList[$key]);
                    }
                    break;
                }
            }
        }

        // Remove status after given $to
        if (isset($to)) {
            static::checkAllowedStatus($to);
            // On inverse l'ordre des statuts
            $statusList = array_reverse($statusList);
            foreach ($statusList as $key => $status) {
                if ($to !== $status) {
                    unset($statusList[$key]);
                } else {
                    if ($strictTo) {
                        unset($statusList[$key]);
                    }
                    break;
                }
            }
            // On inverse l'ordre des statuts
            $statusList = array_reverse($statusList);
        }

        return array_values($statusList);
    }
316423
public function get_label($strict = false)
	{
		if ($this->label === null && $strict !== true)
		{
			return $this->get_term();
		}
		return $this->label;
	}
465919
public function cleanUri($uri, $strict = false)
	{
		$filters = $this->config['uri_filter'];
		$filters = is_array($filters) ? $filters : array($filters);

		if ($strict)
		{
			$uri = preg_replace(array("/\.+\//", '/\/+/'), '/', $uri);
		}

		return $this->clean($uri, $filters);
	}
1066991
public static function json($val, $strict = true): bool
    {
        if (!$val || (!\is_string($val) && !\method_exists($val, '__toString'))) {
            return false;
        }

        $val = (string)$val;

        // must start with: { OR [
        if ($strict && '[' !== $val[0] && '{' !== $val[0]) {
            return false;
        }

        \json_decode($val);

        return \json_last_error() === \JSON_ERROR_NONE;
    }
141287
public static function strtoupper($str, bool $strict=false) {
		ref\mb::strtoupper($str, $strict);
		return $str;
	}
1322738
public function get($strict=FALSE) 
    {
      if ($strict && $this->dispatched)
        throw new \CatapultApiException("Already got data from packet");	

      $this->dispatched = true;

      if ($this->is_string())
          return $this->data[0];

      return $this->data;
    }
1120424
protected function parse($strict = TRUE) {
        if(!$arguments = $this->flags->args()) {
            $message  = "Module not specified.\n";
            $message .= "\n";
            $message .= "To get help type:\n";
            $message .= "\n";
            $message .= "    {$this->command} ".implode(" ", array_merge($this->arguments, [ "help" ]));
            return $this->printError($message);
        }

        $module = array_shift($arguments);

        // check if we are in help mode
        $is_help = ($module == "help");

        if($is_help) {
            if(!$arguments) {
                $modules = [];
                if(class_exists("Loops\Application\LoopsAdmin\Cache")) $modules[] = "cache";
                if(class_exists("Loops\Application\LoopsAdmin\Jobs"))  $modules[] = "jobs";

                $message  = "Welcome to the Loops admin.\n";
                $message .= "\n";
                $message .= "You can run Loops internal commands via this interface.\n";
                $message .= "Loops internal commands are grouped into modules.\n";
                $message .= "\n";
                $message .= "Available (and known) modules:\n";
                $message .= "\n";
                $message .= $this->ident(implode(", ", $modules))."\n";
                $message .= "\n";
                $message .= "\n";
                $message .= "To get help about a module:\n";
                $message .= "\n";
                $message .= "    {$this->command} [<flags>...] help <module>\n";
                $message .= "\n";
                $message .= "Each module defines action(s) which are listed on the modules help page.\n";
                $message .= "\n";
                $message .= "\n";
                $message .= "To get help about an action:\n";
                $message .= "\n";
                $message .= "    {$this->command} [<flags>...] help <module> <action>\n";
                $message .= "\n";
                $message .= "\n";
                $message .= "Available flags:";
                return $this->printHelp($message);
            }

            // help for this module requested
            $module = array_shift($arguments);
        }

        $classname = "Loops\Application\LoopsAdmin\\".Misc::camelize($module);

        if(!class_exists($classname)) {
            return $this->printError("Module not found: $module");
        }

        $annotations = $this->getLoops()->getService("annotations")->get($classname);

        if(!$arguments) {
            if($is_help) {
                if(!$help = $annotations->findFirst("Admin\Help")) {
                    return $this->printError("Module '$module' does not define a help message.");
                }

                $actions = [];

                foreach($annotations->methods as $method => $method_annotations) {
                    if(!$method_annotations->findFirst("Admin\Action")) continue;
                    $actions[] = Misc::underscore($method);
                }

                $message  = "Help for module '$module':\n";
                $message .= "\n";
                $message .= $this->ident($help->help)."\n";
                $message .= "\n";
                $message .= "\n";
                $message .= "Available actions:\n";
                $message .= "\n";
                $message .= $this->ident($actions ? implode(", ", $actions) : "No actions defined.")."\n";
                $message .= "\n";
                $message .= "\n";
                $message .= "To get help about an action:\n";
                $message .= "\n";
                $message .= "    {$this->command} [<flags>...] help $module <action>\n";
                $message .= "\n";
                $message .= "\n";
                $message .= "Available flags:";
                return $this->printHelp($message);
            }
            else {
                return $this->printError("Action not specified for module '$module'.");
            }
        }

        $action = array_shift($arguments);
        $method = lcfirst(Misc::camelize($action));

        if(empty($annotations->methods->$method) || !$action_annotation = $annotations->methods->$method->findFirst("Admin\Action")) {
            return $this->printError("Module '$module' does not support action: $action");
        }

        $instance = new $classname($this->getLoops());

        if($action_annotation->init_flags) {
            if(!method_exists($instance, $action_annotation->init_flags)) {
                throw new Exception("Failed to init flags. Method '{$action_annotation->init}' is not defined.");
            }

            Misc::reflectionFunction([$instance, $action_annotation->init_flags], [$this->flags]);
        }

        if($is_help) {
            if(!$help = $annotations->methods->$method->findFirst("Admin\Help")) {
                return $this->printError("Action '$action' of module '$module' does not define a help message.");
            }

            $message  = "Usage:\n";
            $message .= "\n";
            $message .= "    {$this->command} [<flags>...] $module $action".($action_annotation->arguments ? " {$action_annotation->arguments}" : "")."\n";
            $message .= "\n";
            $message .= "\n";
            $message .= "Help for action '$module $action':\n";
            $message .= "\n";
            $message .= $this->ident($help->help)."\n";
            $message .= "\n";
            $message .= "\n";
            $message .= "Available flags:";
            return $this->printHelp($message);
        }

        try {
            $result = $this->flags->parse($this->arguments, !$strict, FALSE);
        }
        catch(Exception $e) {
            $message  = $e->getMessage()."\n";
            $message .= "\n";
            $message .= "To get help about this action:\n";
            $message .= "\n";
            $message .= "    {$this->command} help $module $action";
            return $this->printError($message);
        }

        $result = parent::parse();

        if(is_integer($result)) {
            $this->printError("test");
            return $result;
        }

        $result["__arguments"] = $arguments;
        $result["__module"]    = $module;
        $result["__action"]    = $action;

        $result["__instance"]  = $instance;
        $result["__method"]    = $method;

        return $result;
    }