if (empty($details)) { throw new RuntimeException('No product urls found'
);
}if (empty($listings)) { throw new RuntimeException('No listing urls found'
);
}if (empty($products)) { throw new RuntimeException('No product numbers found'
);
}echo 'Collected: ' .
count($listings) . ' listing urls' . \PHP_EOL;
$fs->
dumpFile(__DIR__ . '/fixtures/listing_urls.json',
json_encode($listings, \JSON_THROW_ON_ERROR
));
echo 'Collected: ' .
count($details) . ' product urls' . \PHP_EOL;
$fs->
dumpFile(__DIR__ . '/fixtures/product_urls.json',
json_encode($details, \JSON_THROW_ON_ERROR
));
echo 'Collected: ' .
count($salesChannel) . ' sales channels' . \PHP_EOL;
$fs->
dumpFile(__DIR__ . '/fixtures/sales_channel.json',
json_encode($salesChannel, \JSON_THROW_ON_ERROR
));
echo 'Collected: ' .
count($keywords) . ' keywords' . \PHP_EOL;
$fs->
dumpFile(__DIR__ . '/fixtures/keywords.json',
json_encode($keywords, \JSON_THROW_ON_ERROR
));
echo 'Collected: ' .
count($products) . ' products' . \PHP_EOL;