Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Generic DuplicateClassNameSniff no longer reports an error if multipl…

…e PHP open tags exist in a file
  • Loading branch information...
commit 8d58ddda2a49b5303b55edbe83b3b55a644edd4b 1 parent 4982619
@gsherwood gsherwood authored
View
2  CodeSniffer/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php
@@ -60,7 +60,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
$tokens = $phpcsFile->getTokens();
$namespace = '';
- $stackPtr = $phpcsFile->findNext(array(T_CLASS, T_INTERFACE, T_NAMESPACE), 0);
+ $stackPtr = $phpcsFile->findNext(array(T_CLASS, T_INTERFACE, T_NAMESPACE), $stackPtr);
while ($stackPtr !== false) {
// Keep track of what namespace we are in.
if ($tokens[$stackPtr]['code'] === T_NAMESPACE) {
View
8 CodeSniffer/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.6.inc
@@ -0,0 +1,8 @@
+<?php
+class Test{
+ public function testOne(){
+ ?>
+ <p>some html here</p>
+ <?php
+ }
+}
View
2  package.xml
@@ -36,6 +36,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
-- This allows you to create wrapper scripts for PHPCS more easily
- PSR2 MethodDeclarationSniff no longer generates a notice for methods named "_"
-- Thanks to Bart S for the patch
+ - Generic DuplicateClassNameSniff no longer reports an error if multiple PHP open tags exist in a file
- Fixed bug #19819 : Freeze with syntax error in use statement
- Fixed bug #19820 : Wrong message level in Generic_Sniffs_CodeAnalysis_EmptyStatementSniff
- Fixed bug #19859 : CodeSniffer::setIgnorePatterns API changed
@@ -440,6 +441,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<file baseinstalldir="PHP" name="DuplicateClassNameUnitTest.3.inc" role="test" />
<file baseinstalldir="PHP" name="DuplicateClassNameUnitTest.4.inc" role="test" />
<file baseinstalldir="PHP" name="DuplicateClassNameUnitTest.5.inc" role="test" />
+ <file baseinstalldir="PHP" name="DuplicateClassNameUnitTest.6.inc" role="test" />
<file baseinstalldir="PHP" name="DuplicateClassNameUnitTest.php" role="test">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
Please sign in to comment.
Something went wrong with that request. Please try again.