Add SetcookieRector

This commit is contained in:
USAMI Kenta 2020-01-21 23:55:01 +09:00
parent b5a6f1955b
commit d6effd60d4

View File

@ -1,4 +1,4 @@
# All 442 Rectors Overview
# All 443 Rectors Overview
- [Projects](#projects)
- [General](#general)
@ -6201,6 +6201,24 @@ Changes heredoc/nowdoc that contains closing word to safe wrapper name
<br>
### `SetcookieRector`
- class: `Rector\Php73\Rector\FuncCall\SetcookieRector`
Convert setcookie argument to PHP7.3 option array
```diff
-setcookie('name', $value, 360);
+setcookie('name', $value, ['expires' => 360]);
```
```diff
-setcookie('name', $name, 0, '', '', true, true);
+setcookie('name', $name, ['expires' => 0, 'path' => '', 'domain' => '', 'secure' => true, 'httponly' => true]);
```
<br>
### `StringifyStrNeedlesRector`
- class: `Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector`