Showing 102 of 102 total issues
Call to method load
from undeclared class \Symfony\Component\DependencyInjection\Loader\XmlFileLoader
Open
Open
$loader->load('services.xml');
- Exclude checks
Call to undeclared method \NW\RequestLimitBundle\DependencyInjection\NWRequestLimitExtension::processConfiguration
Open
Open
$config = $this->processConfiguration($configuration, $configs);
- Exclude checks
Call to method fetchAll
from undeclared class \Memcached
Open
Open
return $this->_memcached->fetchAll();
- Exclude checks
Property \NW\RequestLimitBundle\Storage\Provider\MySQLProvider->_em
has undeclared type \Doctrine\ORM\EntityManager
Open
Open
private $_em;
- Exclude checks
Call to method getConnection
from undeclared class \Doctrine\ORM\EntityManager
Open
Open
$connection = $this->_em->getConnection();
- Exclude checks
@throws type of remove
has undeclared type \Doctrine\DBAL\Exception
(Did you mean class \Exception) Open
Open
public function remove($key)
- Exclude checks
@throws type of getItemsCount
has undeclared type \Doctrine\DBAL\Driver\Exception
(Did you mean class \Exception) Open
Open
public function getItemsCount()
- Exclude checks
Call to method getConnection
from undeclared class \Doctrine\ORM\EntityManager
Open
Open
$connection = $this->_em->getConnection();
- Exclude checks
Parameter $request
has undeclared type \Symfony\Component\HttpFoundation\Request
Open
Open
public function collect(Request $request, Response $response, \Exception $exception = null)
- Exclude checks
Parameter $container
has undeclared type \Symfony\Component\DependencyInjection\ContainerBuilder
Open
Open
public function process(ContainerBuilder $container)
- Exclude checks
Call to method getParameter
from undeclared class \Symfony\Component\DependencyInjection\ContainerBuilder
Open
Open
$providerConfiguration = $container->getParameter('nw_request_limit.provider_configuration');
- Exclude checks
Call to method getDefinition
from undeclared class \Symfony\Component\DependencyInjection\ContainerBuilder
Open
Open
$providerDefinition = $container->getDefinition($providerTypeServiceName);
- Exclude checks
Call to undeclared method \NW\RequestLimitBundle\Tests\Unit\Utils\RestrictorTest::setExpectedException
Open
Open
$this->setExpectedException(RequestLimitReachedException::class);
- Exclude checks
Possibly zero references to use statement for classlike/namespace Connection
(\Doctrine\DBAL\Connection)
Open
Open
use Doctrine\DBAL\Connection;
- Exclude checks
Class implements undeclared interface \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface
Open
Open
class StoragePass implements CompilerPassInterface
- Exclude checks
Call to undeclared method \AppKernel::getEnvironment
Open
Open
if (in_array($this->getEnvironment(), ['test'])) {
- Exclude checks
Define a constant instead of duplicating this literal "item_key" 3 times. Open
Open
$statement->bindValue('item_key', $key);
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Return type of getConfigTreeBuilder()
is undeclared type \Symfony\Component\Config\Definition\Builder\TreeBuilder
Open
Open
public function getConfigTreeBuilder()
- Exclude checks
Parameter $container
has undeclared type \Symfony\Component\DependencyInjection\ContainerBuilder
Open
Open
public function load(array $configs, ContainerBuilder $container)
- Exclude checks
Reference to undeclared class \Symfony\Component\HttpKernel\Bundle\Bundle
Open
Open
parent::build($container);
- Exclude checks