Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
43 | public function setOrganizingMode(?int $organizingMode) |
||
44 | { |
||
45 | if ($organizingMode !== null) { |
||
46 | \Tfboe\FmLib\Entity\Categories\OrganizingMode::ensureValidValue($organizingMode); |
||
47 | } |
||
48 | $this->organizingMode = $organizingMode; |
||
49 | return $this; |
||
50 | } |
||
51 | //</editor-fold desc="Public Methods"> |
||
52 | } |
In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.
If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.