1 | <?php |
||
15 | class JSONCatalogProvider implements CatalogProviderInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var FilesystemInterface $filesystem The filesystem this Catalog instance works on |
||
19 | */ |
||
20 | private $filesystem; |
||
21 | |||
22 | /** |
||
23 | * @var string $catalogFilePath The path to the JSON file containing the catalog in the given $filesystem |
||
24 | */ |
||
25 | private $catalogFilePath; |
||
26 | |||
27 | /** |
||
28 | * @var CatalogMapper A catalog mapper for converting unstructured catalog data into Catalog models |
||
29 | */ |
||
30 | private $catalogMapper; |
||
31 | /** |
||
32 | * @var JSONDecoder |
||
33 | */ |
||
34 | private $jsonDecoder; |
||
35 | |||
36 | /** |
||
37 | * Creates a new instance of the JSONCatalogProvider class. |
||
38 | * |
||
39 | * @param FilesystemInterface $filesystem The filesystem this Catalog instance works on |
||
40 | * @param string $catalogFilePath The path to the JSON file containing the catalog in the given |
||
41 | * $filesystem |
||
42 | * |
||
43 | * @param JSONDecoder $jsonDecoder A JSON decoder |
||
44 | * @param CatalogMapper $catalogMapper A catalog mapper for converting unstructured catalog data into |
||
45 | * Catalog models |
||
46 | */ |
||
47 | 5 | public function __construct( |
|
58 | |||
59 | /** |
||
60 | * Get the product catalog. |
||
61 | * |
||
62 | * @return Catalog |
||
63 | * |
||
64 | * @throws CatalogException If the catalog could not be created. |
||
65 | */ |
||
66 | 5 | public function getCatalog() |
|
88 | } |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.