Skip to content

Commit ffefbcd

Browse files
committed
Changelog for #2237 (ref #2232)
1 parent 3be09c6 commit ffefbcd

File tree

3 files changed

+35
-33
lines changed

3 files changed

+35
-33
lines changed

package.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
116116
- Squiz.Commenting.InlineComment now has better detection of comment block boundaries
117117
- Squiz.Classes.ClassFileName now checks that a trait name matches the filename
118118
-- Thanks to Chris Wilkinson for the patch
119+
- Squiz.Classes.SelfMemberReference now supports scoped declarations and anonymous classes
120+
-- Thanks to Juliette Reinders Folmer for the patch
119121
- Squiz.Classes.SelfMemberReference now fixes multiple errors at once, increasing fixer performance
120122
-- Thanks to Gabriel Ostrolucký for the patch
121123
- Squiz.Functions.LowercaseFunctionKeywords now checks abstract and final prefixes, and auto-fixes errors

src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,17 @@ class Baz {
135135

136136
class Nested_Anon_Class {
137137
public function getAnonymousClass() {
138-
// Spacing/comments should not cause false negatives for the NotUsed error.
138+
// Spacing/comments should not cause false negatives for the NotUsed error.
139139
Nested_Anon_Class :: $prop;
140-
Nested_Anon_Class
141-
/* some comment */
140+
Nested_Anon_Class
141+
/* some comment */
142142

143-
::
143+
::
144144

145-
// phpcs:ignore Standard.Category.SniffName -- for reasons.
146-
Bar();
145+
// phpcs:ignore Standard.Category.SniffName -- for reasons.
146+
Bar();
147147

148-
// Anonymous class is a different scope.
148+
// Anonymous class is a different scope.
149149
return new class() {
150150
public function nested_function() {
151151
Nested_Anon_Class::$prop;
@@ -157,18 +157,18 @@ class Nested_Anon_Class {
157157

158158
// Test dealing with scoped namespaces.
159159
namespace Foo\Baz {
160-
class BarFoo {
161-
public function foo() {
162-
echo Foo\Baz\BarFoo::$prop;
163-
}
164-
}
160+
class BarFoo {
161+
public function foo() {
162+
echo Foo\Baz\BarFoo::$prop;
163+
}
164+
}
165165
}
166166

167167
// Prevent false negative when namespace has whitespace/comments.
168168
namespace Foo /*comment*/ \ Bah {
169-
class BarFoo {
170-
public function foo() {
171-
echo Foo \ /*comment*/ Bah\BarFoo::$prop;
172-
}
173-
}
169+
class BarFoo {
170+
public function foo() {
171+
echo Foo \ /*comment*/ Bah\BarFoo::$prop;
172+
}
173+
}
174174
}

src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc.fixed

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ class Baz {
125125

126126
class Nested_Anon_Class {
127127
public function getAnonymousClass() {
128-
// Spacing/comments should not cause false negatives for the NotUsed error.
128+
// Spacing/comments should not cause false negatives for the NotUsed error.
129129
self::$prop;
130-
131-
/* some comment */
130+
131+
/* some comment */
132132

133-
self::// phpcs:ignore Standard.Category.SniffName -- for reasons.
134-
Bar();
133+
self::// phpcs:ignore Standard.Category.SniffName -- for reasons.
134+
Bar();
135135

136-
// Anonymous class is a different scope.
136+
// Anonymous class is a different scope.
137137
return new class() {
138138
public function nested_function() {
139139
Nested_Anon_Class::$prop;
@@ -145,18 +145,18 @@ class Nested_Anon_Class {
145145

146146
// Test dealing with scoped namespaces.
147147
namespace Foo\Baz {
148-
class BarFoo {
149-
public function foo() {
150-
echo self::$prop;
151-
}
152-
}
148+
class BarFoo {
149+
public function foo() {
150+
echo self::$prop;
151+
}
152+
}
153153
}
154154

155155
// Prevent false negative when namespace has whitespace/comments.
156156
namespace Foo /*comment*/ \ Bah {
157-
class BarFoo {
158-
public function foo() {
159-
echo /*comment*/ self::$prop;
160-
}
161-
}
157+
class BarFoo {
158+
public function foo() {
159+
echo /*comment*/ self::$prop;
160+
}
161+
}
162162
}

0 commit comments

Comments
 (0)