for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Wambo\Catalog;
use League\Flysystem\FilesystemInterface;
use Wambo\Catalog\Exception\CatalogException;
use Wambo\Catalog\Mapper\CatalogMapper;
use Wambo\Catalog\Mapper\ContentMapper;
use Wambo\Catalog\Mapper\ProductMapper;
use Wambo\Catalog\Model\Catalog;
/**
* Class CatalogFactory creates Catalog models
*
* @package Wambo\Catalog
*/
class CatalogFactory
{
/** @var CatalogProviderInterface $catalogProvider */
private $catalogProvider;
* CatalogFactory constructor.
* @param FilesystemInterface $filesystem
* @param string $jsonCatalogFilePath The path to the JSON catalog
public function __construct(FilesystemInterface $filesystem, string $jsonCatalogFilePath)
$contentMapper = new ContentMapper();
$productMapper = new ProductMapper($contentMapper);
$catalogMapper = new CatalogMapper($productMapper);
$this->catalogProvider = new JSONCatalogProvider($filesystem, $jsonCatalogFilePath, $catalogMapper);
JSONCatalogProvider::__construct()
$catalogMapper
This check looks for function calls that miss required arguments.
object<Wambo\Catalog\Mapper\CatalogMapper>
object<Wambo\Core\Storage\JSONDecoder>
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);
}
* Get the product catalog
* @return Catalog
* @throws CatalogException
public function getCatalog()
return $this->catalogProvider->getCatalog();
This check looks for function calls that miss required arguments.