for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dtc\QueueBundle\Tests\Run;
use Dtc\QueueBundle\Util\Util;
use PHPUnit\Framework\TestCase;
class UtilTest extends TestCase
{
/**
* @param string $varName
$varName
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @param int $pow
$pow
*/
public function testValidateIntNull()
self::assertNull(Util::validateIntNull('something', null, 2));
self::assertEquals(1, Util::validateIntNull('asdf', 1, 2));
try {
Util::validateIntNull('something', 'asdf', 2);
} catch (\Exception $exception) {
self::assertTrue(true);
}
$failed = false;
Util::validateIntNull('test', '5', 2);
$failed = true;
self::assertFalse($failed);
self::assertEquals(5, Util::validateIntNull('test', '5', 3));
self::assertEquals(PHP_INT_MAX, Util::validateIntNull('test', PHP_INT_MAX, 64));
Util::validateIntNull('test', PHP_INT_MAX, 31);
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.