classes/Autoloader.php
Showing 7 of 7 total issues
Function registry
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
Open
private function registry(string $type): array { // only register once if (array_key_exists($type, $this->registry)) { return $this->registry[$type];
- Read upRead up
File Autoloader.php
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php declare(strict_types=1); namespace Bnomei;
Method registry
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function registry(string $type): array { // only register once if (array_key_exists($type, $this->registry)) { return $this->registry[$type];
Method __construct
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct(array $options = []) { $this->options = self::array_merge_recursive_distinct([ // we can not read the kirby options since we are loading // while kirby is booting, but once spyc is removed we can
Autoloader
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
final class Autoloader{ // exclude files like filename.config.(php|yml) public const PHP = '/^[\w\d\-\_]+\.php$/';
Consider simplifying this complex logical expression. Open
Open
if ($options['key'] === 'classname') { $this->registry[$type][$key] = $class; } elseif ($options['key'] === 'route') { // Author: @tobimori $pattern = strtolower($file->getRelativePathname());
Avoid too many return
statements within this method. Open
Open
return $this->registry[$type];