You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?php
class A {
public static $a;
}
A::$a = 'b'; // works
\A::$a = 'c'; // fails
\A\B\C::$d = 'e'; // fails
The last two assignments triggers "Assignments must be the first block of code on a line (Squiz.PHP.DisallowMultipleAssignments.Found)" due to T_NS_SEPARATOR not being considered.
The text was updated successfully, but these errors were encountered:
gsherwood
changed the title
Static class variable assignment fails with namespace separator
Squiz.PHP.DisallowMultipleAssignments false positive when using namespaces with static assignments
Mar 21, 2018
This was a tough one as it was quite an old sniff and required a rewrite to get this working. But all tests are passing and I think it is working now. Thanks for the bug report. The fix will be in the 3.3.0 version, but if you are able to test on your code base before release, it would be really helpful given the large change to the sniff.
In the following snippet:
The last two assignments triggers "Assignments must be the first block of code on a line (Squiz.PHP.DisallowMultipleAssignments.Found)" due to T_NS_SEPARATOR not being considered.
The text was updated successfully, but these errors were encountered: