for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Component\Core\Customer\Statistics;
use Webmozart\Assert\Assert;
/**
* @author Jan Góralski <[email protected]>
final class CustomerStatistics
{
* @var PerChannelCustomerStatistics[]
private $perChannelsStatistics;
* @param PerChannelCustomerStatistics[] $perChannelStatistics
public function __construct(array $perChannelStatistics)
Assert::allIsInstanceOf($perChannelStatistics, PerChannelCustomerStatistics::class);
$this->perChannelsStatistics = $perChannelStatistics;
}
* @return int
integer|double
This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.
@return
public function getAllOrdersCount()
return array_sum(array_map(function (PerChannelCustomerStatistics $statistics) {
return $statistics->getOrdersCount();
}, $this->perChannelsStatistics));
* @return PerChannelCustomerStatistics[]
public function getPerChannelsStatistics()
return $this->perChannelsStatistics;
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.