File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed
Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ namespace phpbu \App \Event ;
3+
4+ /**
5+ * Debug Event
6+ *
7+ * @package phpbu
8+ * @subpackage Event
9+ * @author MoeBrowne <moebrowne@users.noreply.github.com>
10+ * @license https://opensource.org/licenses/MIT The MIT License (MIT)
11+ * @link http://phpbu.de/
12+ * @since Class available since Release 6.0.0
13+ */
14+ class Warning
15+ {
16+ /**
17+ * Event name
18+ */
19+ const NAME = 'phpbu.warning ' ;
20+
21+ /**
22+ * Warning message
23+ *
24+ * @var string
25+ */
26+ protected $ message ;
27+
28+ /**
29+ * Constructor.
30+ *
31+ * @param string $message
32+ */
33+ public function __construct (string $ message )
34+ {
35+ $ this ->message = $ message ;
36+ }
37+
38+ /**
39+ * Message getter.
40+ *
41+ * @return string
42+ */
43+ public function getMessage () : string
44+ {
45+ return $ this ->message ;
46+ }
47+ }
Original file line number Diff line number Diff line change @@ -564,4 +564,15 @@ public function debug($msg) : void
564564 $ event = new Event \Debug ($ msg );
565565 $ this ->eventDispatcher ->dispatch (Event \Debug::NAME , $ event );
566566 }
567+
568+ /**
569+ * Warning
570+ *
571+ * @param string $msg
572+ */
573+ public function warn ($ msg ) : void
574+ {
575+ $ event = new Event \Warning ($ msg );
576+ $ this ->eventDispatcher ->dispatch (Event \Warning::NAME , $ event );
577+ }
567578}
You can’t perform that action at this time.
0 commit comments