Skip to content

Commit

Permalink
Fixing typo and adjusting phpcs xml
Browse files Browse the repository at this point in the history
  • Loading branch information
snake14 committed Dec 5, 2024
1 parent 8c72f3f commit 860ccda
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion PhpSecInfo/Test/CGI/force_redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function _setMessages()
"force_redirect is disabled because php was not compiled with --enable-force-cgi-redirect. In most cases, this is a security vulnerability, but it appears this is not needed because you are running " . $this->skipTest()
);
$message = "force_redirect is disabled because php was not compiled with --enable-force-cgi-redirect. In most cases, this is a <strong>serious</strong> security vulnerability."
. " Unless you are absolutely sure this is not needed, recompile php with --enable-force-cgi-redirect and enable cgi.force_redirect"
. " Unless you are absolutely sure this is not needed, recompile php with --enable-force-cgi-redirect and enable cgi.force_redirect";
$this->setMessageForResult(
PHPSECINFO_TEST_RESULT_WARN,
'en',
Expand Down
28 changes: 13 additions & 15 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,13 @@
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
<!-- Classnames for our update files don't match PascalCase, this can't be changed easily -->
<exclude-pattern>Updates/*</exclude-pattern>
<exclude-pattern>PhpSecInfo/*</exclude-pattern>
<exclude-pattern>tests/*</exclude-pattern>
</rule>

<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<!-- Allow using method name with underscore prefix -->
<exclude-pattern>PhpSecInfo/*</exclude-pattern>
<exclude-pattern>tests/*</exclude-pattern>
</rule>

<rule ref="PSR2.Classes.PropertyDeclaration.Underscore">
<!-- Allow using method name with underscore prefix -->
<!-- Allow classnames to be difference cases because we don't want to have to refactor and risk regressions -->
<exclude-pattern>PhpSecInfo/*</exclude-pattern>
</rule>

<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<!-- Allow using method name without camel caps in tests as long as some methods are named test_* -->
<!-- Allow using method name without camel caps because we don't want to have to refactor and risk regressions -->
<exclude-pattern>PhpSecInfo/Test/Test.php</exclude-pattern>
<exclude-pattern>tests/*</exclude-pattern>
</rule>

<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
Expand All @@ -49,8 +37,18 @@
</rule>

<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<!-- Allow no namespace -->
<!-- Allow no namespace because we don't want to have to refactor and risk regressions -->
<exclude-pattern>PhpSecInfo/PhpSecInfo.php</exclude-pattern>
<exclude-pattern>PhpSecInfo/Test/*</exclude-pattern>
</rule>

<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<!-- Allow using method name with underscore prefix because we don't want to have to refactor and risk regressions -->
<exclude-pattern>PhpSecInfo/*</exclude-pattern>
</rule>

<rule ref="PSR2.Classes.PropertyDeclaration.Underscore">
<!-- Allow using property name with underscore prefix because we don't want to have to refactor and risk regressions -->
<exclude-pattern>PhpSecInfo/*</exclude-pattern>
</rule>
</ruleset>

0 comments on commit 860ccda

Please sign in to comment.