for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Rojtjo\Notifier;
class Notification
{
/**
* @var string
*/
private $type;
private $message;
* @param string $type
* @param string $message
public function __construct($type, $message)
$this->type = $type;
$this->message = $message;
}
* @param array $data
* @return Notification
public static function fromArray(array $data)
return new Notification(
$data['type'],
$data['message']
);
public static function success($message)
return new Notification('success', $message);
public static function error($message)
return new Notification('error', $message);
public static function warning($message)
return new Notification('warning', $message);
public static function info($message)
return new Notification('info', $message);
* @return string
public function getType()
return $this->type;
public function getMessage()
return $this->message;