Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php /** * Copyright Magento, Inc. All rights reserved. * See COPYING.txt for license ..

Decoded Output download

<?php
/**
 * Copyright  Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Magento\CatalogGraphQl\Model\Resolver\Cache\Product\MediaGallery;

use Magento\Catalog\Model\Product;
use Magento\CatalogGraphQl\Model\Resolver\Product\MediaGallery\ChangeDetector;
use Magento\Framework\App\Cache\Tag\StrategyInterface;

class TagsStrategy implements StrategyInterface
{
    /**
     * @var ChangeDetector
     */
    private $mediaGalleryChangeDetector;

    /**
     * @param ChangeDetector $mediaGalleryChangeDetector
     */
    public function __construct(ChangeDetector $mediaGalleryChangeDetector)
    {
        $this->mediaGalleryChangeDetector = $mediaGalleryChangeDetector;
    }

    /**
     * @inheritDoc
     */
    public function getTags($object)
    {
        if ($object instanceof Product &&
            !$object->isObjectNew() &&
            $this->mediaGalleryChangeDetector->isChanged($object)
        ) {
            return [
                sprintf('%s_%s', ResolverCacheIdentity::CACHE_TAG, $object->getId())
            ];
        }

        return [];
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php
/**
 * Copyright  Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Magento\CatalogGraphQl\Model\Resolver\Cache\Product\MediaGallery;

use Magento\Catalog\Model\Product;
use Magento\CatalogGraphQl\Model\Resolver\Product\MediaGallery\ChangeDetector;
use Magento\Framework\App\Cache\Tag\StrategyInterface;

class TagsStrategy implements StrategyInterface
{
    /**
     * @var ChangeDetector
     */
    private $mediaGalleryChangeDetector;

    /**
     * @param ChangeDetector $mediaGalleryChangeDetector
     */
    public function __construct(ChangeDetector $mediaGalleryChangeDetector)
    {
        $this->mediaGalleryChangeDetector = $mediaGalleryChangeDetector;
    }

    /**
     * @inheritDoc
     */
    public function getTags($object)
    {
        if ($object instanceof Product &&
            !$object->isObjectNew() &&
            $this->mediaGalleryChangeDetector->isChanged($object)
        ) {
            return [
                sprintf('%s_%s', ResolverCacheIdentity::CACHE_TAG, $object->getId())
            ];
        }

        return [];
    }
}

Function Calls

None

Variables

None

Stats

MD5 86e9d079c1ef59a87f42fa2a194f7bdb
Eval Count 0
Decode Time 76 ms