for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Borobudur-Cqrs package.
*
* (c) Hexacodelabs <http://hexacodelabs.com>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Borobudur\Cqrs\Bus;
use Borobudur\Bus\Bus;
use Borobudur\Bus\Message\MessageInterface;
use Borobudur\Cqrs\Collection;
use Borobudur\Cqrs\Exception\InvalidArgumentException;
use Borobudur\Cqrs\Message\QueryInterface;
use Borobudur\Cqrs\ReadModel\ReadModelInterface;
/**
* @author Iqbal Maulana <[email protected]>
* @created 8/19/15
class QueryBus extends Bus
{
const BUS_NAME = 'bus.query';
* {@inheritdoc}
public function getName()
return QueryBus::BUS_NAME;
}
* @return ReadModelInterface|Collection
public function dispatchNow(MessageInterface $query)
if (!$query instanceof QueryInterface) {
throw new InvalidArgumentException(sprintf(
'Query "%s" should implement \Borobudur\Cqrs\Message\QueryInterface',
get_class($query)
));
$results = parent::dispatchNow($query);
dispatchNow()
Borobudur\Bus\Bus
dispatch()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
if (null === $results) {
return null;
return $results;
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.