From 161bb7d3620e3eb397b8cfe170478d53d7a15e19 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 3 Dec 2013 21:02:00 +0100 Subject: [PATCH] CS: Fix PEAR.ControlStructures.ControlSignature sniff. --- phpseclib/Crypt/Blowfish.php | 3 +-- phpseclib/File/ASN1.php | 6 ++---- phpseclib/File/X509.php | 9 +++------ tests/code_sniffer_ruleset.xml | 1 - 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/phpseclib/Crypt/Blowfish.php b/phpseclib/Crypt/Blowfish.php index 00e06a26..8fedee0e 100644 --- a/phpseclib/Crypt/Blowfish.php +++ b/phpseclib/Crypt/Blowfish.php @@ -418,8 +418,7 @@ class Crypt_Blowfish extends Crypt_Base 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); } diff --git a/phpseclib/File/ASN1.php b/phpseclib/File/ASN1.php index 20b33c5c..3750f9f1 100644 --- a/phpseclib/File/ASN1.php +++ b/phpseclib/File/ASN1.php @@ -593,8 +593,7 @@ class File_ASN1 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']; } @@ -666,8 +665,7 @@ class File_ASN1 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']; } diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index f8d86bc5..d6fe7906 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -1715,8 +1715,7 @@ class File_X509 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) { @@ -3400,8 +3399,7 @@ class File_X509 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; } @@ -3414,8 +3412,7 @@ class File_X509 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. diff --git a/tests/code_sniffer_ruleset.xml b/tests/code_sniffer_ruleset.xml index 36f6545f..1838e1b5 100644 --- a/tests/code_sniffer_ruleset.xml +++ b/tests/code_sniffer_ruleset.xml @@ -29,7 +29,6 @@ 0 0 0 - 0 0 0 0