The return type ManufacturerTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?
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.
Loading history...
38
*/
39
public function setConsignment(bool $consignment)
40
{
41
$this->consignment = $consignment;
42
return $this;
43
}
44
45
/**
46
* @return StockMovementInterface|null
47
*/
48
public function getConsignmentLastStockMovement(): ?StockMovementInterface
The return type ManufacturerTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?
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.
Loading history...
56
*/
57
public function setConsignmentLastStockMovement(?StockMovementInterface $consignmentLastStockMovement)
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.