1 | <?php |
||
13 | class CatalogMapper |
||
14 | { |
||
15 | const FIELD_SKU = "sku"; |
||
16 | const FIELD_TITLE = "title"; |
||
17 | const FIELD_SUMMARY = "summary"; |
||
18 | const FIELD_SLUG = "slug"; |
||
19 | |||
20 | /** |
||
21 | * @var array $mandatoryFields A list of all mandatory fields of a Product |
||
22 | */ |
||
23 | private $mandatoryFields = [self::FIELD_SKU, self::FIELD_TITLE, self::FIELD_SUMMARY, self::FIELD_SLUG]; |
||
|
|||
24 | /** |
||
25 | * @var ProductMapper |
||
26 | */ |
||
27 | private $productMapper; |
||
28 | |||
29 | /** |
||
30 | * Creates a new instance of the CatalogMapper class. |
||
31 | * |
||
32 | * @param ProductMapper $productMapper A ProductMapper instance for converting unstructured product data to Product |
||
33 | * models |
||
34 | */ |
||
35 | 13 | public function __construct(ProductMapper $productMapper) |
|
39 | |||
40 | /** |
||
41 | * Get a Catalog model from the an array of catalog data |
||
42 | * |
||
43 | * @param array $catalogData An array containing a product catalog |
||
44 | * |
||
45 | * @return Catalog |
||
46 | * |
||
47 | * @throws CatalogException If the catalog cannot be created |
||
48 | */ |
||
49 | 9 | public function getCatalog(array $catalogData) |
|
94 | } |
This check marks private properties in classes that are never used. Those properties can be removed.