PHP Class Potsky\LaravelLocalizationHelpers\Factory\MessageBag

Inheritance: implements Potsky\LaravelLocalizationHelpers\Factory\MessageBagInterface
Mostra file Open project: potsky/laravel-localization-helpers Class Usage Examples

Public Methods

Method Description
deleteMessages ( ) Clean the bag by removing all messages
getMessage ( array $message ) : mixed Get the message text
getMessageType ( array $message ) : mixed Get the message type of a message get by getMessages
getMessages ( ) : array Get all messages as an array
hasMessages ( ) : boolean Tell whether or not this bag has pending messages
writeComment ( string $s ) : void Add a comment message
writeError ( string $s ) : void Add an error message
writeInfo ( string $s ) : void Add an info message
writeLine ( string $s ) : void Add a simple message
writeQuestion ( string $s ) : void Add a question message

Protected Methods

Method Description
cleanMessage ( string $m ) : string Trim and remove all XML tags

Method Details

cleanMessage() protected method

Trim and remove all XML tags
protected cleanMessage ( string $m ) : string
$m string the message to clean
return string

deleteMessages() public method

Clean the bag by removing all messages
public deleteMessages ( )

getMessage() public method

Get the message text
public getMessage ( array $message ) : mixed
$message array
return mixed

getMessageType() public method

Get the message type of a message get by getMessages
public getMessageType ( array $message ) : mixed
$message array
return mixed

getMessages() public method

Use getMessageType and getMessage to parse a message
public getMessages ( ) : array
return array

hasMessages() public method

Tell whether or not this bag has pending messages
public hasMessages ( ) : boolean
return boolean

writeComment() public method

Add a comment message
public writeComment ( string $s ) : void
$s string the message to display
return void

writeError() public method

Add an error message
public writeError ( string $s ) : void
$s string the message to display
return void

writeInfo() public method

Add an info message
public writeInfo ( string $s ) : void
$s string the message to display
return void

writeLine() public method

Add a simple message
public writeLine ( string $s ) : void
$s string the message to display
return void

writeQuestion() public method

Add a question message
public writeQuestion ( string $s ) : void
$s string the message to display
return void