mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 03:42:40 +00:00
CodeSniffer: Fix Generic.PHP.LowerCaseConstant.Found sniff.
This commit is contained in:
parent
ecd58b6a03
commit
ca9c8b107b
@ -432,7 +432,7 @@ class Crypt_RSA {
|
|||||||
/**
|
/**
|
||||||
* OpenSSL configuration file name.
|
* OpenSSL configuration file name.
|
||||||
*
|
*
|
||||||
* Set to NULL to use system configuration file.
|
* Set to null to use system configuration file.
|
||||||
* @see Crypt_RSA::createKey()
|
* @see Crypt_RSA::createKey()
|
||||||
* @var Mixed
|
* @var Mixed
|
||||||
* @Access public
|
* @Access public
|
||||||
@ -554,7 +554,7 @@ class Crypt_RSA {
|
|||||||
$config['config'] = $this->configFile;
|
$config['config'] = $this->configFile;
|
||||||
}
|
}
|
||||||
$rsa = openssl_pkey_new(array('private_key_bits' => $bits) + $config);
|
$rsa = openssl_pkey_new(array('private_key_bits' => $bits) + $config);
|
||||||
openssl_pkey_export($rsa, $privatekey, NULL, $config);
|
openssl_pkey_export($rsa, $privatekey, null, $config);
|
||||||
$publickey = openssl_pkey_get_details($rsa);
|
$publickey = openssl_pkey_get_details($rsa);
|
||||||
$publickey = $publickey['key'];
|
$publickey = $publickey['key'];
|
||||||
|
|
||||||
|
@ -544,13 +544,13 @@ class File_ASN1 {
|
|||||||
return array($key => $value);
|
return array($key => $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return null;
|
||||||
case isset($mapping['implicit']):
|
case isset($mapping['implicit']):
|
||||||
case isset($mapping['explicit']):
|
case isset($mapping['explicit']):
|
||||||
case $decoded['type'] == $mapping['type']:
|
case $decoded['type'] == $mapping['type']:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($mapping['implicit'])) {
|
if (isset($mapping['implicit'])) {
|
||||||
@ -565,8 +565,8 @@ class File_ASN1 {
|
|||||||
if (isset($mapping['min']) && isset($mapping['max'])) {
|
if (isset($mapping['min']) && isset($mapping['max'])) {
|
||||||
$child = $mapping['children'];
|
$child = $mapping['children'];
|
||||||
foreach ($decoded['content'] as $content) {
|
foreach ($decoded['content'] as $content) {
|
||||||
if (($map[] = $this->asn1map($content, $child, $special)) === NULL) {
|
if (($map[] = $this->asn1map($content, $child, $special)) === null) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -584,7 +584,7 @@ class File_ASN1 {
|
|||||||
if ($child['type'] != FILE_ASN1_TYPE_CHOICE) {
|
if ($child['type'] != FILE_ASN1_TYPE_CHOICE) {
|
||||||
// Get the mapping and input class & constant.
|
// Get the mapping and input class & constant.
|
||||||
$childClass = $tempClass = FILE_ASN1_CLASS_UNIVERSAL;
|
$childClass = $tempClass = FILE_ASN1_CLASS_UNIVERSAL;
|
||||||
$constant = NULL;
|
$constant = null;
|
||||||
if (isset($temp['constant'])) {
|
if (isset($temp['constant'])) {
|
||||||
$tempClass = isset($temp['class']) ? $temp['class'] : FILE_ASN1_CLASS_CONTEXT_SPECIFIC;
|
$tempClass = isset($temp['class']) ? $temp['class'] : FILE_ASN1_CLASS_CONTEXT_SPECIFIC;
|
||||||
}
|
}
|
||||||
@ -610,7 +610,7 @@ class File_ASN1 {
|
|||||||
if ($maymatch) {
|
if ($maymatch) {
|
||||||
// Attempt submapping.
|
// Attempt submapping.
|
||||||
$candidate = $this->asn1map($temp, $child, $special);
|
$candidate = $this->asn1map($temp, $child, $special);
|
||||||
$maymatch = $candidate !== NULL;
|
$maymatch = $candidate !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($maymatch) {
|
if ($maymatch) {
|
||||||
@ -623,12 +623,12 @@ class File_ASN1 {
|
|||||||
} elseif (isset($child['default'])) {
|
} elseif (isset($child['default'])) {
|
||||||
$map[$key] = $child['default']; // Use default.
|
$map[$key] = $child['default']; // Use default.
|
||||||
} elseif (!isset($child['optional'])) {
|
} elseif (!isset($child['optional'])) {
|
||||||
return NULL; // Syntax error.
|
return null; // Syntax error.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fail mapping if all input items have not been consumed.
|
// Fail mapping if all input items have not been consumed.
|
||||||
return $i < $n? NULL: $map;
|
return $i < $n? null: $map;
|
||||||
|
|
||||||
// the main diff between sets and sequences is the encapsulation of the foreach in another for loop
|
// the main diff between sets and sequences is the encapsulation of the foreach in another for loop
|
||||||
case FILE_ASN1_TYPE_SET:
|
case FILE_ASN1_TYPE_SET:
|
||||||
@ -638,8 +638,8 @@ class File_ASN1 {
|
|||||||
if (isset($mapping['min']) && isset($mapping['max'])) {
|
if (isset($mapping['min']) && isset($mapping['max'])) {
|
||||||
$child = $mapping['children'];
|
$child = $mapping['children'];
|
||||||
foreach ($decoded['content'] as $content) {
|
foreach ($decoded['content'] as $content) {
|
||||||
if (($map[] = $this->asn1map($content, $child, $special)) === NULL) {
|
if (($map[] = $this->asn1map($content, $child, $special)) === null) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -660,7 +660,7 @@ class File_ASN1 {
|
|||||||
$maymatch = true;
|
$maymatch = true;
|
||||||
if ($child['type'] != FILE_ASN1_TYPE_CHOICE) {
|
if ($child['type'] != FILE_ASN1_TYPE_CHOICE) {
|
||||||
$childClass = FILE_ASN1_CLASS_UNIVERSAL;
|
$childClass = FILE_ASN1_CLASS_UNIVERSAL;
|
||||||
$constant = NULL;
|
$constant = null;
|
||||||
if (isset($child['class'])) {
|
if (isset($child['class'])) {
|
||||||
$childClass = $child['class'];
|
$childClass = $child['class'];
|
||||||
$constant = $child['cast'];
|
$constant = $child['cast'];
|
||||||
@ -682,7 +682,7 @@ class File_ASN1 {
|
|||||||
if ($maymatch) {
|
if ($maymatch) {
|
||||||
// Attempt submapping.
|
// Attempt submapping.
|
||||||
$candidate = $this->asn1map($temp, $child, $special);
|
$candidate = $this->asn1map($temp, $child, $special);
|
||||||
$maymatch = $candidate !== NULL;
|
$maymatch = $candidate !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$maymatch) {
|
if (!$maymatch) {
|
||||||
@ -703,7 +703,7 @@ class File_ASN1 {
|
|||||||
if (isset($child['default'])) {
|
if (isset($child['default'])) {
|
||||||
$map[$key] = $child['default'];
|
$map[$key] = $child['default'];
|
||||||
} elseif (!isset($child['optional'])) {
|
} elseif (!isset($child['optional'])) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -796,7 +796,7 @@ class File_ASN1 {
|
|||||||
function encodeDER($source, $mapping, $special = array())
|
function encodeDER($source, $mapping, $special = array())
|
||||||
{
|
{
|
||||||
$this->location = array();
|
$this->location = array();
|
||||||
return $this->_encode_der($source, $mapping, NULL, $special);
|
return $this->_encode_der($source, $mapping, null, $special);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -818,7 +818,7 @@ class File_ASN1 {
|
|||||||
* @return String
|
* @return String
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _encode_der($source, $mapping, $idx = NULL, $special = array())
|
function _encode_der($source, $mapping, $idx = null, $special = array())
|
||||||
{
|
{
|
||||||
if (is_object($source) && strtolower(get_class($source)) == 'file_asn1_element') {
|
if (is_object($source) && strtolower(get_class($source)) == 'file_asn1_element') {
|
||||||
return $source->element;
|
return $source->element;
|
||||||
@ -849,7 +849,7 @@ class File_ASN1 {
|
|||||||
$child = $mapping['children'];
|
$child = $mapping['children'];
|
||||||
|
|
||||||
foreach ($source as $content) {
|
foreach ($source as $content) {
|
||||||
$temp = $this->_encode_der($content, $child, NULL, $special);
|
$temp = $this->_encode_der($content, $child, null, $special);
|
||||||
if ($temp === false) {
|
if ($temp === false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1029,19 +1029,19 @@ class File_ASN1 {
|
|||||||
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case !isset($source):
|
case !isset($source):
|
||||||
return $this->_encode_der(NULL, array('type' => FILE_ASN1_TYPE_NULL) + $mapping, NULL, $special);
|
return $this->_encode_der(null, array('type' => FILE_ASN1_TYPE_NULL) + $mapping, null, $special);
|
||||||
case is_int($source):
|
case is_int($source):
|
||||||
case is_object($source) && strtolower(get_class($source)) == 'math_biginteger':
|
case is_object($source) && strtolower(get_class($source)) == 'math_biginteger':
|
||||||
return $this->_encode_der($source, array('type' => FILE_ASN1_TYPE_INTEGER) + $mapping, NULL, $special);
|
return $this->_encode_der($source, array('type' => FILE_ASN1_TYPE_INTEGER) + $mapping, null, $special);
|
||||||
case is_float($source):
|
case is_float($source):
|
||||||
return $this->_encode_der($source, array('type' => FILE_ASN1_TYPE_REAL) + $mapping, NULL, $special);
|
return $this->_encode_der($source, array('type' => FILE_ASN1_TYPE_REAL) + $mapping, null, $special);
|
||||||
case is_bool($source):
|
case is_bool($source):
|
||||||
return $this->_encode_der($source, array('type' => FILE_ASN1_TYPE_BOOLEAN) + $mapping, NULL, $special);
|
return $this->_encode_der($source, array('type' => FILE_ASN1_TYPE_BOOLEAN) + $mapping, null, $special);
|
||||||
case is_array($source) && count($source) == 1:
|
case is_array($source) && count($source) == 1:
|
||||||
$typename = implode('', array_keys($source));
|
$typename = implode('', array_keys($source));
|
||||||
$outtype = array_search($typename, $this->ANYmap, true);
|
$outtype = array_search($typename, $this->ANYmap, true);
|
||||||
if ($outtype !== false) {
|
if ($outtype !== false) {
|
||||||
return $this->_encode_der($source[$typename], array('type' => $outtype) + $mapping, NULL, $special);
|
return $this->_encode_der($source[$typename], array('type' => $outtype) + $mapping, null, $special);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1057,7 +1057,7 @@ class File_ASN1 {
|
|||||||
user_error('No filters defined for ' . implode('/', $loc));
|
user_error('No filters defined for ' . implode('/', $loc));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return $this->_encode_der($source, $filters + $mapping, NULL, $special);
|
return $this->_encode_der($source, $filters + $mapping, null, $special);
|
||||||
case FILE_ASN1_TYPE_NULL:
|
case FILE_ASN1_TYPE_NULL:
|
||||||
$value = '';
|
$value = '';
|
||||||
break;
|
break;
|
||||||
|
@ -1430,7 +1430,7 @@ class File_X509 {
|
|||||||
$this->currentCert = $cert;
|
$this->currentCert = $cert;
|
||||||
|
|
||||||
$currentKeyIdentifier = $this->getExtension('id-ce-subjectKeyIdentifier');
|
$currentKeyIdentifier = $this->getExtension('id-ce-subjectKeyIdentifier');
|
||||||
$this->currentKeyIdentifier = is_string($currentKeyIdentifier) ? $currentKeyIdentifier : NULL;
|
$this->currentKeyIdentifier = is_string($currentKeyIdentifier) ? $currentKeyIdentifier : null;
|
||||||
|
|
||||||
unset($this->signatureSubject);
|
unset($this->signatureSubject);
|
||||||
|
|
||||||
@ -1468,7 +1468,7 @@ class File_X509 {
|
|||||||
$this->dn = $x509['tbsCertificate']['subject'];
|
$this->dn = $x509['tbsCertificate']['subject'];
|
||||||
|
|
||||||
$currentKeyIdentifier = $this->getExtension('id-ce-subjectKeyIdentifier');
|
$currentKeyIdentifier = $this->getExtension('id-ce-subjectKeyIdentifier');
|
||||||
$this->currentKeyIdentifier = is_string($currentKeyIdentifier) ? $currentKeyIdentifier : NULL;
|
$this->currentKeyIdentifier = is_string($currentKeyIdentifier) ? $currentKeyIdentifier : null;
|
||||||
|
|
||||||
return $x509;
|
return $x509;
|
||||||
}
|
}
|
||||||
@ -1962,7 +1962,7 @@ class File_X509 {
|
|||||||
* @param Integer $date optional
|
* @param Integer $date optional
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function validateDate($date = NULL)
|
function validateDate($date = null)
|
||||||
{
|
{
|
||||||
if (!is_array($this->currentCert) || !isset($this->currentCert['tbsCertificate'])) {
|
if (!is_array($this->currentCert) || !isset($this->currentCert['tbsCertificate'])) {
|
||||||
return false;
|
return false;
|
||||||
@ -1991,7 +1991,7 @@ class File_X509 {
|
|||||||
* Validate a signature
|
* Validate a signature
|
||||||
*
|
*
|
||||||
* Works on X.509 certs, CSR's and CRL's.
|
* Works on X.509 certs, CSR's and CRL's.
|
||||||
* Returns true if the signature is verified, false if it is not correct or NULL on error
|
* Returns true if the signature is verified, false if it is not correct or null on error
|
||||||
*
|
*
|
||||||
* By default returns false for self-signed certs. Call validateSignature(false) to make this support
|
* By default returns false for self-signed certs. Call validateSignature(false) to make this support
|
||||||
* self-signed.
|
* self-signed.
|
||||||
@ -2005,7 +2005,7 @@ class File_X509 {
|
|||||||
function validateSignature($caonly = true)
|
function validateSignature($caonly = true)
|
||||||
{
|
{
|
||||||
if (!is_array($this->currentCert) || !isset($this->signatureSubject)) {
|
if (!is_array($this->currentCert) || !isset($this->signatureSubject)) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO:
|
/* TODO:
|
||||||
@ -2106,7 +2106,7 @@ class File_X509 {
|
|||||||
/**
|
/**
|
||||||
* Validates a signature
|
* Validates a signature
|
||||||
*
|
*
|
||||||
* Returns true if the signature is verified, false if it is not correct or NULL on error
|
* Returns true if the signature is verified, false if it is not correct or null on error
|
||||||
*
|
*
|
||||||
* @param String $publicKeyAlgorithm
|
* @param String $publicKeyAlgorithm
|
||||||
* @param String $publicKey
|
* @param String $publicKey
|
||||||
@ -2141,11 +2141,11 @@ class File_X509 {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -2366,7 +2366,7 @@ class File_X509 {
|
|||||||
* @return Mixed
|
* @return Mixed
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function getDNProp($propName, $dn = NULL, $withType = false)
|
function getDNProp($propName, $dn = null, $withType = false)
|
||||||
{
|
{
|
||||||
if (!isset($dn)) {
|
if (!isset($dn)) {
|
||||||
$dn = $this->dn;
|
$dn = $this->dn;
|
||||||
@ -2420,7 +2420,7 @@ class File_X509 {
|
|||||||
function setDN($dn, $merge = false, $type = 'utf8String')
|
function setDN($dn, $merge = false, $type = 'utf8String')
|
||||||
{
|
{
|
||||||
if (!$merge) {
|
if (!$merge) {
|
||||||
$this->dn = NULL;
|
$this->dn = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($dn)) {
|
if (is_array($dn)) {
|
||||||
@ -2459,7 +2459,7 @@ class File_X509 {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
function getDN($format = FILE_X509_DN_ARRAY, $dn = NULL)
|
function getDN($format = FILE_X509_DN_ARRAY, $dn = null)
|
||||||
{
|
{
|
||||||
if (!isset($dn)) {
|
if (!isset($dn)) {
|
||||||
$dn = isset($this->currentCert['tbsCertList']) ? $this->currentCert['tbsCertList']['issuer'] : $this->dn;
|
$dn = isset($this->currentCert['tbsCertList']) ? $this->currentCert['tbsCertList']['issuer'] : $this->dn;
|
||||||
@ -2675,7 +2675,7 @@ class File_X509 {
|
|||||||
{
|
{
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case !empty($this->dn):
|
case !empty($this->dn):
|
||||||
return $this->getDNProp($propName, NULL, $withType);
|
return $this->getDNProp($propName, null, $withType);
|
||||||
case !isset($this->currentCert) || !is_array($this->currentCert):
|
case !isset($this->currentCert) || !is_array($this->currentCert):
|
||||||
break;
|
break;
|
||||||
case isset($this->currentCert['tbsCertificate']):
|
case isset($this->currentCert['tbsCertificate']):
|
||||||
@ -2871,10 +2871,10 @@ class File_X509 {
|
|||||||
$this->publicKey->setPublicKey();
|
$this->publicKey->setPublicKey();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$this->publicKey = NULL;
|
$this->publicKey = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->currentKeyIdentifier = NULL;
|
$this->currentKeyIdentifier = null;
|
||||||
$this->currentCert = $csr;
|
$this->currentCert = $csr;
|
||||||
|
|
||||||
return $csr;
|
return $csr;
|
||||||
@ -2996,10 +2996,10 @@ class File_X509 {
|
|||||||
$this->publicKey->setPublicKey();
|
$this->publicKey->setPublicKey();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$this->publicKey = NULL;
|
$this->publicKey = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->currentKeyIdentifier = NULL;
|
$this->currentKeyIdentifier = null;
|
||||||
$this->currentCert = $spkac;
|
$this->currentCert = $spkac;
|
||||||
|
|
||||||
return $spkac;
|
return $spkac;
|
||||||
@ -3054,7 +3054,7 @@ class File_X509 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->currentKeyIdentifier = NULL;
|
$this->currentKeyIdentifier = null;
|
||||||
$this->currentCert = $crl;
|
$this->currentCert = $crl;
|
||||||
|
|
||||||
return $crl;
|
return $crl;
|
||||||
@ -3138,8 +3138,8 @@ class File_X509 {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$currentCert = isset($this->currentCert) ? $this->currentCert : NULL;
|
$currentCert = isset($this->currentCert) ? $this->currentCert : null;
|
||||||
$signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject: NULL;
|
$signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject: null;
|
||||||
|
|
||||||
if (isset($subject->currentCert) && is_array($subject->currentCert) && isset($subject->currentCert['tbsCertificate'])) {
|
if (isset($subject->currentCert) && is_array($subject->currentCert) && isset($subject->currentCert['tbsCertificate'])) {
|
||||||
$this->currentCert = $subject->currentCert;
|
$this->currentCert = $subject->currentCert;
|
||||||
@ -3311,8 +3311,8 @@ class File_X509 {
|
|||||||
}
|
}
|
||||||
$this->publicKey = $origPublicKey;
|
$this->publicKey = $origPublicKey;
|
||||||
|
|
||||||
$currentCert = isset($this->currentCert) ? $this->currentCert : NULL;
|
$currentCert = isset($this->currentCert) ? $this->currentCert : null;
|
||||||
$signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject: NULL;
|
$signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject: null;
|
||||||
|
|
||||||
if (isset($this->currentCert) && is_array($this->currentCert) && isset($this->currentCert['certificationRequestInfo'])) {
|
if (isset($this->currentCert) && is_array($this->currentCert) && isset($this->currentCert['certificationRequestInfo'])) {
|
||||||
$this->currentCert['signatureAlgorithm']['algorithm'] =
|
$this->currentCert['signatureAlgorithm']['algorithm'] =
|
||||||
@ -3365,8 +3365,8 @@ class File_X509 {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$currentCert = isset($this->currentCert) ? $this->currentCert : NULL;
|
$currentCert = isset($this->currentCert) ? $this->currentCert : null;
|
||||||
$signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject : NULL;
|
$signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject : null;
|
||||||
$thisUpdate = !empty($this->startDate) ? $this->startDate : @date('D, d M y H:i:s O');
|
$thisUpdate = !empty($this->startDate) ? $this->startDate : @date('D, d M y H:i:s O');
|
||||||
|
|
||||||
if (isset($crl->currentCert) && is_array($crl->currentCert) && isset($crl->currentCert['tbsCertList'])) {
|
if (isset($crl->currentCert) && is_array($crl->currentCert) && isset($crl->currentCert['tbsCertList'])) {
|
||||||
@ -3402,7 +3402,7 @@ class File_X509 {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$crlNumber = $this->getExtension('id-ce-cRLNumber');
|
$crlNumber = $this->getExtension('id-ce-cRLNumber');
|
||||||
$crlNumber = $crlNumber !== false ? $crlNumber->add(new Math_BigInteger(1)) : NULL;
|
$crlNumber = $crlNumber !== false ? $crlNumber->add(new Math_BigInteger(1)) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->removeExtension('id-ce-authorityKeyIdentifier');
|
$this->removeExtension('id-ce-authorityKeyIdentifier');
|
||||||
@ -3612,7 +3612,7 @@ class File_X509 {
|
|||||||
* @access private
|
* @access private
|
||||||
* @return array ref or false
|
* @return array ref or false
|
||||||
*/
|
*/
|
||||||
function &_extensions(&$root, $path = NULL, $create = false)
|
function &_extensions(&$root, $path = null, $create = false)
|
||||||
{
|
{
|
||||||
if (!isset($root)) {
|
if (!isset($root)) {
|
||||||
$root = $this->currentCert;
|
$root = $this->currentCert;
|
||||||
@ -3666,7 +3666,7 @@ class File_X509 {
|
|||||||
* @access private
|
* @access private
|
||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
function _removeExtension($id, $path = NULL)
|
function _removeExtension($id, $path = null)
|
||||||
{
|
{
|
||||||
$extensions = &$this->_extensions($this->currentCert, $path);
|
$extensions = &$this->_extensions($this->currentCert, $path);
|
||||||
|
|
||||||
@ -3697,7 +3697,7 @@ class File_X509 {
|
|||||||
* @access private
|
* @access private
|
||||||
* @return Mixed
|
* @return Mixed
|
||||||
*/
|
*/
|
||||||
function _getExtension($id, $cert = NULL, $path = NULL)
|
function _getExtension($id, $cert = null, $path = null)
|
||||||
{
|
{
|
||||||
$extensions = $this->_extensions($cert, $path);
|
$extensions = $this->_extensions($cert, $path);
|
||||||
|
|
||||||
@ -3722,7 +3722,7 @@ class File_X509 {
|
|||||||
* @access private
|
* @access private
|
||||||
* @return Array
|
* @return Array
|
||||||
*/
|
*/
|
||||||
function _getExtensions($cert = NULL, $path = NULL)
|
function _getExtensions($cert = null, $path = null)
|
||||||
{
|
{
|
||||||
$exts = $this->_extensions($cert, $path);
|
$exts = $this->_extensions($cert, $path);
|
||||||
$extensions = array();
|
$extensions = array();
|
||||||
@ -3747,7 +3747,7 @@ class File_X509 {
|
|||||||
* @access private
|
* @access private
|
||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
function _setExtension($id, $value, $critical = false, $replace = true, $path = NULL)
|
function _setExtension($id, $value, $critical = false, $replace = true, $path = null)
|
||||||
{
|
{
|
||||||
$extensions = &$this->_extensions($this->currentCert, $path, true);
|
$extensions = &$this->_extensions($this->currentCert, $path, true);
|
||||||
|
|
||||||
@ -3794,7 +3794,7 @@ class File_X509 {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return Mixed
|
* @return Mixed
|
||||||
*/
|
*/
|
||||||
function getExtension($id, $cert = NULL)
|
function getExtension($id, $cert = null)
|
||||||
{
|
{
|
||||||
return $this->_getExtension($id, $cert);
|
return $this->_getExtension($id, $cert);
|
||||||
}
|
}
|
||||||
@ -3806,7 +3806,7 @@ class File_X509 {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return Array
|
* @return Array
|
||||||
*/
|
*/
|
||||||
function getExtensions($cert = NULL)
|
function getExtensions($cert = null)
|
||||||
{
|
{
|
||||||
return $this->_getExtensions($cert);
|
return $this->_getExtensions($cert);
|
||||||
}
|
}
|
||||||
@ -3885,7 +3885,7 @@ class File_X509 {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return Mixed
|
* @return Mixed
|
||||||
*/
|
*/
|
||||||
function getAttribute($id, $disposition = FILE_X509_ATTR_ALL, $csr = NULL)
|
function getAttribute($id, $disposition = FILE_X509_ATTR_ALL, $csr = null)
|
||||||
{
|
{
|
||||||
if (empty($csr)) {
|
if (empty($csr)) {
|
||||||
$csr = $this->currentCert;
|
$csr = $this->currentCert;
|
||||||
@ -3925,7 +3925,7 @@ class File_X509 {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return Array
|
* @return Array
|
||||||
*/
|
*/
|
||||||
function getAttributes($csr = NULL)
|
function getAttributes($csr = null)
|
||||||
{
|
{
|
||||||
if (empty($csr)) {
|
if (empty($csr)) {
|
||||||
$csr = $this->currentCert;
|
$csr = $this->currentCert;
|
||||||
@ -4034,7 +4034,7 @@ class File_X509 {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return String binary key identifier
|
* @return String binary key identifier
|
||||||
*/
|
*/
|
||||||
function computeKeyIdentifier($key = NULL, $method = 1)
|
function computeKeyIdentifier($key = null, $method = 1)
|
||||||
{
|
{
|
||||||
if (is_null($key)) {
|
if (is_null($key)) {
|
||||||
$key = $this;
|
$key = $this;
|
||||||
@ -4227,7 +4227,7 @@ class File_X509 {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
function revoke($serial, $date = NULL)
|
function revoke($serial, $date = null)
|
||||||
{
|
{
|
||||||
if (isset($this->currentCert['tbsCertList'])) {
|
if (isset($this->currentCert['tbsCertList'])) {
|
||||||
if (is_array($rclist = &$this->_subArray($this->currentCert, 'tbsCertList/revokedCertificates', true))) {
|
if (is_array($rclist = &$this->_subArray($this->currentCert, 'tbsCertList/revokedCertificates', true))) {
|
||||||
@ -4292,7 +4292,7 @@ class File_X509 {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function listRevoked($crl = NULL)
|
function listRevoked($crl = null)
|
||||||
{
|
{
|
||||||
if (!isset($crl)) {
|
if (!isset($crl)) {
|
||||||
$crl = $this->currentCert;
|
$crl = $this->currentCert;
|
||||||
@ -4343,7 +4343,7 @@ class File_X509 {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return Mixed
|
* @return Mixed
|
||||||
*/
|
*/
|
||||||
function getRevokedCertificateExtension($serial, $id, $crl = NULL)
|
function getRevokedCertificateExtension($serial, $id, $crl = null)
|
||||||
{
|
{
|
||||||
if (!isset($crl)) {
|
if (!isset($crl)) {
|
||||||
$crl = $this->currentCert;
|
$crl = $this->currentCert;
|
||||||
@ -4366,7 +4366,7 @@ class File_X509 {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return Array
|
* @return Array
|
||||||
*/
|
*/
|
||||||
function getRevokedCertificateExtensions($serial, $crl = NULL)
|
function getRevokedCertificateExtensions($serial, $crl = null)
|
||||||
{
|
{
|
||||||
if (!isset($crl)) {
|
if (!isset($crl)) {
|
||||||
$crl = $this->currentCert;
|
$crl = $this->currentCert;
|
||||||
|
@ -1057,7 +1057,7 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
* @return Boolean
|
* @return Boolean
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function touch($filename, $time = NULL, $atime = NULL)
|
function touch($filename, $time = null, $atime = null)
|
||||||
{
|
{
|
||||||
if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
|
if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
|
||||||
return false;
|
return false;
|
||||||
@ -1100,7 +1100,7 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
/**
|
/**
|
||||||
* Changes file or directory owner
|
* Changes file or directory owner
|
||||||
*
|
*
|
||||||
* Returns TRUE on success or FALSE on error.
|
* Returns true on success or false on error.
|
||||||
*
|
*
|
||||||
* @param String $filename
|
* @param String $filename
|
||||||
* @param Integer $uid
|
* @param Integer $uid
|
||||||
@ -1120,7 +1120,7 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
/**
|
/**
|
||||||
* Changes file or directory group
|
* Changes file or directory group
|
||||||
*
|
*
|
||||||
* Returns TRUE on success or FALSE on error.
|
* Returns true on success or false on error.
|
||||||
*
|
*
|
||||||
* @param String $filename
|
* @param String $filename
|
||||||
* @param Integer $gid
|
* @param Integer $gid
|
||||||
@ -1138,8 +1138,8 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
/**
|
/**
|
||||||
* Set permissions on a file.
|
* Set permissions on a file.
|
||||||
*
|
*
|
||||||
* Returns the new file permissions on success or FALSE on error.
|
* Returns the new file permissions on success or false on error.
|
||||||
* If $recursive is true than this just returns TRUE or FALSE.
|
* If $recursive is true than this just returns true or false.
|
||||||
*
|
*
|
||||||
* @param Integer $mode
|
* @param Integer $mode
|
||||||
* @param String $filename
|
* @param String $filename
|
||||||
|
@ -1016,7 +1016,7 @@ class Net_SSH1 {
|
|||||||
|
|
||||||
if ($this->curTimeout) {
|
if ($this->curTimeout) {
|
||||||
$read = array($this->fsock);
|
$read = array($this->fsock);
|
||||||
$write = $except = NULL;
|
$write = $except = null;
|
||||||
|
|
||||||
$start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838
|
$start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838
|
||||||
$sec = floor($this->curTimeout);
|
$sec = floor($this->curTimeout);
|
||||||
|
@ -860,7 +860,7 @@ class Net_SSH2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$read = array($this->fsock);
|
$read = array($this->fsock);
|
||||||
$write = $except = NULL;
|
$write = $except = null;
|
||||||
|
|
||||||
$sec = floor($timeout);
|
$sec = floor($timeout);
|
||||||
$usec = 1000000 * ($timeout - $sec);
|
$usec = 1000000 * ($timeout - $sec);
|
||||||
@ -1756,7 +1756,7 @@ class Net_SSH2 {
|
|||||||
|
|
||||||
// remove the username and password from the logged packet
|
// remove the username and password from the logged packet
|
||||||
if (!defined('NET_SSH2_LOGGING')) {
|
if (!defined('NET_SSH2_LOGGING')) {
|
||||||
$logged = NULL;
|
$logged = null;
|
||||||
} else {
|
} else {
|
||||||
$logged = pack('CNa*Na*Na*CNa*',
|
$logged = pack('CNa*Na*Na*CNa*',
|
||||||
NET_SSH2_MSG_USERAUTH_REQUEST, strlen('username'), 'username', strlen('ssh-connection'), 'ssh-connection',
|
NET_SSH2_MSG_USERAUTH_REQUEST, strlen('username'), 'username', strlen('ssh-connection'), 'ssh-connection',
|
||||||
@ -2074,7 +2074,7 @@ class Net_SSH2 {
|
|||||||
* @return String
|
* @return String
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function exec($command, $callback = NULL)
|
function exec($command, $callback = null)
|
||||||
{
|
{
|
||||||
$this->curTimeout = $this->timeout;
|
$this->curTimeout = $this->timeout;
|
||||||
$this->is_timeout = false;
|
$this->is_timeout = false;
|
||||||
@ -2721,7 +2721,7 @@ class Net_SSH2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$read = array($this->fsock);
|
$read = array($this->fsock);
|
||||||
$write = $except = NULL;
|
$write = $except = null;
|
||||||
|
|
||||||
$start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838
|
$start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838
|
||||||
$sec = floor($this->curTimeout);
|
$sec = floor($this->curTimeout);
|
||||||
@ -2904,7 +2904,7 @@ class Net_SSH2 {
|
|||||||
* @return Boolean
|
* @return Boolean
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _send_binary_packet($data, $logged = NULL)
|
function _send_binary_packet($data, $logged = null)
|
||||||
{
|
{
|
||||||
if (!is_resource($this->fsock) || feof($this->fsock)) {
|
if (!is_resource($this->fsock) || feof($this->fsock)) {
|
||||||
user_error('Connection closed prematurely');
|
user_error('Connection closed prematurely');
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
<rule ref="Generic.ControlStructures.InlineControlStructure.Discouraged"><severity>0</severity></rule>
|
<rule ref="Generic.ControlStructures.InlineControlStructure.Discouraged"><severity>0</severity></rule>
|
||||||
<rule ref="Generic.Files.LineLength.TooLong"><severity>0</severity></rule>
|
<rule ref="Generic.Files.LineLength.TooLong"><severity>0</severity></rule>
|
||||||
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma"><severity>0</severity></rule>
|
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma"><severity>0</severity></rule>
|
||||||
<rule ref="Generic.PHP.LowerCaseConstant.Found"><severity>0</severity></rule>
|
|
||||||
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital"><severity>0</severity></rule>
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital"><severity>0</severity></rule>
|
||||||
<rule ref="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps"><severity>0</severity></rule>
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps"><severity>0</severity></rule>
|
||||||
<rule ref="PEAR.Classes.ClassDeclaration.OpenBraceNewLine"><severity>0</severity></rule>
|
<rule ref="PEAR.Classes.ClassDeclaration.OpenBraceNewLine"><severity>0</severity></rule>
|
||||||
|
Loading…
Reference in New Issue
Block a user