StackFormation\Helper\Finder::find PHP Method

find() public static method

public static find ( $wildcardPatterns, array $choices )
$choices array
    public static function find($wildcardPatterns, array $choices)
    {
        if (!is_array($wildcardPatterns)) {
            $wildcardPatterns = [$wildcardPatterns];
        }
        $found = [];
        foreach ($choices as $choice) {
            foreach ($wildcardPatterns as $wildcardPattern) {
                if (self::matchWildcard($wildcardPattern, $choice)) {
                    $found[] = $choice;
                }
            }
        }
        $found = array_unique($found);
        return $found;
    }

Usage Example

 protected function getResolvedStacks(InputInterface $input)
 {
     $stacks = Finder::find((array) $input->getArgument('stack'), $this->getStacks());
     $except = $input->getOption('except');
     if (!empty($except)) {
         if (($key = array_search($except, $stacks)) !== false) {
             unset($stacks[$key]);
         }
     }
     return $stacks;
 }
All Usage Examples Of StackFormation\Helper\Finder::find