NovikovViktor/RequestLimitBundle

View on GitHub
Storage/Provider/MemcachedProvider.php

Summary

Maintainability
A
0 mins
Test Coverage

Call to method set from undeclared class \Memcached
Open

        return $this->_memcached->set($key, $expiresAt, 60 * 60 * 24 * 30);
Severity: Critical
Found in Storage/Provider/MemcachedProvider.php by phan

Call to method delete from undeclared class \Memcached
Open

        return $this->_memcached->delete($key);
Severity: Critical
Found in Storage/Provider/MemcachedProvider.php by phan

Call to method get from undeclared class \Memcached
Open

        return $this->_memcached->get($key);
Severity: Critical
Found in Storage/Provider/MemcachedProvider.php by phan

Call to method fetchAll from undeclared class \Memcached
Open

        return $this->_memcached->fetchAll();
Severity: Critical
Found in Storage/Provider/MemcachedProvider.php by phan

Property \NW\RequestLimitBundle\Storage\Provider\MemcachedProvider->_memcached has undeclared type \Memcached
Open

    private $_memcached;
Severity: Minor
Found in Storage/Provider/MemcachedProvider.php by phan

Call to method __construct from undeclared class \Memcached
Open

        $_memcached = new Memcached();
Severity: Critical
Found in Storage/Provider/MemcachedProvider.php by phan

Call to method addServer from undeclared class \Memcached
Open

        $_memcached->addServer($memcachedHost, $memcachedPort);
Severity: Critical
Found in Storage/Provider/MemcachedProvider.php by phan

Rename "$_memcached" which has the same name as the field declared at line 17.
Open

        $_memcached = new Memcached();

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

The property $_memcached is not named in camelCase.
Open

class MemcachedProvider implements ProviderInterface
{
    /**
     * @var Memcached $_memcached
     */

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

    private $_memcached;

The variable $_memcached is not named in camelCase.
Open

    public function configure($configuration)
    {
        $memcachedHost = $configuration['server'];
        $memcachedPort = $configuration['port'];
        $_memcached = new Memcached();

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

    public function configure($configuration)
    {
        $memcachedHost = $configuration['server'];
        $memcachedPort = $configuration['port'];
        $_memcached = new Memcached();

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

    public function configure($configuration)
    {
        $memcachedHost = $configuration['server'];
        $memcachedPort = $configuration['port'];
        $_memcached = new Memcached();

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

There are no issues that match your filters.

Category
Status