Function get
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
public function get($id)
{
$id = ucfirst($id);
if (array_key_exists($id, $this->instances)) {
Method get
has 66 lines of code (exceeds 25 allowed). Consider refactoring.
public function get($id)
{
$id = ucfirst($id);
if (array_key_exists($id, $this->instances)) {
Function addService
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
protected function addService(int $containerId, string $serviceId, Argument $argument): void
{
if (substr($serviceId, -8) === 'Original') {
throw new \InvalidArgumentException(sprintf(
'Service id cannot ends with "Original" keyword in "%s".',
Method addService
has 27 lines of code (exceeds 25 allowed). Consider refactoring.
protected function addService(int $containerId, string $serviceId, Argument $argument): void
{
if (substr($serviceId, -8) === 'Original') {
throw new \InvalidArgumentException(sprintf(
'Service id cannot ends with "Original" keyword in "%s".',
Function append
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
protected function append(Argument $argument, string $serviceId, int $containerId): void
{
$returnType = $argument->getReturnType();
$overridden = false;
Function register
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
public function register($container): void
{
static $id = 0;
$this->containers[++$id] = $container;
There are no issues that match your filters.