src/Charcoal/Admin/Ui/FeedbackContainerTrait.php
public function feedbacks($level = null)
    {
        if ($level !== null) {
            if (!is_string($level)) {
                throw new InvalidArgumentException('The feedback level must be a string');
            }

            $level = $this->resolveFeedbackLevel($level);

            $subset = [];
            foreach ($this->feedbacks as $item) {
                if ($item['level'] === $level) {
                    $subset[] = $item;
                }
            }

            return $subset;
        }

        return $this->feedbacks;
    }
public function feedbacks($level = null)
    {
        if ($level !== null) {
            if (!is_string($level)) {
                throw new InvalidArgumentException('The feedback level must be a string');
            }

            $level = $this->resolveFeedbackLevel($level);

            $subset = [];
            foreach ($this->feedbacks as $item) {
                if ($item['level'] === $level) {
                    $subset[] = $item;
                }
            }

            return $subset;
        }

        return $this->feedbacks;
    }
public function feedbacks ( $ level = null ) { if ( $ level !== null ) { if ( ! is_string ( $ level ) ) { throw new InvalidArgumentException ( 'The feedback level must be a string' ) ; } $ level = $ this -> resolveFeedbackLevel ( $ level ) ; $ subset = [ ] ; foreach ( $ this -> feedbacks as $ item ) { if ( $ item [ 'level' ] === $ level ) { $ subset [ ] = $ item ; } } return $ subset ; } return $ this -> feedbacks ; }
Retrieve the feedback collection.

Optionally retrieve only the feedback for the given level.

@param  string|null $level Optional level to filter collection.
@throws InvalidArgumentException If the feedback level is invalid.
@return array
Retrieve the feedback collection .