for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* Copyright (c) Arnaud Ligny <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cecil\Generator;
use Cecil\Collection\Page\Collection as PagesCollection;
use Cecil\Config;
use Cecil\Util;
/**
* Abstract class AbstractGenerator.
abstract class AbstractGenerator implements GeneratorInterface
{
/* @var Config */
protected $config;
/* @var PagesCollection */
protected $pagesCollection;
/* @var $messageCallback */
protected $messageCallback;
protected $generatedPages;
* {@inheritdoc}
public function __construct(Config $config)
$this->config = $config;
// Create new empty collection
$this->generatedPages = new PagesCollection('generator-'.Util::formatClassName($this, ['lowercase' => true]));
$this
this<Cecil\Generator\AbstractGenerator>
object<object>
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);
}
* @param PagesCollection $pagesCollection
* @param \Closure $messageCallback
* @return PagesCollection
public function runGenerate(PagesCollection $pagesCollection, \Closure $messageCallback): PagesCollection
$this->pagesCollection = $pagesCollection;
$this->messageCallback = $messageCallback;
$this->generate();
return $this->generatedPages;
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: