Skip to content

Commit 28ac0c5

Browse files
authored
ENGCOM-7971: 1716: Use Magento naming approach for FolderTree class #29412
2 parents 69f8d96 + b5d8ad1 commit 28ac0c5

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

app/code/Magento/MediaGalleryUi/Controller/Adminhtml/Directories/GetTree.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\App\Action\HttpGetActionInterface;
1212
use Magento\Framework\Controller\Result\Json;
1313
use Magento\Framework\Controller\ResultFactory;
14-
use Magento\MediaGalleryUi\Model\Directories\FolderTree;
14+
use Magento\MediaGalleryUi\Model\Directories\GetFolderTree;
1515
use Psr\Log\LoggerInterface;
1616

1717
/**
@@ -33,33 +33,33 @@ class GetTree extends Action implements HttpGetActionInterface
3333
private $logger;
3434

3535
/**
36-
* @var FolderTree
36+
* @var GetFolderTree
3737
*/
38-
private $folderTree;
38+
private $getFolderTree;
3939

4040
/**
4141
* Constructor
4242
*
4343
* @param Action\Context $context
4444
* @param LoggerInterface $logger
45-
* @param FolderTree $folderTree
45+
* @param GetFolderTree $getFolderTree
4646
*/
4747
public function __construct(
4848
Action\Context $context,
4949
LoggerInterface $logger,
50-
FolderTree $folderTree
50+
GetFolderTree $getFolderTree
5151
) {
5252
parent::__construct($context);
5353
$this->logger = $logger;
54-
$this->folderTree = $folderTree;
54+
$this->getFolderTree = $getFolderTree;
5555
}
5656
/**
5757
* @inheritdoc
5858
*/
5959
public function execute()
6060
{
6161
try {
62-
$responseContent[] = $this->folderTree->buildTree();
62+
$responseContent[] = $this->getFolderTree->execute();
6363
$responseCode = self::HTTP_OK;
6464
} catch (\Exception $exception) {
6565
$this->logger->critical($exception);

app/code/Magento/MediaGalleryUi/Model/Directories/FolderTree.php renamed to app/code/Magento/MediaGalleryUi/Model/Directories/GetFolderTree.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/**
1616
* Build folder tree structure by path
1717
*/
18-
class FolderTree
18+
class GetFolderTree
1919
{
2020
/**
2121
* @var Filesystem
@@ -56,7 +56,7 @@ public function __construct(
5656
* @return array
5757
* @throws ValidatorException
5858
*/
59-
public function buildTree(bool $skipRoot = true): array
59+
public function execute(bool $skipRoot = true): array
6060
{
6161
return $this->buildFolderTree($this->getDirectories(), $skipRoot);
6262
}

app/code/Magento/MediaGalleryUi/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</argument>
2929
</arguments>
3030
</type>
31-
<type name="Magento\MediaGalleryUi\Model\Directories\FolderTree">
31+
<type name="Magento\MediaGalleryUi\Model\Directories\GetFolderTree">
3232
<arguments>
3333
<argument name="path" xsi:type="string">media</argument>
3434
</arguments>

0 commit comments

Comments
 (0)