Merge pull request #810 from GrahamForks/cs

PHPDoc Fixes And Others

* GrahamForks/cs:
  Fixed another case
  Minor tweaks
  Fixed error
  More fixes
  PHPDoc fixes
This commit is contained in:
Andreas Fischer 2015-09-14 01:18:09 +02:00
commit 71d7108d9a
19 changed files with 144 additions and 128 deletions

View File

@ -1790,7 +1790,6 @@ class Crypt_Base
if ($this->mode == CRYPT_MODE_CFB) {
$this->ecb = mcrypt_module_open($this->cipher_name_mcrypt, '', MCRYPT_MODE_ECB, '');
}
} // else should mcrypt_generic_deinit be called?
if ($this->mode == CRYPT_MODE_CFB) {

View File

@ -1644,7 +1644,6 @@ class Crypt_RSA
break;
}
}
} else {
$components = $this->_parseKey($key, $type);
}
@ -1859,7 +1858,6 @@ class Crypt_RSA
default:
return false;
}
}
/**

View File

@ -268,7 +268,7 @@ if (!function_exists('phpseclib_resolve_include_path')) {
* PHP 5.3.2) with fallback implementation for earlier PHP versions.
*
* @param string $filename
* @return mixed Filename (string) on success, false otherwise.
* @return string|false
* @access public
*/
function phpseclib_resolve_include_path($filename)

View File

@ -3758,7 +3758,7 @@ class File_X509
* @param string $path absolute path with / as component separator
* @param bool $create optional
* @access private
* @return array item ref or false
* @return array|false
*/
function &_subArray(&$root, $path, $create = false)
{
@ -3794,7 +3794,7 @@ class File_X509
* @param string $path optional absolute path with / as component separator
* @param bool $create optional
* @access private
* @return array ref or false
* @return array|false
*/
function &_extensions(&$root, $path = null, $create = false)
{
@ -4381,7 +4381,7 @@ class File_X509
* @param string $serial
* @param bool $create optional
* @access private
* @return int or false
* @return int|false
*/
function _revokedCertificate(&$rclist, $serial, $create = false)
{
@ -4631,7 +4631,7 @@ class File_X509
* getOID('zzz') == 'zzz'
*
* @access public
* @return String
* @return string
*/
function getOID($name)
{

View File

@ -802,7 +802,6 @@ class Math_BigInteger
$vars[] = 'precision';
}
return $vars;
}
/**
@ -1855,7 +1854,8 @@ class Math_BigInteger
}
}
for ($k = 0; $k <= $j; ++$k) {// eg. the length of substr($e_bits, $i, $j+1)
// eg. the length of substr($e_bits, $i, $j + 1)
for ($k = 0; $k <= $j; ++$k) {
$result = $this->_squareReduce($result, $n_value, $mode);
}
@ -2430,7 +2430,7 @@ class Math_BigInteger
* </code>
*
* @param Math_BigInteger $n
* @return mixed false, if no modular inverse exists, Math_BigInteger, otherwise.
* @return Math_BigInteger|false
* @access public
* @internal See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=21 HAC 14.64} for more information.
*/
@ -3190,13 +3190,13 @@ class Math_BigInteger
/**
* Generate a random prime number.
*
* If there's not a prime within the given range, false will be returned. If more than $timeout seconds have elapsed,
* give up and return false.
* If there's not a prime within the given range, false will be returned.
* If more than $timeout seconds have elapsed, give up and return false.
*
* @param Math_BigInteger $arg1
* @param Math_BigInteger $arg2
* @param int $timeout
* @return mixed
* @return Math_BigInteger|false
* @access public
* @internal See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap4.pdf#page=15 HAC 4.44}.
*/

View File

@ -1414,7 +1414,7 @@ class Net_SSH1
* Returns a string if NET_SSH1_LOGGING == NET_SSH1_LOG_COMPLEX, an array if NET_SSH1_LOGGING == NET_SSH1_LOG_SIMPLE and false if !defined('NET_SSH1_LOGGING')
*
* @access public
* @return string or Array
* @return array|false|string
*/
function getLog()
{

View File

@ -192,7 +192,7 @@ class Net_SSH2
* Server Identifier
*
* @see Net_SSH2::getServerIdentification()
* @var mixed false or Array
* @var array|false
* @access private
*/
var $server_identifier = false;
@ -201,7 +201,7 @@ class Net_SSH2
* Key Exchange Algorithms
*
* @see Net_SSH2::getKexAlgorithims()
* @var mixed false or Array
* @var array|false
* @access private
*/
var $kex_algorithms = false;
@ -237,7 +237,7 @@ class Net_SSH2
* Server Host Key Algorithms
*
* @see Net_SSH2::getServerHostKeyAlgorithms()
* @var mixed false or Array
* @var array|false
* @access private
*/
var $server_host_key_algorithms = false;
@ -246,7 +246,7 @@ class Net_SSH2
* Encryption Algorithms: Client to Server
*
* @see Net_SSH2::getEncryptionAlgorithmsClient2Server()
* @var mixed false or Array
* @var array|false
* @access private
*/
var $encryption_algorithms_client_to_server = false;
@ -255,7 +255,7 @@ class Net_SSH2
* Encryption Algorithms: Server to Client
*
* @see Net_SSH2::getEncryptionAlgorithmsServer2Client()
* @var mixed false or Array
* @var array|false
* @access private
*/
var $encryption_algorithms_server_to_client = false;
@ -264,7 +264,7 @@ class Net_SSH2
* MAC Algorithms: Client to Server
*
* @see Net_SSH2::getMACAlgorithmsClient2Server()
* @var mixed false or Array
* @var array|false
* @access private
*/
var $mac_algorithms_client_to_server = false;
@ -273,7 +273,7 @@ class Net_SSH2
* MAC Algorithms: Server to Client
*
* @see Net_SSH2::getMACAlgorithmsServer2Client()
* @var mixed false or Array
* @var array|false
* @access private
*/
var $mac_algorithms_server_to_client = false;
@ -282,7 +282,7 @@ class Net_SSH2
* Compression Algorithms: Client to Server
*
* @see Net_SSH2::getCompressionAlgorithmsClient2Server()
* @var mixed false or Array
* @var array|false
* @access private
*/
var $compression_algorithms_client_to_server = false;
@ -291,7 +291,7 @@ class Net_SSH2
* Compression Algorithms: Server to Client
*
* @see Net_SSH2::getCompressionAlgorithmsServer2Client()
* @var mixed false or Array
* @var array|false
* @access private
*/
var $compression_algorithms_server_to_client = false;
@ -300,7 +300,7 @@ class Net_SSH2
* Languages: Server to Client
*
* @see Net_SSH2::getLanguagesServer2Client()
* @var mixed false or Array
* @var array|false
* @access private
*/
var $languages_server_to_client = false;
@ -309,7 +309,7 @@ class Net_SSH2
* Languages: Client to Server
*
* @see Net_SSH2::getLanguagesClient2Server()
* @var mixed false or Array
* @var array|false
* @access private
*/
var $languages_client_to_server = false;
@ -1898,7 +1898,7 @@ class Net_SSH2
* Maps an encryption algorithm name to the number of key bytes.
*
* @param string $algorithm Name of the encryption algorithm
* @return mixed Number of bytes as an integer or null for unknown
* @return int|null Number of bytes as an integer or null for unknown
* @access private
*/
function _encryption_algorithm_to_key_size($algorithm)
@ -3758,7 +3758,7 @@ class Net_SSH2
* Returns a string if NET_SSH2_LOGGING == NET_SSH2_LOG_COMPLEX, an array if NET_SSH2_LOGGING == NET_SSH2_LOG_SIMPLE and false if !defined('NET_SSH2_LOGGING')
*
* @access public
* @return string or Array
* @return array|false|string
*/
function getLog()
{
@ -4191,7 +4191,7 @@ class Net_SSH2
/**
* Returns the exit status of an SSH command or false.
*
* @return int or false
* @return false|int
* @access public
*/
function getExitStatus()

View File

@ -56,13 +56,15 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
$result = array();
// @codingStandardsIgnoreStart
foreach ($modes as $mode)
foreach ($plaintexts as $plaintext)
foreach ($ivs as $iv)
foreach ($keys as $key)
foreach ($modes as $mode) {
foreach ($plaintexts as $plaintext) {
foreach ($ivs as $iv) {
foreach ($keys as $key) {
$result[] = array($mode, $plaintext, $iv, $key);
// @codingStandardsIgnoreEnd
}
}
}
}
return $result;
}
@ -153,12 +155,13 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
$result = array();
// @codingStandardsIgnoreStart
foreach ($modes as $mode)
foreach ($combos as $combo)
foreach (array('encrypt', 'decrypt') as $op)
foreach ($modes as $mode) {
foreach ($combos as $combo) {
foreach (array('encrypt', 'decrypt') as $op) {
$result[] = array($op, $mode, $combo);
// @codingStandardsIgnoreEnd
}
}
}
return $result;
}
@ -209,9 +212,10 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
}
/**
* Pretty much the same as testContinuousBufferBattery with the caveat that continuous mode is not enabled.
*
* @dataProvider continuousBufferBatteryCombos
*/
// pretty much the same as testContinuousBufferBattery with the caveat that continuous mode is not enabled
public function testNonContinuousBufferBattery($op, $mode, $test)
{
if (count($test) == 1) {

View File

@ -55,12 +55,15 @@ class Unit_Crypt_BlowfishTest extends PhpseclibTestCase
array(pack('H*', '0123456789ABCDEF'), pack('H*', '0000000000000000'), pack('H*', '245946885754369A')),
array(pack('H*', 'FEDCBA9876543210'), pack('H*', 'FFFFFFFFFFFFFFFF'), pack('H*', '6B5C5A9C5D9E0A5A'))
);
$result = array();
// @codingStandardsIgnoreStart
foreach ($engines as $engine => $engineName)
foreach ($tests as $test)
foreach ($engines as $engine => $engineName) {
foreach ($tests as $test) {
$result[] = array($engine, $engineName, $test[0], $test[1], $test[2]);
// @codingStandardsIgnoreEnd
}
}
return $result;
}

View File

@ -29,12 +29,15 @@ class Unit_Crypt_RC2Test extends PhpseclibTestCase
array('88bca90e90875a7f0f79c384627bafb2', 128, '0000000000000000', '2269552ab0f85ca6'),
array('88bca90e90875a7f0f79c384627bafb216f80a6f85920584c42fceb0be255daf1e', 129, '0000000000000000', '5b78d3a43dfff1f1')
);
$result = array();
// @codingStandardsIgnoreStart
foreach ($this->engines as $engine => $engineName)
foreach ($tests as $test)
foreach ($this->engines as $engine => $engineName) {
foreach ($tests as $test) {
$result[] = array($engine, $engineName, $test[0], $test[1], $test[2], $test[3]);
// @codingStandardsIgnoreEnd
}
}
return $result;
}

View File

@ -180,13 +180,17 @@ class Unit_Crypt_RC4Test extends PhpseclibTestCase
)
)
);
$result = array();
// @codingStandardsIgnoreStart
foreach ($engines as $engine => $engineName)
foreach ($tests as $test)
foreach ($test['output'] as $output)
foreach ($engines as $engine => $engineName) {
foreach ($tests as $test) {
foreach ($test['output'] as $output) {
$result[] = array($engine, $engineName, $test['key'], $output['offset'], $output['result']);
// @codingStandardsIgnoreEnd
}
}
}
return $result;
}

View File

@ -86,12 +86,15 @@ class Unit_Crypt_TripleDESTest extends PhpseclibTestCase
array(str_repeat("\x01", 24), pack('H*', '0000000000000002'), pack('H*', '06E7EA22CE92708F')),
array(str_repeat("\x01", 24), pack('H*', '0000000000000001'), pack('H*', '166B40B44ABA4BD6'))
);
$result = array();
// @codingStandardsIgnoreStart
foreach ($this->engines as $engine => $engineName)
foreach ($tests as $test)
foreach ($this->engines as $engine => $engineName) {
foreach ($tests as $test) {
$result[] = array($engine, $engineName, $test[0], $test[1], $test[2]);
// @codingStandardsIgnoreEnd
}
}
return $result;
}
@ -134,12 +137,15 @@ class Unit_Crypt_TripleDESTest extends PhpseclibTestCase
pack('H*', '84401f78fe6c10876d8ea23094ea5309'),
pack('H*', '7b1f7c7e3b1c948ebd04a75ffba7d2f5'))
);
$result = array();
// @codingStandardsIgnoreStart
foreach ($engines as $engine => $engineName)
foreach ($tests as $test)
foreach ($engines as $engine => $engineName) {
foreach ($tests as $test) {
$result[] = array($engine, $engineName, $test[0], $test[1], $test[2], $test[3]);
// @codingStandardsIgnoreEnd
}
}
return $result;
}

View File

@ -94,6 +94,5 @@ class Unit_File_X509_SPKACTest extends PhpseclibTestCase
$x509->validateSignature(),
'Failed asserting that the signature is invalid'
);
}
}