Session/src/Message.php
public function all($scope = null)
    {
        if ($scope === null) {
            return array_values($this->messages);
        }

        $messages = array();
        foreach ($this->messages as $message) {
            if ($message['scope'] === $scope) {
                $messages[] = $message;
            }
        }

        return $messages;
    }
public function all($scope = null)
    {
        if ($scope === null) {
            return array_values($this->messages);
        }

        $messages = array();
        foreach ($this->messages as $message) {
            if ($message['scope'] === $scope) {
                $messages[] = $message;
            }
        }

        return $messages;
    }
public function all ( $ scope = null ) { if ( $ scope === null ) { return array_values ( $ this -> messages ) ; } $ messages = array ( ) ; foreach ( $ this -> messages as $ message ) { if ( $ message [ 'scope' ] === $ scope ) { $ messages [ ] = $ message ; } } return $ messages ; }
Fetch all messages.

@param string $scope
@return array
Fetch all messages .