public function validateWildCards($input, $errorClass = '')
    {
        preg_match_all('@\{.*?\}}@',  $input, $matches);
        $notDefined = [];

        if($matches) {
            foreach ($matches as $match) {
                foreach ($match as $wildcard) {
                    if (!array_key_exists($wildcard, $this->getWildcards())) {
                        $notDefined[] = $wildcard;
                    }
                }
            }
        }

        if($notDefined) {
            throw new \Exception('Not defined wildcards "'.implode($notDefined, ', ').'". '.($errorClass ? 'Please declare them on "metaData" method of "'.$errorClass.'".' : ''));
        }

        return true;
    }
public function validateWildCards($input, $errorClass = '')
    {
        preg_match_all('@\{.*?\}}@',  $input, $matches);
        $notDefined = [];

        if($matches) {
            foreach ($matches as $match) {
                foreach ($match as $wildcard) {
                    if (!array_key_exists($wildcard, $this->getWildcards())) {
                        $notDefined[] = $wildcard;
                    }
                }
            }
        }

        if($notDefined) {
            throw new \Exception('Not defined wildcards "'.implode($notDefined, ', ').'". '.($errorClass ? 'Please declare them on "metaData" method of "'.$errorClass.'".' : ''));
        }

        return true;
    }
public function validateWildCards ( $ input , $ errorClass = '' ) { preg_match_all ( '@\{.*?\}}@' , $ input , $ matches ) ; $ notDefined = [ ] ; if ( $ matches ) { foreach ( $ matches as $ match ) { foreach ( $ match as $ wildcard ) { if ( ! array_key_exists ( $ wildcard , $ this -> getWildcards ( ) ) ) { $ notDefined [ ] = $ wildcard ; } } } } if ( $ notDefined ) { throw new \ Exception ( 'Not defined wildcards "' . implode ( $ notDefined , ', ' ) . '". ' . ( $ errorClass ? 'Please declare them on "metaData" method of "' . $ errorClass . '".' : '' ) ) ; } return true ; }
Check if there is any undefined wildcard

@param string $input
@param string $errorClass the class where the wildcard should be defined (if validation doesn't pass)

@return boolean
@throws Exception
Check if there is any undefined wildcard