1 | <?php |
||
6 | class MessageFactory |
||
7 | { |
||
8 | |||
9 | protected $constructors; |
||
10 | |||
11 | public function register($command, callable $generator) |
||
15 | |||
16 | /** |
||
17 | * @param string $raw |
||
18 | * @param ConnectionInterface $connection |
||
19 | * @return MessageInterface |
||
20 | */ |
||
21 | public function getMessageFromRaw($raw, ConnectionInterface $connection = null) |
||
28 | |||
29 | /** |
||
30 | * @param string $raw_message |
||
31 | */ |
||
32 | public function deconstructRaw($raw_message) |
||
59 | |||
60 | /** |
||
61 | * @param string $command |
||
62 | * @param string $prefix |
||
63 | * @param array $params |
||
64 | * @param ConnectionInterface $connection |
||
65 | * @return GenericMessage |
||
66 | */ |
||
67 | public function make($command, $prefix = "", array $params = array(), ConnectionInterface $connection = null) |
||
82 | |||
83 | protected function constructPrivmsg($command, $prefix, $params, $connection) |
||
87 | |||
88 | protected function constructPing($command, $prefix, $params, $connection) |
||
92 | |||
93 | } |
||
94 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: