61 public function __construct(
string $moduleName,
string $objectName =
'')
63 $this->moduleNameCase = ucfirst($moduleName);
64 $this->moduleNameLower = strtolower($moduleName);
65 $this->moduleNameUpper = strtoupper($moduleName);
67 if ($objectName ===
'') {
68 $this->objectNameCase =
'';
69 $this->objectNameLower =
'';
70 $this->objectNameUpper =
'';
74 if (strtolower($moduleName) === strtolower($objectName)) {
75 throw new \InvalidArgumentException(
76 'Module and object names cannot be identical (case-insensitive match): "'
77 . $moduleName .
'" vs "' . $objectName .
'"'
81 $this->objectNameCase = ucfirst($objectName);
82 $this->objectNameLower = strtolower($objectName);
83 $this->objectNameUpper = strtoupper($objectName);
98 'MYMODULE' => $this->moduleNameUpper,
99 'MyModule' => $this->moduleNameCase,
100 'My module' => $this->moduleNameCase,
101 'my module' => $this->moduleNameLower,
102 'Mon module' => $this->moduleNameCase,
103 'mon module' => $this->moduleNameLower,
104 'mymodule' => $this->moduleNameLower,
107 if ($this->objectNameLower !==
'') {
108 $map[
'MYOBJECT'] = $this->objectNameUpper;
109 $map[
'MyObject'] = $this->objectNameCase;
110 $map[
'My Object'] = $this->objectNameCase;
111 $map[
'my object'] = $this->objectNameLower;
112 $map[
'myobject'] = $this->objectNameLower;