| Conditions | 6 |
| Paths | 10 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | /** |
||
| 17 | * Get the class name for the module. |
||
| 18 | * |
||
| 19 | * @param string $moduleName |
||
| 20 | * @param string $moduleType |
||
| 21 | * @param string $fieldName |
||
| 22 | * |
||
| 23 | * @return string |
||
| 24 | */ |
||
| 25 | public static function getModuleClassName(string $moduleName, string $moduleType, string $fieldName): string |
||
| 26 | { |
||
| 27 | $filePath = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'modules' . \DIRECTORY_SEPARATOR . $moduleName . \DIRECTORY_SEPARATOR . $moduleType . \DIRECTORY_SEPARATOR . $fieldName . '.php'; |
||
| 28 | if (file_exists($filePath)) { |
||
| 29 | return '\\YF\\Modules' . '\\' . $moduleName . '\\' . $moduleType . '\\' . $fieldName; |
||
| 30 | } |
||
| 31 | $filePath = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'modules' . \DIRECTORY_SEPARATOR . 'Base' . \DIRECTORY_SEPARATOR . $moduleType . \DIRECTORY_SEPARATOR . $fieldName . '.php'; |
||
| 32 | if (file_exists($filePath)) { |
||
| 33 | return '\\YF\\Modules\\Base' . '\\' . $moduleType . '\\' . $fieldName; |
||
| 34 | } |
||
| 35 | throw new Exceptions\AppException("HANDLER_NOT_FOUND: $moduleName, $moduleType, $fieldName"); |
||
| 36 | } |
||
| 38 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.