Skip to content
Merged
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
7 changes: 3 additions & 4 deletions Helper/ProductGalleryHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Cloudinary\Cloudinary\Helper;

use Cloudinary\Cloudinary\Core\ConfigurationInterface;
use Cloudinary\Cloudinary\Model\Configuration;
use Magento\Framework\App\Helper\Context;

class ProductGalleryHelper extends \Magento\Framework\App\Helper\AbstractHelper
Expand All @@ -20,7 +19,7 @@ class ProductGalleryHelper extends \Magento\Framework\App\Helper\AbstractHelper
*/
protected $cloudinaryPGoptions;

const CASTING = [
protected $_casting = [
'themeProps_primary' => 'string',
'themeProps_onPrimary' => 'string',
'themeProps_active' => 'string',
Expand Down Expand Up @@ -69,8 +68,8 @@ public function getCloudinaryPGOptions($refresh = false, $ignoreDisabled = false
$this->cloudinaryPGoptions = $this->configuration->getProductGalleryAll();
foreach ($this->cloudinaryPGoptions as $key => $value) {
//Change casting
if (isset(self::CASTING[$key])) {
\settype($value, self::CASTING[$key]);
if (isset($this->_casting[$key])) {
\settype($value, $this->_casting[$key]);
$this->cloudinaryPGoptions[$key] = $value;
}
//Build options hierarchy
Expand Down
8 changes: 4 additions & 4 deletions Model/Observer/ProductGalleryChangeTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@

namespace Cloudinary\Cloudinary\Model\Observer;

use Cloudinary\Cloudinary\Model\Configuration;
use Cloudinary\Cloudinary\Core\ConfigurationInterface;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class ProductGalleryChangeTemplate implements ObserverInterface
{

/**
* @var Configuration
* @var ConfigurationInterface
*/
protected $configuration;

/**
* @param Configuration $configuration
* @param ConfigurationInterface $configuration
*/
public function __construct(
Configuration $configuration
ConfigurationInterface $configuration
) {
$this->configuration = $configuration;
}
Expand Down