| Conditions | 1 |
| Paths | 1 |
| Total Lines | 54 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 104 | private static function createContext( $site ) |
||
| 105 | { |
||
| 106 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
||
| 107 | $aimeos = self::getAimeos(); |
||
| 108 | |||
| 109 | |||
| 110 | $paths = $aimeos->getConfigPaths( 'mysql' ); |
||
| 111 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
||
| 112 | $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
||
| 113 | $local = array( 'resource' => array( 'fs' => array( 'adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp' ) ) ); |
||
| 114 | |||
| 115 | $conf = new \Aimeos\MW\Config\PHPArray( $local, $paths ); |
||
| 116 | $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
||
| 117 | $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
||
| 118 | $ctx->setConfig( $conf ); |
||
| 119 | |||
| 120 | |||
| 121 | $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
||
| 122 | $ctx->setDatabaseManager( $dbm ); |
||
| 123 | |||
| 124 | |||
| 125 | $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf ); |
||
| 126 | $ctx->setFilesystemManager( $fs ); |
||
| 127 | |||
| 128 | |||
| 129 | $mq = new \Aimeos\MW\MQueue\Manager\Standard( $conf ); |
||
| 130 | $ctx->setMessageQueueManager( $mq ); |
||
| 131 | |||
| 132 | |||
| 133 | $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
||
| 134 | $ctx->setLogger( $logger ); |
||
| 135 | |||
| 136 | |||
| 137 | $cache = new \Aimeos\MW\Cache\None(); |
||
| 138 | $ctx->setCache( $cache ); |
||
| 139 | |||
| 140 | |||
| 141 | $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
||
| 142 | $ctx->setI18n( array( 'de' => $i18n ) ); |
||
| 143 | |||
| 144 | |||
| 145 | $session = new \Aimeos\MW\Session\None(); |
||
| 146 | $ctx->setSession( $session ); |
||
| 147 | |||
| 148 | |||
| 149 | $localeManager = \Aimeos\MShop::create( $ctx, 'locale' ); |
||
| 150 | $locale = $localeManager->bootstrap( $site, '', '', false ); |
||
|
1 ignored issue
–
show
|
|||
| 151 | $ctx->setLocale( $locale ); |
||
| 152 | |||
| 153 | |||
| 154 | $ctx->setEditor( 'ai-admin-jqadm:admin/jqadm' ); |
||
| 155 | |||
| 156 | return $ctx; |
||
| 157 | } |
||
| 158 | } |
||
| 159 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths