![]() 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/magento/module-config/Model/Config/Structure/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Config\Model\Config\Structure; use Magento\Framework\Exception\ConfigurationMismatchException; /** * Contains list of classes which implement ElementVisibilityInterface for * checking of visibility of form elements on Stores > Settings > Configuration page in Admin Panel. * @api * @since 101.0.0 */ class ElementVisibilityComposite implements ElementVisibilityInterface { /** * List of objects which implements ElementVisibilityInterface for * checking of visibility of form elements on Configuration page. * * @var ElementVisibilityInterface[] */ private $visibility = []; /** * @param ElementVisibilityInterface[] $visibility List of objects which define visibility status of form elements * under its own conditions. * @throws ConfigurationMismatchException It is thrown if some object from list $visibility * implements the wrong interface. */ public function __construct(array $visibility = []) { foreach ($visibility as $name => $item) { if (!$item instanceof ElementVisibilityInterface) { throw new ConfigurationMismatchException( __( '%1: Instance of %2 is expected, got %3 instead', $name, ElementVisibilityInterface::class, get_class($item) ) ); } } $this->visibility = $visibility; } /** * @inheritdoc * @since 101.0.0 */ public function isHidden($path) { foreach ($this->visibility as $element) { if ($element->isHidden($path)) { return true; } } return false; } /** * @inheritdoc * @since 101.0.0 */ public function isDisabled($path) { foreach ($this->visibility as $element) { if ($element->isDisabled($path)) { return true; } } return false; } }