| Total Complexity | 4 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | trait HasMessageBuilderTrait |
||
| 12 | { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param string $type |
||
| 16 | * @return mixed |
||
| 17 | */ |
||
| 18 | public function generateMessageBuilder($type = 'mail') |
||
| 19 | { |
||
| 20 | $class = $this->generateMessageBuilderClass(); |
||
|
|
|||
| 21 | $builder = new $class(); |
||
| 22 | return $builder; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @return string |
||
| 27 | */ |
||
| 28 | public function generateMailBuilderClass() |
||
| 29 | { |
||
| 30 | return EmailBuilder::class; |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param string $type |
||
| 35 | * @return null |
||
| 36 | */ |
||
| 37 | protected function generateMessageBuilderClass($type = 'mail') |
||
| 44 | } |
||
| 45 | } |
||
| 46 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.