Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix-namespaced-compact' of https://github.com/radmen/phpmd
- Loading branch information
Showing
10 changed files
with
149 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...files/Rule/UnusedFormalParameter/test_namespaced_compact_function_rule_does_not_apply.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace PHPMDTest; | ||
|
||
class test_namespaced_compact_function_rule_does_not_apply | ||
{ | ||
public function test_namespaced_compact_function_rule_does_not_apply($foo, $bar) | ||
{ | ||
return compact('foo', 'bar'); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...FormalParameter/test_namespaced_compact_function_rule_only_applies_to_used_parameters.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace PHPMDTest; | ||
|
||
class test_namespaced_compact_function_rule_only_applies_to_used_parameters | ||
{ | ||
public function test_namespaced_compact_function_rule_only_applies_to_used_parameters($foo, $bar, $baz) | ||
{ | ||
return compact('bar'); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...le/UnusedFormalParameter/test_namespaced_compact_function_rule_works_case_insensitive.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace PHPMDTest; | ||
|
||
class test_namespaced_compact_function_rule_works_case_insensitive | ||
{ | ||
public function test_namespaced_compact_function_rule_works_case_insensitive($foo, $bar) | ||
{ | ||
return Compact('foo', 'bar'); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ources/files/Rule/UnusedLocalVariable/testRuleDoesNotApplyToNamespacedCompactFunction.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace PHPMDTest; | ||
|
||
class testRuleDoesNotApplyToNamespacedCompactFunction | ||
{ | ||
public function testRuleDoesNotApplyToNamespacedCompactFunction() | ||
{ | ||
$key = 'ok'; | ||
return compact('key'); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...Rule/UnusedLocalVariable/test_namespaced_compact_function_rule_works_case_insensitive.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace PHPMDTest; | ||
|
||
class test_namespaced_compact_function_rule_works_case_insensitive | ||
{ | ||
public function test_namespaced_compact_function_rule_works_case_insensitive() | ||
{ | ||
$foo = 1; $bar = 2; $baz = 0; | ||
|
||
return Compact('foo', 'bar', 'baz'); | ||
} | ||
} |