Fork me on GitHub
a Sensio Labs Product

Remote Void (v2.18.1) edition

Rule date_time_immutable

Class DateTimeImmutable should be used instead of DateTime.


Using this rule is risky.

Risky when the code relies on modifying DateTime objects or if any of the date_create* functions are overridden.


Example #1

--- Original
+++ New
@@ -1,2 +1,2 @@
-new DateTime();
+new DateTimeImmutable();
The logo is © 2010-2014 Sensio Labs