for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace GBProd;
use Elastica\Client;
use Interop\Container\ContainerInterface;
use Interop\Container\ServiceProvider;
/**
* Service provider for Elastica
*
* @author GBProd <[email protected]>
*/
class ElasticaServiceProvider implements ServiceProvider
{
* @var string
private $suffix;
* @param string $suffix
$suffix
string|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($suffix = null)
$this->suffix = $suffix ? '.'.$suffix : '';
}
* {inheritdoc}
public function getServices()
return [
Client::class.$this->suffix => function (ContainerInterface $container) {
return new Client([
'host' => $container->get(Client::class.$this->suffix.'.host'),
'port' => $container->get(Client::class.$this->suffix.'.port')
]);
];
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.