Process the current FileBag and return an array
@param bool $ns
@param bool $strict
@return array
424853
public function process($ns = true, $strict = true)
    {
        return $this->decodedData = $this->decodeFileBagData($this->fileBag, $ns, $strict);
    }
1293323
public function whereIn($key, $values, $strict = false)
    {
        $values = $this->getArrayableItems($values);

        return $this->filter(function ($item) use ($key, $values, $strict) {
            return \in_array(Helper::data_get($item, $key), $values, $strict);
        });
    }
101732
public static function deserialize( $xml, $strict = TRUE )
	{
		$parser	= new XML_DOM_Parser();
		$tree	= $parser->parse( $xml );
		$class	= $tree->getAttribute( 'class' );
		if( !class_exists( $class ) )
			throw new Exception( 'Class "'.$class.'" has not been loaded, yet.' );
		$object	= new $class();
		self::deserializeVarsRec( $tree->getChildren(), $object );
		return $object;
	}
79817
public function get($key, $strict = true, $default = null) {
        if (array_key_exists($key, $this->storage)) {
            return $this->storage[$key];
        }
        if ($strict) {
            throw new CacheMissException($key);
        }
        return $default;
    }
27267
public function parseString($string, $strict = true) {
        $parser = new ArgumentsParser();
        $matcher = new ArgumentsMatcher($parser);
        $args = $parser->parse($string);
        $args = $parser->group($args);

        return $matcher->matchOption($this, $args, $strict);
    }
591709
public function parseArray(array $arguments, bool $strict = false) : array
    {
        $short_options = [];
        foreach($this->options as $long_option => $spec)
        {
            if (isset($spec['alias'])){
                $alias = $spec['alias'];
                $short_options[$alias] = $long_option;
            }
        }

        $ret = [];
        $option_is_set = false;
        $option = '';
        $ignore_value = false;
        foreach($arguments as $arg)
    {
            if (($pos=strpos($arg,'--')) === 0){
                // this is a long option key
                if ($option_is_set && !$ignore_value){
                    $ret = $this->updateParseResult($ret, $option, '');
                }
                $option = substr($arg, 2);
                $option_is_set = true;
                if ($strict){
                    $option_is_defined = isset($this->options[$option]);
                    $ignore_value = !$option_is_defined;
                }
            }
            else if (($pos=strpos($arg,'-')) === 0){
                // this is a short option key
                if ($option_is_set && !$ignore_value){
                    $ret = $this->updateParseResult($ret, $option, '');
                }
                $option = substr($arg, 1);
                $option_is_set = true;
                if ($strict){
                    $option_is_defined = in_array($option, array_keys($short_options));
                    $ignore_value = !$option_is_defined;
                    $option = $short_options[$option] ?? $option;
                }
            }
            else if ($option_is_set){
                if (!$ignore_value){
                    $ret = $this->updateParseResult($ret, $option, $arg);
                }
                $option_is_set = false;
            }
            else{
                // this is a sequential option
                $ret['ordered'][] = $arg;
            }
        }
        if ($option_is_set && !$ignore_value){
            $ret = $this->updateParseResult($ret, $option, '');
        }
        return $ret;
    }
819237
public function search($value, $strict = false)
    {
        if (! $this->useAsCallable($value)) {
            return array_search($value, $this->items, $strict);
        }

        foreach ($this->items as $key => $item) {
            if (call_user_func($value, $item, $key)) {
                return $key;
            }
        }

        return false;
    }
1217137
public function getFiles(string $name = null) : array
    {
        if ($name === null) {
            return $this->files;
        }

        $files = $this->resolvePath($this->files, $name);

        if ($files instanceof UploadedFile) {
            return [$files];
        }

        if (is_array($files)) {
            return array_filter($files, static function ($file) {
                return $file instanceof UploadedFile;
            });
        }

        return [];
    }
239837
public function processNode(Node $node, Scope $scope): array
    {
        if ('__construct' !== $node->name->toLowerString()) {
            return [];
        }

        if (0 === \count($node->params)) {
            return [];
        }

        $params = \array_filter($node->params, static function (Node\Param $node): bool {
            return null !== $node->default;
        });

        if (0 === \count($params)) {
            return [];
        }

        /** @var Reflection\ClassReflection $classReflection */
        $classReflection = $scope->getClassReflection();

        if ($classReflection->isAnonymous()) {
            return \array_map(static function (Node\Param $node): string {
                /** @var Node\Expr\Variable $variable */
                $variable = $node->var;

                /** @var string $parameterName */
                $parameterName = $variable->name;

                return \sprintf(
                    'Constructor in anonymous class has parameter $%s with default value.',
                    $parameterName
                );
            }, $params);
        }

        $className = $classReflection->getName();

        return \array_map(static function (Node\Param $node) use ($className): string {
            /** @var Node\Expr\Variable $variable */
            $variable = $node->var;

            /** @var string $parameterName */
            $parameterName = $variable->name;

            return \sprintf(
                'Constructor in %s has parameter $%s with default value.',
                $className,
                $parameterName
            );
        }, $params);
    }
803956
function getFiles(res, pattern, options) {
  var files = res.split(/\r?\n/).filter(Boolean);
  if (files.length === 1 && files[0] === pattern) {
    files = [];
  } else if (options.realpath === true || options.follow === true) {
    files = toAbsolute(files, options);
  }
  if (files.length === 0) {
    if (options.nullglob === true) {
      return [pattern];
    }
    if (options.failglob === true) {
      return new Error('no matches:' + pattern);
    }
  }

  return files.filter(function(filepath) {
    return filepath !== '.' && filepath !== '..';
  });
}
1361048
public function removeDuplicates($strict = false) {
		$field = $strict ? 'message' : 'summary';

		$query = $this->find();
		$options = [
			'fields' => ['type', $field, 'count' => $query->func()->count('*')],
			'conditions' => [],
			'group' => ['type', $field],
			//'having' => $this->alias . '__count > 0',
			//'order' => ['created' => 'DESC']
		];
		$logs = $query->find('all', $options)->disableHydration()->toArray();

		$count = 0;
		foreach ($logs as $key => $log) {
			if ($log['count'] <= 1) {
				continue;
			}
			$options = [
				'fields' => ['id'],
				'keyField' => 'id',
				'valueField' => 'id',
				'conditions' => [
					'type' => $log['type'],
					$field => $log[$field],
				],
				'order' => ['created' => 'DESC']
			];
			$entries = $this->find('list', $options)->toArray();

			// keep the newest entry
			$keep = array_shift($entries);
			if ($entries) {
				$this->deleteAll(['id IN' => $entries]);
			}
			$count += $this->updateAll(['count = count + ' . count($entries)], ['id' => $keep]);
		}

		return $count;
	}
881751
public function formatOptions(bool $strict = false, bool $noBraces = false)
    {
        $colors = [];
        $default = 0;
        foreach ($this->datasets as $dataset) {
            $color = $this->default_colors[$default];
            if (array_key_exists('color', $dataset->options)) {
                $color = $dataset->options['color'];
                unset($dataset->options['color']);
            } else {
                $default++;
            }
            array_push($colors, $color);
        }

        $this->options([
            'colors' => $colors,
        ]);

        return parent::formatOptions($strict, $noBraces);
    }
210841
public function parseArgv(array $argv = null, $strict = true) {
        if ( ! is_array($argv)) {
            global $argv;
        }

        return $this->parseArgs(array_slice($argv, 1), $strict);
    }
1031850
protected function scanDirectoryFiles($path, $ns, $module)
    {
        $files = [];
        foreach (scandir($path) as $file) {
            if (substr($file, 0, 1) !== '.') {
                $files[] = [
                    'file' => $file,
                    'module' => $module,
                    'ns' => $ns.'\\'.pathinfo($file, PATHINFO_FILENAME),
                ];
            }
        }
        
        return $files;
    }
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));
	}
988705
public static function inArray($needle, $haystack, $strict = NULL)
	{
		return static::is_array($haystack) && in_array($needle, $haystack, $strict);
	}
867142
public function getFileName($strict = false)
  {
    if (!$this->hasFileName()) {
      if ($strict) {
        return false;
      }

      $arr = $this->getArguments();

      return current(array_slice($arr, -1));
    }

    return $this->file_name;
  }