/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/GraphQl/Query/QueryLengthConfiguration.php
60 строк
2 KB
Nishant Rana
Copyright year corrected for static tests
10 мар 2026, 11:33
10 мар 2026, 11:33
0acd7f5
Код
Авторство
О чём код?
<?php /** * Copyright 2026 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Framework\GraphQl\Query; use Magento\Framework\App\Config\ScopeConfigInterface; /** * Class for fetching the query length limit count in graphql request */ class QueryLengthConfiguration { /** * Constant for query length limit allowed value config path */ private const CONFIG_PATH_QUERY_LENGTH_LIMIT_ALLOWED = 'graphql/validation/query_length_limit_allowed'; /** * Constant for query length limit enable config path */ private const CONFIG_PATH_QUERY_LENGTH_LIMIT_ENABLED = 'graphql/validation/query_length_limit_enabled'; /** * @var ScopeConfigInterface */ private $scopeConfigInterface; /** * @param scopeConfigInterfacee $scopeConfigInterface */ public function __construct( ScopeConfigInterface $scopeConfigInterface ) { $this->scopeConfigInterface = $scopeConfigInterface; } /** * Check the environment config to get the query length limit in graphql request. * * @return int */ public function getQueryLengthLimitAllowed(): int { return (int) $this->scopeConfigInterface->getValue(self::CONFIG_PATH_QUERY_LENGTH_LIMIT_ALLOWED); } /** * Check the environment config to check if query length limit is enabled. * * @return bool */ public function isQueryLengthLimitEnabled(): bool { return (bool) $this->scopeConfigInterface->getValue(self::CONFIG_PATH_QUERY_LENGTH_LIMIT_ENABLED); } }