for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of expect package.
*
* (c) Noritaka Horio <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace expect\config;
use expect\Configuration;
* Implement of Configuration
* @author Noritaka Horio <[email protected]>
* @copyright Noritaka Horio <[email protected]>
trait ConfigurableConfiguration
{
* @var \expect\ResultReporter|null
private $resultReporter = null;
* @var \expect\PackageRegistrar[]
private $matcherRegistrars = [];
* {@inheritdoc}
public function getResultReporter()
return $this->resultReporter;
}
public function getMatcherRegistrars()
return $this->matcherRegistrars;
public function merge(Configuration $config)
$matcherRegistrars = array_merge(
$this->matcherRegistrars,
$config->getMatcherRegistrars()
);
$reporter = $config->getResultReporter();
if ($reporter === null) {
$reporter = $this->resultReporter;
return new RuntimeConfiguration($matcherRegistrars, $reporter);