Skip to content

Commit

Permalink
Changelog for squizlabs#2237 (ref squizlabs#2232)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Nov 26, 2018
1 parent 3be09c6 commit ffefbcd
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 33 deletions.
2 changes: 2 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Squiz.Commenting.InlineComment now has better detection of comment block boundaries
- Squiz.Classes.ClassFileName now checks that a trait name matches the filename
-- Thanks to Chris Wilkinson for the patch
- Squiz.Classes.SelfMemberReference now supports scoped declarations and anonymous classes
-- Thanks to Juliette Reinders Folmer for the patch
- Squiz.Classes.SelfMemberReference now fixes multiple errors at once, increasing fixer performance
-- Thanks to Gabriel Ostrolucký for the patch
- Squiz.Functions.LowercaseFunctionKeywords now checks abstract and final prefixes, and auto-fixes errors
Expand Down
34 changes: 17 additions & 17 deletions src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,17 @@ class Baz {

class Nested_Anon_Class {
public function getAnonymousClass() {
// Spacing/comments should not cause false negatives for the NotUsed error.
// Spacing/comments should not cause false negatives for the NotUsed error.
Nested_Anon_Class :: $prop;
Nested_Anon_Class
/* some comment */
Nested_Anon_Class
/* some comment */

::
::

// phpcs:ignore Standard.Category.SniffName -- for reasons.
Bar();
// phpcs:ignore Standard.Category.SniffName -- for reasons.
Bar();

// Anonymous class is a different scope.
// Anonymous class is a different scope.
return new class() {
public function nested_function() {
Nested_Anon_Class::$prop;
Expand All @@ -157,18 +157,18 @@ class Nested_Anon_Class {

// Test dealing with scoped namespaces.
namespace Foo\Baz {
class BarFoo {
public function foo() {
echo Foo\Baz\BarFoo::$prop;
}
}
class BarFoo {
public function foo() {
echo Foo\Baz\BarFoo::$prop;
}
}
}

// Prevent false negative when namespace has whitespace/comments.
namespace Foo /*comment*/ \ Bah {
class BarFoo {
public function foo() {
echo Foo \ /*comment*/ Bah\BarFoo::$prop;
}
}
class BarFoo {
public function foo() {
echo Foo \ /*comment*/ Bah\BarFoo::$prop;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ class Baz {

class Nested_Anon_Class {
public function getAnonymousClass() {
// Spacing/comments should not cause false negatives for the NotUsed error.
// Spacing/comments should not cause false negatives for the NotUsed error.
self::$prop;
/* some comment */
/* some comment */

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

// Anonymous class is a different scope.
// Anonymous class is a different scope.
return new class() {
public function nested_function() {
Nested_Anon_Class::$prop;
Expand All @@ -145,18 +145,18 @@ class Nested_Anon_Class {

// Test dealing with scoped namespaces.
namespace Foo\Baz {
class BarFoo {
public function foo() {
echo self::$prop;
}
}
class BarFoo {
public function foo() {
echo self::$prop;
}
}
}

// Prevent false negative when namespace has whitespace/comments.
namespace Foo /*comment*/ \ Bah {
class BarFoo {
public function foo() {
echo /*comment*/ self::$prop;
}
}
class BarFoo {
public function foo() {
echo /*comment*/ self::$prop;
}
}
}

0 comments on commit ffefbcd

Please sign in to comment.