for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* PHP Billing Library
*
* @link https://github.com/hiqdev/php-billing
* @package php-billing
* @license BSD-3-Clause
* @copyright Copyright (c) 2017-2018, HiQDev (http://hiqdev.com/)
*/
namespace hiqdev\php\billing\tests\support\sale;
use hiqdev\php\billing\action\ActionInterface;
use hiqdev\php\billing\order\OrderInterface;
use hiqdev\php\billing\sale\SaleInterface;
use hiqdev\php\billing\sale\SaleRepositoryInterface;
class SimpleSaleRepository implements SaleRepositoryInterface
{
protected $sale;
public function __construct(SaleInterface $sale)
$this->sale = $sale;
}
public function findByAction(ActionInterface $action)
$action
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function findByAction(/** @scrutinizer ignore-unused */ ActionInterface $action)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return $this->sale;
public function findByOrder(OrderInterface $order)
$sales = [];
foreach ($order->getActions() as $actionKey => $action) {
$sales[$actionKey] = $this->findByAction($action);
return $sales;
public function findByIds(array $ids)
$ids
public function findByIds(/** @scrutinizer ignore-unused */ array $ids)
throw new \Exception('not implemented');
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.