1 | <?php |
||
14 | trait ObjectUtilities |
||
15 | { |
||
16 | /** |
||
17 | * Get a ReflectionClass from the given class name |
||
18 | * |
||
19 | * @param string $className |
||
20 | * @return ReflectionClass |
||
21 | */ |
||
22 | public function getReflection($className) |
||
30 | |||
31 | /** |
||
32 | * Given a class name, find and return which module it belongs to |
||
33 | * |
||
34 | * @param string $className |
||
35 | * @return string |
||
36 | */ |
||
37 | public function getModuleName($className) |
||
53 | |||
54 | /** |
||
55 | * Given a folder name, load a possible composer.json configuration from inside it. This method will handle |
||
56 | * the main project folder e.g. "mysite" by looking in the root folder rather than the folder itself. |
||
57 | * |
||
58 | * @param string $folderName |
||
59 | * @return array |
||
60 | */ |
||
61 | public function getModuleComposerConfiguration($folderName) |
||
80 | } |
||
81 |
Instead of relying on
global
state, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state