protected function searchUrlPatterns(\stdClass $json, array $patterns)
    {
        $errors = array();
        foreach ($json->packages as $package) {
            if (!isset($package->source)) {
                $this->verbose('Source not found in "' . $package->name . "\"\n", OutputInterface::VERBOSITY_VERBOSE);
                $url = '';
            }else{
                $url = $package->source->url;
            }

            if (!$this->doesUrlMatchToAtLeastOnePattern($url, $patterns)) {
                $errors[$package->name] = $url;
            }
        }

        return $errors;
    }
protected function searchUrlPatterns(\stdClass $json, array $patterns)
    {
        $errors = array();
        foreach ($json->packages as $package) {
            if (!isset($package->source)) {
                $this->verbose('Source not found in "' . $package->name . "\"\n", OutputInterface::VERBOSITY_VERBOSE);
                $url = '';
            }else{
                $url = $package->source->url;
            }

            if (!$this->doesUrlMatchToAtLeastOnePattern($url, $patterns)) {
                $errors[$package->name] = $url;
            }
        }

        return $errors;
    }
protected function searchUrlPatterns ( \ stdClass $ json , array $ patterns ) { $ errors = array ( ) ; foreach ( $ json -> packages as $ package ) { if ( ! isset ( $ package -> source ) ) { $ this -> verbose ( 'Source not found in "' . $ package -> name . "\"\n" , OutputInterface :: VERBOSITY_VERBOSE ) ; $ url = '' ; } else { $ url = $ package -> source -> url ; } if ( ! $ this -> doesUrlMatchToAtLeastOnePattern ( $ url , $ patterns ) ) { $ errors [ $ package -> name ] = $ url ; } } return $ errors ; }
Will return a array of invalid packages and their urls determined by the given patterns.
A url is invalid if NONE of the given patterns has matched.

@param \stdClass $json
@param array $patterns
@return array
Will return a array of invalid packages and their urls determined by the given patterns . A url is invalid if NONE of the given patterns has matched .