for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WebinoViewLib\Feature;
use WebinoConfigLib\Config;
use WebinoConfigLib\Feature\FeatureInterface;
use WebinoDomLib\Dom\Config\AbstractSpecConfig;
use WebinoDomLib\Dom\Config\SpecConfigAggregateInterface;
/**
* Class CommonView
*/
class CommonView extends Config implements
FeatureInterface,
ViewConfigInterface
{
* Config key
const COMMON = 'common';
* @param array $config
public function __construct(array $config = [])
$spec = $this->createSpec($config);
parent::__construct([[$this::VIEW => [$this::COMMON => $spec]]]);
}
private function createSpec(array $config, &$spec= [])
foreach ($config as $feature) {
// TODO refactoring dependencies
// if interface
if (method_exists($feature, 'getDependencies')) {
$spec = array_replace($spec, $this->createSpec($feature->getDependencies(), $spec));
if ($feature instanceof SpecConfigAggregateInterface) {
$this->addFeature($feature);
$feature
object<WebinoDomLib\Dom\...nfigAggregateInterface>
object<WebinoConfigLib\Feature\FeatureInterface>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
$feature = $feature->getSpecConfig();
if ($feature instanceof AbstractSpecConfig) {
$spec[$feature->getName()] = $feature->toArray();
return $spec;
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: