for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : [email protected] */
/* web : http://www.thelia.net */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
namespace Thelia\Module;
use Thelia\Model\Area;
use Thelia\Model\AreaDeliveryModuleQuery;
use Thelia\Model\Country;
use Thelia\Model\State;
abstract class AbstractDeliveryModule extends BaseModule implements DeliveryModuleInterface
{
// This class is the base class for delivery modules
// It may contains common methods in the future.
/**
* @return bool
*/
public function handleVirtualProductDelivery()
return false;
}
* Return the first area that matches the given country for the given module
* @param Country $country
* @param BaseModule $module
* @return Area|null
public function getAreaForCountry(Country $country)
$area = null;
if (null !== $areaDeliveryModule = AreaDeliveryModuleQuery::create()->findByCountryAndModule(
$country,
$this->getModuleModel()
)) {
$area = $areaDeliveryModule->getArea();
return $area;
public function getDeliveryMode()
return "delivery";
public function getMinimumDeliveryDate(Country $country, State $state = null)
$state
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function getMinimumDeliveryDate(Country $country, /** @scrutinizer ignore-unused */ State $state = null)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$country
public function getMinimumDeliveryDate(/** @scrutinizer ignore-unused */ Country $country, State $state = null)
return null;
public function getMaximumDeliveryDate(Country $country, State $state = null)
public function getMaximumDeliveryDate(Country $country, /** @scrutinizer ignore-unused */ State $state = null)
public function getMaximumDeliveryDate(/** @scrutinizer ignore-unused */ Country $country, State $state = null)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.