-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #489 from eeree/issue-401
Added new predefined variables to AbstractLocalVariable rule
- Loading branch information
Showing
3 changed files
with
63 additions
and
12 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
35 changes: 35 additions & 0 deletions
35
...test/resources/files/Rule/UnusedLocalVariable/testRuleNotAppliesToPredefinedVariables.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,35 @@ | ||
<?php | ||
/** | ||
* This file is part of PHP Mess Detector. | ||
* | ||
* Copyright (c) Manuel Pichler <mapi@phpmd.org>. | ||
* All rights reserved. | ||
* | ||
* Licensed under BSD License | ||
* For full copyright and license information, please see the LICENSE file. | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @author Manuel Pichler <mapi@phpmd.org> | ||
* @copyright Manuel Pichler. All rights reserved. | ||
* @license https://opensource.org/licenses/bsd-license.php BSD License | ||
* @link http://phpmd.org/ | ||
*/ | ||
|
||
namespace PHPMDTest; | ||
|
||
class testRuleNotAppliesToPredefinedVariables | ||
{ | ||
public function testRuleNotAppliesToPredefinedVariables() | ||
{ | ||
$foo = 'bar'; | ||
$headers = array(); | ||
foreach ($http_response_header as $header) { | ||
$headers[] = $header; | ||
if (null !== $php_errormsg) { | ||
continue; | ||
} | ||
} | ||
|
||
return $headers; | ||
} | ||
} |