* Use of this software is governed by the Business Source License included in the LICENSE file and at https://getparthenon.com/docs/next/license.
9
*
10
* Change Date: TBD ( 3 years after 2.2.0 release )
11
*
12
* On the date above, in accordance with the Business Source License, use of this software will be governed by the open source license specified in the LICENSE file.
13
*/
14
15
namespace Parthenon\Billing\Invoice;
16
17
use Parthenon\Billing\Entity\CustomerInterface;
18
use Parthenon\Billing\Entity\Invoice;
19
use Parthenon\Billing\Repository\PaymentRepositoryInterface;
20
use Parthenon\Billing\Repository\SubscriptionRepositoryInterface;
In this branch, the function will implicitly return null which is incompatible with the type-hinted return Parthenon\Billing\Entity\Invoice. Consider adding a return statement or allowing null as return value.
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type.
Let?s take a look at an example:
interfaceReturnsInt{publicfunctionreturnsIntHinted():int;}classMyClassimplementsReturnsInt{publicfunctionreturnsIntHinted():int{if(foo()){return123;}// here: null is implicitly returned}}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.