| 1 | <?php |
||
| 5 | trait InteractsWithCookies |
||
| 6 | { |
||
| 7 | /** {@inheritdoc} */ |
||
| 8 | public function cookie($name, $value = null, $expiry = null, array $options = []) |
||
| 14 | |||
| 15 | /** {@inheritdoc} */ |
||
| 16 | public function plainCookie($name, $value = null, $expiry = null, array $options = []) |
||
| 22 | |||
| 23 | /** {@inheritdoc} */ |
||
| 24 | public function addCookie($name, $value, $expiry = null, array $options = [], $encrypt = true) |
||
| 30 | |||
| 31 | /** {@inheritdoc} */ |
||
| 32 | public function deleteCookie($name) |
||
| 38 | } |
||
| 39 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: