Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/mageworx/module-seobase/Model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/mageworx/module-seobase/Model/Hreflangs.php
<?php
/**
 * Copyright © MageWorx. All rights reserved.
 * See LICENSE.txt for license details.
 */

declare(strict_types=1);

namespace MageWorx\SeoBase\Model;

use MageWorx\SeoBase\Helper\Url as HelperUrl;

abstract class Hreflangs implements \MageWorx\SeoBase\Model\HreflangsInterface
{
    /**
     * @var HreflangsConfigReader
     */
    protected $hreflangsConfigReader;

    /**
     * @var \MageWorx\SeoBase\Helper\Url
     */
    protected $helperUrl;

    /**
     * @var string
     */
    protected $fullActionName;

    /**
     * @var \Magento\Framework\Model\AbstractModel|null
     */
    protected $entity;

    /**
     * Retrieve hreflang URL list:
     * [
     *      (int)$storeId => (string)$hreflangUrl,
     *      ...
     * ]
     *
     * @return array
     */
    abstract public function getHreflangUrls();

    /**
     * Hreflangs constructor.
     *
     * @param \MageWorx\SeoBase\Model\HreflangsConfigReader $hreflangsConfigReader
     * @param HelperUrl $helperUrl
     * @param string $fullActionName
     */
    public function __construct(
        HreflangsConfigReader $hreflangsConfigReader,
        HelperUrl $helperUrl,
        $fullActionName
    ) {
        $this->hreflangsConfigReader = $hreflangsConfigReader;
        $this->helperUrl             = $helperUrl;
        $this->fullActionName        = $fullActionName;
    }

    /**
     * Check if cancel adding hreflangs URL by config setting
     *
     * @return bool
     * @throws \Magento\Framework\Exception\NoSuchEntityException
     */
    protected function isCancelHreflangs(): bool
    {
        return !$this->hreflangsConfigReader->isHreflangsEnabled();
    }

    /**
     * @param \Magento\Framework\Model\AbstractModel $entity
     * @return $this
     */
    public function setEntity(\Magento\Framework\Model\AbstractModel $entity): Hreflangs
    {
        $this->entity = $entity;

        return $this;
    }

    /**
     * @return \Magento\Framework\Model\AbstractModel|null
     */
    public function getEntity()
    {
        return $this->entity;
    }

    /**
     * @param $urlProvider
     * @return bool
     */
    protected function isGraphQl($urlProvider)
    {
        return in_array(
            parse_url($urlProvider->getCurrentUrl(), PHP_URL_PATH),
            ['/graphql', '/graphql/']
        );
    }
}

Spamworldpro Mini