public function pop($type): ?\stdClass
    {
        $text = array_shift($this->getMessagesStore()[$type]);
        if ($text) {
            $message = new \stdClass();
            $message->text = $text;
            $message->type = $type;
            return $message;
        }
        return null;
    }
public function pop($type): ?\stdClass
    {
        $text = array_shift($this->getMessagesStore()[$type]);
        if ($text) {
            $message = new \stdClass();
            $message->text = $text;
            $message->type = $type;
            return $message;
        }
        return null;
    }
public function pop ( $ type ) : ? \ stdClass { $ text = array_shift ( $ this -> getMessagesStore ( ) [ $ type ] ) ; if ( $ text ) { $ message = new \ stdClass ( ) ; $ message -> text = $ text ; $ message -> type = $ type ; return $ message ; } return null ; }
Pop a message by type

@param  string $type

@return \stdClass|null
Pop a message by type