for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Zortje\SEO;
use Zortje\Rules\ResultCollection;
use Zortje\Rules\RuleCollection;
use Zortje\Rules\RuleInterface;
use Zortje\Rules\Subject;
use Zortje\SEO\Page\ImageRule;
use Zortje\SEO\Page\TitleRule;
/**
* Class PageRule
*
* @package Zortje\SEO
*/
class PageRule implements RuleInterface
{
* Check page rules
* @param Subject $subject
* @return ResultCollection
public function check(Subject $subject): ResultCollection
$ruleCollection = new RuleCollection();
$ruleCollection->add(new TitleRule());
$ruleCollection->add(new ImageRule());
new \Zortje\SEO\Page\ImageRule()
object<Zortje\SEO\Page\ImageRule>
object<Zortje\Rules\RuleInterface>
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);
return $ruleCollection->check($subject);
}
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: