private function filterScanners($scanners)
    {
        $scannerInstances = [];
        $scanners = is_array($scanners) ? $scanners : [$scanners];
        foreach ($scanners as $key => $scanner) {
            if (!is_a($scanner, ScannerInterface::class, true)) {
                throw new \InvalidArgumentException(
                    "The passed scanner with key `$key` doesn't seem to be either a valid ".ScannerInterface::class.
                    ' instance or extended class'
                );
            }

            $scannerInstances[] = $scanner instanceof ScannerInterface
                ? $scanner
                : new $scanner();
        }

        return $scannerInstances;
    }
private function filterScanners($scanners)
    {
        $scannerInstances = [];
        $scanners = is_array($scanners) ? $scanners : [$scanners];
        foreach ($scanners as $key => $scanner) {
            if (!is_a($scanner, ScannerInterface::class, true)) {
                throw new \InvalidArgumentException(
                    "The passed scanner with key `$key` doesn't seem to be either a valid ".ScannerInterface::class.
                    ' instance or extended class'
                );
            }

            $scannerInstances[] = $scanner instanceof ScannerInterface
                ? $scanner
                : new $scanner();
        }

        return $scannerInstances;
    }
private function filterScanners ( $ scanners ) { $ scannerInstances = [ ] ; $ scanners = is_array ( $ scanners ) ? $ scanners : [ $ scanners ] ; foreach ( $ scanners as $ key => $ scanner ) { if ( ! is_a ( $ scanner , ScannerInterface :: class , true ) ) { throw new \ InvalidArgumentException ( "The passed scanner with key `$key` doesn't seem to be either a valid " . ScannerInterface :: class . ' instance or extended class' ) ; } $ scannerInstances [ ] = $ scanner instanceof ScannerInterface ? $ scanner : new $ scanner ( ) ; } return $ scannerInstances ; }
Filters and validates the passed scanners.

This method makes sure that all scanners given are turned into their respective instances.

@param $scanners

@return array
Filters and validates the passed scanners .