for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Cubiche package.
*
* Copyright (c) Cubiche
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cubiche\Core\Specification;
* Specification Trait.
* @author Karel Osorio Ramírez <[email protected]>
trait SpecificationTrait
{
* @param string $method
* @param array $arguments
* @throws \BadMethodCallException
public function __call($method, array $arguments)
if ($method === 'and' || $method === 'or') {
return \call_user_func_array(array($this, $method.'X'), $arguments);
}
throw new \BadMethodCallException(\sprintf('Call to undefined method %s::%s', \get_class($this), $method));
* {@inheritdoc}
public function andX(SpecificationInterface $specification)
return new AndSpecification($this, $specification);
public function orX(SpecificationInterface $specification)
return new OrSpecification($this, $specification);
public function not()
return new NotSpecification($this);