pixelfederation/swoole-bundle

View on GitHub
src/Bridge/Symfony/Container/Proxy/UnmanagedFactoryInstantiator.php

Summary

Maintainability
A
2 hrs
Test Coverage

Method newInstance has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function newInstance(
        object $instance,
        array $factoryConfigs,
        int $globalInstancesLimit
    ): object {
Severity: Minor
Found in src/Bridge/Symfony/Container/Proxy/UnmanagedFactoryInstantiator.php - About 1 hr to fix

    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            private AccessInterceptorValueHolderFactory $proxyFactory,
            private Instantiator $instantiator,
            private ServicePoolContainer $servicePoolContainer,
            private MutexFactory $limitLocking,
            private MutexFactory $newInstanceLocking
    Severity: Minor
    Found in src/Bridge/Symfony/Container/Proxy/UnmanagedFactoryInstantiator.php - About 35 mins to fix

      Missing class import via use statement (line '66', column '27').
      Open

                      throw new \RuntimeException(sprintf('Missing method %s in class %s', $factoryMethod, $instance::class));

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '59', column '23').
      Open

                  throw new \RuntimeException(sprintf('Factory methods missing for class %s', $instance::class));

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Avoid unused parameters such as '$proxy'.
      Open

                      object $proxy,

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

      Multi-line use declarations must define one parameter per line
      Open

                  ) use ($servicePoolContainer, $instantiator, $factoryConfig, $mutex, $globalInstancesLimit) {

      Multi-line use declarations must define one parameter per line
      Open

                  ) use ($servicePoolContainer, $instantiator, $factoryConfig, $mutex, $globalInstancesLimit) {

      Multi-line use declarations must define one parameter per line
      Open

                  ) use ($servicePoolContainer, $instantiator, $factoryConfig, $mutex, $globalInstancesLimit) {

      Multi-line use declarations must define one parameter per line
      Open

                  ) use ($servicePoolContainer, $instantiator, $factoryConfig, $mutex, $globalInstancesLimit) {

      Line indented incorrectly; expected 4 spaces, found 8
      Open

              private MutexFactory $limitLocking,

      Line indented incorrectly; expected 4 spaces, found 8
      Open

              private ServicePoolContainer $servicePoolContainer,

      Line indented incorrectly; expected 4 spaces, found 8
      Open

              private AccessInterceptorValueHolderFactory $proxyFactory,

      Line indented incorrectly; expected 4 spaces, found 8
      Open

              private Instantiator $instantiator,

      Line indented incorrectly; expected 4 spaces, found 8
      Open

              private MutexFactory $newInstanceLocking

      There are no issues that match your filters.

      Category
      Status