Storage/Provider/MemcachedProvider.php
Call to method set
from undeclared class \Memcached
Open
Open
return $this->_memcached->set($key, $expiresAt, 60 * 60 * 24 * 30);
- Exclude checks
Call to method delete
from undeclared class \Memcached
Open
Open
return $this->_memcached->delete($key);
- Exclude checks
Call to method get
from undeclared class \Memcached
Open
Open
return $this->_memcached->get($key);
- Exclude checks
Call to method fetchAll
from undeclared class \Memcached
Open
Open
return $this->_memcached->fetchAll();
- Exclude checks
Property \NW\RequestLimitBundle\Storage\Provider\MemcachedProvider->_memcached
has undeclared type \Memcached
Open
Open
private $_memcached;
- Exclude checks
Call to method __construct
from undeclared class \Memcached
Open
Open
$_memcached = new Memcached();
- Exclude checks
Call to method addServer
from undeclared class \Memcached
Open
Open
$_memcached->addServer($memcachedHost, $memcachedPort);
- Exclude checks
Rename "$_memcached" which has the same name as the field declared at line 17. Open
Open
$_memcached = new Memcached();
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
The property $_memcached is not named in camelCase. Open
Open
class MemcachedProvider implements ProviderInterface
{
/**
* @var Memcached $_memcached
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Property name "$_memcached" should not be prefixed with an underscore to indicate visibility Open
Open
private $_memcached;
- Exclude checks
The variable $_memcached is not named in camelCase. Open
Open
public function configure($configuration)
{
$memcachedHost = $configuration['server'];
$memcachedPort = $configuration['port'];
$_memcached = new Memcached();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_memcached is not named in camelCase. Open
Open
public function configure($configuration)
{
$memcachedHost = $configuration['server'];
$memcachedPort = $configuration['port'];
$_memcached = new Memcached();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_memcached is not named in camelCase. Open
Open
public function configure($configuration)
{
$memcachedHost = $configuration['server'];
$memcachedPort = $configuration['port'];
$_memcached = new Memcached();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}