| Conditions | 1 |
| Total Lines | 79 |
| 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 |
||
| 169 | private static function createMockConnection(): ConnectionInterface |
||
| 170 | { |
||
| 171 | /* trigger_warning(' |
||
| 172 | Utilisation d\'une connexion à la base de données invalide. |
||
| 173 | Veuillez installer le package `blitz-php/database`. |
||
| 174 | '); */ |
||
| 175 | |||
| 176 | return new class () implements ConnectionInterface { |
||
| 177 | public function initialize() |
||
| 178 | { |
||
| 179 | } |
||
| 180 | |||
| 181 | public function connect(bool $persistent = false) |
||
| 182 | { |
||
| 183 | } |
||
| 184 | |||
| 185 | public function persistentConnect() |
||
| 186 | { |
||
| 187 | } |
||
| 188 | |||
| 189 | public function reconnect() |
||
| 190 | { |
||
| 191 | } |
||
| 192 | |||
| 193 | public function getConnection(?string $alias = null) |
||
| 194 | { |
||
| 195 | } |
||
| 196 | |||
| 197 | public function setDatabase(string $databaseName) |
||
| 198 | { |
||
| 199 | } |
||
| 200 | |||
| 201 | public function getDatabase(): string |
||
| 202 | { |
||
| 203 | return ''; |
||
| 204 | } |
||
| 205 | |||
| 206 | public function error(): array |
||
| 207 | { |
||
| 208 | return []; |
||
| 209 | } |
||
| 210 | |||
| 211 | public function getPlatform(): string |
||
| 212 | { |
||
| 213 | return ''; |
||
| 214 | } |
||
| 215 | |||
| 216 | public function getVersion(): string |
||
| 217 | { |
||
| 218 | return ''; |
||
| 219 | } |
||
| 220 | |||
| 221 | public function query(string $sql, $binds = null) |
||
| 222 | { |
||
| 223 | } |
||
| 224 | |||
| 225 | public function simpleQuery(string $sql) |
||
| 226 | { |
||
| 227 | } |
||
| 228 | |||
| 229 | public function table($tableName) |
||
| 230 | { |
||
| 231 | } |
||
| 232 | |||
| 233 | public function getLastQuery() |
||
| 234 | { |
||
| 235 | } |
||
| 236 | |||
| 237 | public function escape($str) |
||
| 238 | { |
||
| 239 | } |
||
| 240 | |||
| 241 | public function callFunction(string $functionName, ...$params) |
||
| 242 | { |
||
| 243 | } |
||
| 244 | |||
| 245 | public function isWriteType($sql): bool |
||
| 246 | { |
||
| 247 | return false; |
||
| 248 | } |
||
| 252 |
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