-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from spryker-sdk/bugfix/supesc-8668/fixed-eval…
…uator-for-deprecated-features SUPESC-8668 Fixed validation for deprecated features.
- Loading branch information
Showing
8 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["spryker-feature\/marketplace-cart-notes","spryker-feature\/custom-order-reference","spryker-feature\/configurable-bundle-note","spryker-feature\/content-item","spryker-feature\/category-image","spryker-feature\/customer-notes","spryker-feature\/development-integration","spryker-feature\/backup","spryker-feature\/data-export","spryker-feature\/multistore","spryker-feature\/product-promotions","spryker-feature\/persistent-cart","spryker-feature\/cart-notes","spryker-feature\/order-threshold","spryker-feature\/split-shipment","spryker-feature\/newsletter-subscription","spryker-feature\/discontinued-products","spryker-feature\/product-validity","spryker-feature\/content-based-shop-navigation","spryker-feature\/product-based-shop-navigation","spryker-feature\/spryker-core-e-commerce","spryker-feature\/purchaise-approval-not-in-october-release","spryker-feature\/raitings-review"] |
46 changes: 46 additions & 0 deletions
46
src/Checker/MinimumShopVersionChecker/DeprecatedFeaturesReader.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved. | ||
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SprykerSdk\Evaluator\Checker\MinimumShopVersionChecker; | ||
|
||
use InvalidArgumentException; | ||
|
||
class DeprecatedFeaturesReader | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected string $deprecatedFeaturesFile; | ||
|
||
/** | ||
* @param string $deprecatedFeaturesFile | ||
*/ | ||
public function __construct(string $deprecatedFeaturesFile) | ||
{ | ||
$this->deprecatedFeaturesFile = $deprecatedFeaturesFile; | ||
} | ||
|
||
/** | ||
* @throws \InvalidArgumentException | ||
* | ||
* @return array<string, string> | ||
*/ | ||
public function getDeprecatedFeatures(): array | ||
{ | ||
$content = file_get_contents($this->deprecatedFeaturesFile); | ||
|
||
if ($content === false) { | ||
throw new InvalidArgumentException( | ||
sprintf('Unable to read file %s. Error: %s', $this->deprecatedFeaturesFile, error_get_last()['message'] ?? '-'), | ||
); | ||
} | ||
|
||
return json_decode($content, true, 512, \JSON_THROW_ON_ERROR); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.