Skip to content

Commit

Permalink
ENGCOM-7971: 1716: Use Magento naming approach for FolderTree class #…
Browse files Browse the repository at this point in the history
  • Loading branch information
slavvka committed Aug 7, 2020
2 parents 69f8d96 + b5d8ad1 commit 28ac0c5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Framework\Controller\Result\Json;
use Magento\Framework\Controller\ResultFactory;
use Magento\MediaGalleryUi\Model\Directories\FolderTree;
use Magento\MediaGalleryUi\Model\Directories\GetFolderTree;
use Psr\Log\LoggerInterface;

/**
Expand All @@ -33,33 +33,33 @@ class GetTree extends Action implements HttpGetActionInterface
private $logger;

/**
* @var FolderTree
* @var GetFolderTree
*/
private $folderTree;
private $getFolderTree;

/**
* Constructor
*
* @param Action\Context $context
* @param LoggerInterface $logger
* @param FolderTree $folderTree
* @param GetFolderTree $getFolderTree
*/
public function __construct(
Action\Context $context,
LoggerInterface $logger,
FolderTree $folderTree
GetFolderTree $getFolderTree
) {
parent::__construct($context);
$this->logger = $logger;
$this->folderTree = $folderTree;
$this->getFolderTree = $getFolderTree;
}
/**
* @inheritdoc
*/
public function execute()
{
try {
$responseContent[] = $this->folderTree->buildTree();
$responseContent[] = $this->getFolderTree->execute();
$responseCode = self::HTTP_OK;
} catch (\Exception $exception) {
$this->logger->critical($exception);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* Build folder tree structure by path
*/
class FolderTree
class GetFolderTree
{
/**
* @var Filesystem
Expand Down Expand Up @@ -56,7 +56,7 @@ public function __construct(
* @return array
* @throws ValidatorException
*/
public function buildTree(bool $skipRoot = true): array
public function execute(bool $skipRoot = true): array
{
return $this->buildFolderTree($this->getDirectories(), $skipRoot);
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/MediaGalleryUi/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</argument>
</arguments>
</type>
<type name="Magento\MediaGalleryUi\Model\Directories\FolderTree">
<type name="Magento\MediaGalleryUi\Model\Directories\GetFolderTree">
<arguments>
<argument name="path" xsi:type="string">media</argument>
</arguments>
Expand Down

0 comments on commit 28ac0c5

Please sign in to comment.