1 | <?php |
||
24 | final class CookieSettings extends Nette\Object |
||
25 | { |
||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $name; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | private $domain; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | private $expire; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | private $path; |
||
45 | |||
46 | /** |
||
47 | * @var bool |
||
48 | */ |
||
49 | private $secure; |
||
50 | |||
51 | /** |
||
52 | * @var bool |
||
53 | */ |
||
54 | private $httpOnly; |
||
55 | |||
56 | /** |
||
57 | * @param string $name The name of the cookie |
||
58 | * @param string $expireAfter The time the cookie expires |
||
59 | * @param string $path The path on the server in which the cookie will be available on |
||
60 | * @param string $domain The domain that the cookie is available to |
||
61 | * @param bool $secure Whether the cookie should only be transmitted over a secure HTTPS connection from the client |
||
62 | * @param bool $httpOnly Whether the cookie will be made accessible only through the HTTP protocol |
||
63 | * |
||
64 | * @throws Exceptions\InvalidArgumentException |
||
65 | */ |
||
66 | public function __construct(string $name, string $domain = NULL, string $expireAfter = NULL, string $path = '/', bool $secure = FALSE, bool $httpOnly = TRUE) |
||
90 | |||
91 | /** |
||
92 | * Gets the name of the cookie |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | public function getName() : string |
||
100 | |||
101 | /** |
||
102 | * Gets the domain that the cookie is available to |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getDomain() : string |
||
110 | |||
111 | /** |
||
112 | * Gets the time the cookie expires |
||
113 | * |
||
114 | * @return int |
||
115 | */ |
||
116 | public function getExpiresTime() : int |
||
120 | |||
121 | /** |
||
122 | * Gets the path on the server in which the cookie will be available on |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | public function getPath() : string |
||
130 | |||
131 | /** |
||
132 | * Checks whether the cookie should only be transmitted over a secure HTTPS connection from the client |
||
133 | * |
||
134 | * @return bool |
||
135 | */ |
||
136 | public function isSecure() : bool |
||
140 | |||
141 | /** |
||
142 | * Checks whether the cookie will be made accessible only through the HTTP protocol |
||
143 | * |
||
144 | * @return bool |
||
145 | */ |
||
146 | public function isHttpOnly() : bool |
||
150 | } |
||
151 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.