1 | <?php |
||
9 | class Counter implements CounterInterface |
||
10 | { |
||
11 | const TYPE_LIVE_INTERNET = 'LiveInternet'; |
||
12 | const TYPE_GOOGLE_ANALYTICS = 'Google'; |
||
13 | const TYPE_MEDIASCOPE = 'Mediascope'; |
||
14 | const TYPE_MAIL_RU = 'MailRu'; |
||
15 | const TYPE_RAMBLER = 'Rambler'; |
||
16 | const TYPE_YANDEX = 'Yandex'; |
||
17 | const TYPE_CUSTOM = 'custom'; |
||
18 | |||
19 | private $type; |
||
20 | private $id; |
||
21 | private $url; |
||
22 | |||
23 | 42 | public function __construct($type, $id = null, $url = null) |
|
37 | |||
38 | 12 | public function appendTo(ChannelInterface $channel) |
|
43 | |||
44 | 18 | public function asXML() |
|
55 | } |
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: