for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PHPDaemon\Cache;
/**
* CappedStorageHits
* @package PHPDaemon\Cache
* @author Vasily Zorin <[email protected]>
*/
class CappedStorageHits extends CappedStorage
{
* Constructor
* @param integer $max Maximum number of cached elements
$max
integer|null
This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.
@param
It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.
public function __construct($max = null)
if ($max !== null) {
$this->maxCacheSize = $max;
}
$this->sorter = function ($a, $b) {
if ($a->hits === $b->hits) {
return 0;
return ($a->hits < $b->hits) ? 1 : -1;
};
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.