src/Charcoal/Admin/Ui/FeedbackContainerTrait.php
final protected function parseFeedback(array $entry)
    {
        $fid = $this->generateFeedbackEntryId();
        $entry['id'] = $fid;

        $entry = $this->parseFeedbackEntry($entry);

        if (empty($entry['id']) || $entry['id'] !== $fid) {
            throw new UnexpectedValueException('The unique ID assigned to the feedback must not be changed.');
        }

        if (empty($entry['level']) || empty($entry['message'])) {
            throw new InvalidArgumentException('Feedback requires a "level" and a "message".');
        }

        $entry['type']  = $this->resolveFeedbackType($entry['level']);
        $entry['level'] = $this->resolveFeedbackLevel($entry['level']);

        return $entry;
    }
final protected function parseFeedback(array $entry)
    {
        $fid = $this->generateFeedbackEntryId();
        $entry['id'] = $fid;

        $entry = $this->parseFeedbackEntry($entry);

        if (empty($entry['id']) || $entry['id'] !== $fid) {
            throw new UnexpectedValueException('The unique ID assigned to the feedback must not be changed.');
        }

        if (empty($entry['level']) || empty($entry['message'])) {
            throw new InvalidArgumentException('Feedback requires a "level" and a "message".');
        }

        $entry['type']  = $this->resolveFeedbackType($entry['level']);
        $entry['level'] = $this->resolveFeedbackLevel($entry['level']);

        return $entry;
    }
final protected function parseFeedback ( array $ entry ) { $ fid = $ this -> generateFeedbackEntryId ( ) ; $ entry [ 'id' ] = $ fid ; $ entry = $ this -> parseFeedbackEntry ( $ entry ) ; if ( empty ( $ entry [ 'id' ] ) || $ entry [ 'id' ] !== $ fid ) { throw new UnexpectedValueException ( 'The unique ID assigned to the feedback must not be changed.' ) ; } if ( empty ( $ entry [ 'level' ] ) || empty ( $ entry [ 'message' ] ) ) { throw new InvalidArgumentException ( 'Feedback requires a "level" and a "message".' ) ; } $ entry [ 'type' ] = $ this -> resolveFeedbackType ( $ entry [ 'level' ] ) ; $ entry [ 'level' ] = $ this -> resolveFeedbackLevel ( $ entry [ 'level' ] ) ; return $ entry ; }
Parse a feedback entry.

@param  array $entry A dataset describing the feedback entry.
@throws InvalidArgumentException If the feedback entry is invalid.
@throws UnexpectedValueException If the feedback entry ID was altered.
@return array A parsed feedback entry.
Parse a feedback entry .