for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
*
* This file is part of phpFastCache.
* @license MIT License (MIT)
* For full copyright and license information, please see the docs/CREDITS.txt file.
* @author Khoa Bui (khoaofgod) <[email protected]> http://www.phpfastcache.com
* @author Georges.L (Geolim4) <[email protected]>
*/
namespace phpFastCache\Entities;
* Class driverStatistic
* @package phpFastCache\Entities
class driverStatistic
{
* @var string
protected $info = '';
protected $size = 0;
protected $data = '';
* @var mixed
protected $rawData;
* @return string|bool Return infos or false if no information available
public function getInfo()
return $this->info;
}
* @return int|bool Return size in octet or false if no information available
public function getSize()
return $this->size;
* @return mixed
public function getData()
return $this->data;
* @param $info
* @return $this
public function setInfo($info)
$this->info = ($info ?: '');
return $this;
* @param int $size
public function setSize($size)
$this->size = ($size ?: 0);
$size
string
$size ?: 0
integer
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.
$answer = 42; $correct = false; $correct = (bool) $answer;
* @param mixed $data
public function setData($data)
$this->data = ($data ?: '');
public function getRawData()
return $this->rawData;
* @param mixed $raw
public function setRawData($raw)
$this->rawData = $raw;
* @return array
public function getPublicDesc()
return[
'Info' => 'Cache Information',
'Size' => 'Cache Size',
'Data' => 'Cache items keys',
'RawData' => 'Cache raw data',
];
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.