The class Commercetools\Core\Model...count\CartDiscountValue has been deprecated with message: use RelativeCartDiscountValue, AbsoluteCartDiscountValue or GiftLineItemCartDiscountValue instead.
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be
removed from the class and what other constant to use instead.
This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
18
{
19
/**
20
* @inheritDoc
21
*/
22
public function __construct(array $data = [], $context = null)
It seems like $money defined by parameter $money on line 52 can be null; however, Commercetools\Core\Model...scountValue::setMoney() does not accept null, maybe add an additional type check?
It seems like you allow that null is being passed for a parameter, however the
function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):
functionnotNullable(stdClass$x){}// UnsafefunctionwithoutCheck(stdClass$x=null){notNullable($x);}// Safe - Alternative 1: Adding Additional Type-CheckfunctionwithCheck(stdClass$x=null){if($xinstanceofstdClass){notNullable($x);}}// Safe - Alternative 2: Changing ParameterfunctionwithNonNullableParam(stdClass$x){notNullable($x);}
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.