| Conditions | 12 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 14 |
| 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 declare(strict_types=1); |
||
| 46 | protected function requireClasses() |
||
| 47 | { |
||
| 48 | foreach ($this->classes as $classPath => $className) { |
||
|
|
|||
| 49 | |||
| 50 | $className = '\\' . ltrim($className, '\\'); |
||
| 51 | // if (preg_match('/dbQuery/', $className)) { |
||
| 52 | // trace('sdf'); |
||
| 53 | // } |
||
| 54 | if (file_exists($classPath) |
||
| 55 | && !preg_match('/\/api\/generated\//', $className) |
||
| 56 | && !preg_match('/activerecord\/dbQuery/', $className) |
||
| 57 | && !preg_match('/samson\/activerecord\//', $className) |
||
| 58 | && !preg_match('/Field.php$/', $classPath) |
||
| 59 | && !preg_match('/Navigation.php$/', $classPath) |
||
| 60 | && !preg_match('/TableVirtualCollection.php$/', $classPath) |
||
| 61 | && !preg_match('/TableVirtualEntity.php$/', $classPath) |
||
| 62 | && !preg_match('/TableVirtualQuery.php$/', $classPath) |
||
| 63 | && !class_exists($className) |
||
| 64 | ) { |
||
| 65 | require_once($classPath); |
||
| 66 | } |
||
| 67 | } |
||
| 68 | } |
||
| 69 | |||
| 86 |