1 | <?php |
||
28 | class Configuration |
||
29 | { |
||
30 | /** |
||
31 | * Implement nette smart magic |
||
32 | */ |
||
33 | use Nette\SmartObject; |
||
34 | |||
35 | /** |
||
36 | * @var string|NULL |
||
37 | */ |
||
38 | private $redirectUrl; |
||
39 | |||
40 | /** |
||
41 | * @var Application\LinkGenerator |
||
42 | */ |
||
43 | private $linkGenerator; |
||
44 | |||
45 | /** |
||
46 | * @param string|NULL $redirectUrl |
||
47 | * @param Application\LinkGenerator $linkGenerator |
||
48 | */ |
||
49 | public function __construct(string $redirectUrl = NULL, Application\LinkGenerator $linkGenerator) |
||
54 | |||
55 | /** |
||
56 | * Build the URL for redirection if is set |
||
57 | * |
||
58 | * @param array $params |
||
59 | * |
||
60 | * @return string|NULL |
||
61 | * |
||
62 | * @throws Application\UI\InvalidLinkException |
||
63 | */ |
||
64 | public function getRedirectUrl(array $params = []) |
||
72 | } |
||
73 |
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: