@@ -31,10 +31,11 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function setValue($value) |
| 33 | 33 | { |
| 34 | - if ($this->isValidEnumValue($value)) |
|
| 35 | - $this->value = $value; |
|
| 36 | - else |
|
| 37 | - throw new Exception(ErrorMessages::getInvalidTypeMessage()); |
|
| 34 | + if ($this->isValidEnumValue($value)) { |
|
| 35 | + $this->value = $value; |
|
| 36 | + } else { |
|
| 37 | + throw new Exception(ErrorMessages::getInvalidTypeMessage()); |
|
| 38 | + } |
|
| 38 | 39 | } |
| 39 | 40 | |
| 40 | 41 | /** |
@@ -48,7 +49,9 @@ discard block |
||
| 48 | 49 | $reflector = new \ReflectionClass(get_class($this)); |
| 49 | 50 | foreach ($reflector->getConstants() as $validValue) |
| 50 | 51 | { |
| 51 | - if ($validValue == $checkValue) return true; |
|
| 52 | + if ($validValue == $checkValue) { |
|
| 53 | + return true; |
|
| 54 | + } |
|
| 52 | 55 | } |
| 53 | 56 | return false; |
| 54 | 57 | } |
@@ -94,10 +94,11 @@ |
||
| 94 | 94 | * @throws Exception |
| 95 | 95 | */ |
| 96 | 96 | public function getFactory($factoryClassName) { |
| 97 | - if (array_key_exists($factoryClassName, $this->factoryClasses)) |
|
| 98 | - return $this->factoryClasses[$factoryClassName]; |
|
| 99 | - else |
|
| 100 | - throw new Exception(ErrorMessages::getFactoryClassNotInitializedMessage($factoryClassName)); |
|
| 97 | + if (array_key_exists($factoryClassName, $this->factoryClasses)) { |
|
| 98 | + return $this->factoryClasses[$factoryClassName]; |
|
| 99 | + } else { |
|
| 100 | + throw new Exception(ErrorMessages::getFactoryClassNotInitializedMessage($factoryClassName)); |
|
| 101 | + } |
|
| 101 | 102 | } |
| 102 | 103 | |
| 103 | 104 | /** |