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-seo-ai/Model/Source/DefaultValue/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/mageworx/module-seo-ai/Model/Source/DefaultValue/DefaultValue.php
<?php

namespace MageWorx\SeoAI\Model\Source\DefaultValue;

use Magento\Framework\Data\ValueSourceInterface;
use MageWorx\SeoAI\Helper\Config as ConfigProvider;

class DefaultValue implements ValueSourceInterface
{
    protected ConfigProvider $configProvider;
    protected ?string $entity = '';

    public function __construct(
        ConfigProvider $configProvider,
        ?string $entity = null
    ) {
        $this->configProvider = $configProvider;
        $this->entity = $entity;
    }

    protected function getBasePath(): string
    {
        $path = 'mageworx_seo/mageworx_seoai/';
        if (!empty($this->entity)) {
            $path .= $this->entity . '/';
        }

        return $path;
    }

    /**
     * {@inheritdoc}
     */
    public function getValue($name)
    {
        $value= $this->configProvider->getValue($this->getBasePath() . $name);

        return is_numeric($value) ? (float)$value : $value;
    }
}

Spamworldpro Mini