Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace Magento\MediaContentCatalog\Model\ResourceModel;

use Magento\Catalog\Model\ResourceModel\Product;
use Magento\Framework\App\ResourceConnection;
use Magento\MediaContentApi\Model\GetEntityContentsInterface;
use Magento\MediaContentApi\Api\Data\ContentIdentityInterface;
Expand All @@ -23,11 +22,6 @@ class GetEntityContent implements GetEntityContentsInterface
*/
private $config;

/**
* @var Product
*/
private $productResource;

/**
* @var ResourceConnection
*/
Expand All @@ -36,15 +30,12 @@ class GetEntityContent implements GetEntityContentsInterface
/**
* @param Config $config
* @param ResourceConnection $resourceConnection
* @param Product $productResource
*/
public function __construct(
Config $config,
ResourceConnection $resourceConnection,
Product $productResource
ResourceConnection $resourceConnection
) {
$this->config = $config;
$this->productResource = $productResource;
$this->resourceConnection = $resourceConnection;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Magento\Framework\Filesystem;
use Magento\Framework\Filesystem\Directory\ReadInterface;
use Magento\Framework\Filesystem\Driver\File;
use Magento\Framework\Stdlib\DateTime\DateTime;
use Magento\Framework\Stdlib\DateTime\DateTimeFactory;
use Magento\MediaGalleryApi\Api\GetAssetsByPathsInterface;
use Magento\MediaGallerySynchronizationApi\Model\ImportFilesInterface;
use Magento\MediaGallerySynchronizationApi\Api\SynchronizeFilesInterface;
Expand Down Expand Up @@ -60,14 +60,14 @@ class SynchronizeFiles implements SynchronizeFilesInterface
private $importFiles;

/**
* @var DateTime
* @var DateTimeFactory
*/
private $date;
private $dateFactory;

/**
* @param File $driver
* @param Filesystem $filesystem
* @param DateTime $date
* @param DateTimeFactory $dateFactory
* @param LoggerInterface $log
* @param GetFileInfo $getFileInfo
* @param GetAssetsByPathsInterface $getAssetsByPaths
Expand All @@ -76,15 +76,15 @@ class SynchronizeFiles implements SynchronizeFilesInterface
public function __construct(
File $driver,
Filesystem $filesystem,
DateTime $date,
DateTimeFactory $dateFactory,
LoggerInterface $log,
GetFileInfo $getFileInfo,
GetAssetsByPathsInterface $getAssetsByPaths,
ImportFilesInterface $importFiles
) {
$this->driver = $driver;
$this->filesystem = $filesystem;
$this->date = $date;
$this->dateFactory = $dateFactory;
$this->log = $log;
$this->getFileInfo = $getFileInfo;
$this->getAssetsByPaths = $getAssetsByPaths;
Expand Down Expand Up @@ -148,7 +148,7 @@ private function getPathsToUpdate(array $paths): array
*/
private function getFileModificationTime(string $path): string
{
return $this->date->gmtDate(
return $this->dateFactory->create()->gmtDate(
self::DATE_FORMAT,
$this->getFileInfo->execute($this->getMediaDirectory()->getAbsolutePath($path))->getMTime()
);
Expand Down