Krucas\Notification\NotificationsBag::extractType PHP Method

extractType() protected method

Extract type from a given string.
protected extractType ( $name ) : boolean | array
$name
return boolean | array
    protected function extractType($name)
    {
        if (count($this->types) <= 0) {
            return false;
        }
        foreach ($this->types as $type) {
            foreach ($this->matcher as $function => $pattern) {
                if (str_replace(array('{type}', '{uType}'), array($type, ucfirst($type)), $pattern) === $name) {
                    return array($type, $function);
                }
            }
        }
        return false;
    }

Usage Example

 public function extractType($name)
 {
     return parent::extractType($name);
 }