Skip to content

Commit f9d0095

Browse files
committed
Fix PHPCS issue - The use of function file_exists() is discouraged
1 parent 89b81a9 commit f9d0095

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

app/code/Meta/BusinessExtension/Model/Api/AdobeCloudConfig.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
use Meta\BusinessExtension\Api\AdobeCloudConfigInterface;
2424
use Magento\Framework\Filesystem\DirectoryList;
25+
use Magento\Framework\Filesystem\Driver\File;
2526

2627
class AdobeCloudConfig implements AdobeCloudConfigInterface
2728
{
@@ -39,15 +40,23 @@ class AdobeCloudConfig implements AdobeCloudConfigInterface
3940
*/
4041
private $directoryList;
4142

43+
/**
44+
* @var File
45+
*/
46+
private $file;
47+
4248
/**
4349
* Class constructor
4450
*
4551
* @param DirectoryList $directoryList
52+
* @param File $file
4653
*/
4754
public function __construct(
48-
DirectoryList $directoryList
55+
DirectoryList $directoryList,
56+
File $file
4957
) {
5058
$this->directoryList = $directoryList;
59+
$this->file = $file;
5160
}
5261

5362
/**
@@ -60,8 +69,11 @@ public function isSellerOnAdobeCloud(): bool
6069
$rootPath = $this->directoryList->getRoot();
6170

6271
foreach (self::CLOUD_FILES as $file) {
63-
if (file_exists($rootPath . '/' . $file)) {
64-
return true;
72+
try {
73+
if ($this->file->isExists($rootPath . '/' . $file)) {
74+
return true;
75+
}
76+
} catch (\Exception $ex) {
6577
}
6678
}
6779

0 commit comments

Comments
 (0)