Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeSniffer: Fix PEAR.ControlStructures.ControlSignature sniff. #200

Merged
merged 2 commits into from Dec 3, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions phpseclib/Crypt/Blowfish.php
Expand Up @@ -418,8 +418,7 @@ function setKey($key)

if (!$keylength) {
$key = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
}
elseif ($keylength > 56) {
} elseif ($keylength > 56) {
$key = substr($key, 0, 56);
}

Expand Down
6 changes: 2 additions & 4 deletions phpseclib/File/ASN1.php
Expand Up @@ -593,8 +593,7 @@ function asn1map($decoded, $mapping, $special = array())
if (isset($child['class'])) {
$childClass = $child['class'];
$constant = $child['cast'];
}
elseif (isset($child['constant'])) {
} elseif (isset($child['constant'])) {
$childClass = FILE_ASN1_CLASS_CONTEXT_SPECIFIC;
$constant = $child['constant'];
}
Expand Down Expand Up @@ -666,8 +665,7 @@ function asn1map($decoded, $mapping, $special = array())
if (isset($child['class'])) {
$childClass = $child['class'];
$constant = $child['cast'];
}
elseif (isset($child['constant'])) {
} elseif (isset($child['constant'])) {
$childClass = FILE_ASN1_CLASS_CONTEXT_SPECIFIC;
$constant = $child['constant'];
}
Expand Down
9 changes: 3 additions & 6 deletions phpseclib/File/X509.php
Expand Up @@ -1715,8 +1715,7 @@ function _mapOutAttributes(&$root, $path, $asn1)
if ($map === false) {
user_error($id . ' is not a currently supported attribute', E_USER_NOTICE);
unset($attributes[$i]);
}
elseif (is_array($attributes[$i]['value'])) {
} elseif (is_array($attributes[$i]['value'])) {
$values = &$attributes[$i]['value'];
for ($j = 0; $j < count($values); $j++) {
switch ($id) {
Expand Down Expand Up @@ -3400,8 +3399,7 @@ function signCRL($issuer, $crl, $signatureAlgorithm = 'sha1WithRSAEncryption')

if (!empty($this->serialNumber)) {
$crlNumber = $this->serialNumber;
}
else {
} else {
$crlNumber = $this->getExtension('id-ce-cRLNumber');
$crlNumber = $crlNumber !== false ? $crlNumber->add(new Math_BigInteger(1)) : null;
}
Expand All @@ -3414,8 +3412,7 @@ function signCRL($issuer, $crl, $signatureAlgorithm = 'sha1WithRSAEncryption')
if (!$version) {
if (!empty($tbsCertList['crlExtensions'])) {
$version = 1; // v2.
}
elseif (!empty($tbsCertList['revokedCertificates'])) {
} elseif (!empty($tbsCertList['revokedCertificates'])) {
foreach ($tbsCertList['revokedCertificates'] as $cert) {
if (!empty($cert['crlEntryExtensions'])) {
$version = 1; // v2.
Expand Down
2 changes: 2 additions & 0 deletions phpseclib/Math/BigInteger.php
Expand Up @@ -3299,6 +3299,7 @@ function isPrime($t = false)

if (!$t) {
// see HAC 4.49 "Note (controlling the error probability)"
// @codingStandardsIgnoreStart
if ($length >= 163) { $t = 2; } // floor(1300 / 8)
else if ($length >= 106) { $t = 3; } // floor( 850 / 8)
else if ($length >= 81 ) { $t = 4; } // floor( 650 / 8)
Expand All @@ -3311,6 +3312,7 @@ function isPrime($t = false)
else if ($length >= 25 ) { $t = 15; } // floor( 200 / 8)
else if ($length >= 18 ) { $t = 18; } // floor( 150 / 8)
else { $t = 27; }
// @codingStandardsIgnoreEnd
}

// ie. gmp_testbit($this, 0)
Expand Down
1 change: 0 additions & 1 deletion tests/code_sniffer_ruleset.xml
Expand Up @@ -29,7 +29,6 @@
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParams"><severity>0</severity></rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParams"><severity>0</severity></rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeTags"><severity>0</severity></rule>
<rule ref="PEAR.ControlStructures.ControlSignature"><severity>0</severity></rule>
<rule ref="PEAR.Files.IncludingFile.BracketsNotRequired"><severity>0</severity></rule>
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce"><severity>0</severity></rule>
<rule ref="PEAR.Formatting.MultiLineAssignment.EqualSignLine"><severity>0</severity></rule>
Expand Down