diff --git a/lib/internal/Magento/Framework/Amqp/Config.php b/lib/internal/Magento/Framework/Amqp/Config.php index 8fb827d9eb0d2..5df33a06cda47 100644 --- a/lib/internal/Magento/Framework/Amqp/Config.php +++ b/lib/internal/Magento/Framework/Amqp/Config.php @@ -131,7 +131,7 @@ public function __destruct() public function getValue($key) { $this->load(); - return isset($this->data[$key]) ? $this->data[$key] : null; + return $this->data[$key] ?? null; } /** diff --git a/lib/internal/Magento/Framework/App/Cache/State.php b/lib/internal/Magento/Framework/App/Cache/State.php index 08c1fca66ea17..8f0d8273e481e 100644 --- a/lib/internal/Magento/Framework/App/Cache/State.php +++ b/lib/internal/Magento/Framework/App/Cache/State.php @@ -74,7 +74,7 @@ public function __construct(DeploymentConfig $config, Writer $writer, $banAll = public function isEnabled($cacheType) { $this->load(); - return isset($this->statuses[$cacheType]) ? (bool)$this->statuses[$cacheType] : false; + return (bool)($this->statuses[$cacheType] ?? false); } /** diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php index 39a0479f7540e..473b95feb31c9 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php @@ -101,7 +101,7 @@ public function getPluginConfigOptions($pluginName, $key = null) $pluginOptions = $plugins[$pluginArrIndex]['options']; if ($key !== null) { - return isset($pluginOptions[$key]) ? $pluginOptions[$key] : null; + return $pluginOptions[$key] ?? null; } else { return $pluginOptions; } diff --git a/lib/internal/Magento/Framework/GraphQl/Schema/Type/Entity/DefaultMapper.php b/lib/internal/Magento/Framework/GraphQl/Schema/Type/Entity/DefaultMapper.php index 7e3f2ac6db638..2227a6ae5d3c4 100644 --- a/lib/internal/Magento/Framework/GraphQl/Schema/Type/Entity/DefaultMapper.php +++ b/lib/internal/Magento/Framework/GraphQl/Schema/Type/Entity/DefaultMapper.php @@ -30,6 +30,6 @@ public function __construct(array $map = []) */ public function getMappedTypes(string $entityName) : array { - return isset($this->map[$entityName]) ? $this->map[$entityName] : []; + return $this->map[$entityName] ?? []; } } diff --git a/lib/internal/Magento/Framework/GraphQl/Schema/Type/Enum/DefaultDataMapper.php b/lib/internal/Magento/Framework/GraphQl/Schema/Type/Enum/DefaultDataMapper.php index f7b39ba64207b..3eb66bf557f22 100644 --- a/lib/internal/Magento/Framework/GraphQl/Schema/Type/Enum/DefaultDataMapper.php +++ b/lib/internal/Magento/Framework/GraphQl/Schema/Type/Enum/DefaultDataMapper.php @@ -30,6 +30,6 @@ public function __construct(array $map) */ public function getMappedEnums(string $enumName) : array { - return isset($this->map[$enumName]) ? $this->map[$enumName] : []; + return $this->map[$enumName] ?? []; } } diff --git a/lib/internal/Magento/Framework/MessageQueue/Config.php b/lib/internal/Magento/Framework/MessageQueue/Config.php index e29b5d06bee6c..78d86d121601b 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Config.php +++ b/lib/internal/Magento/Framework/MessageQueue/Config.php @@ -35,9 +35,7 @@ public function __construct(Config\Data $queueConfigData) public function getExchangeByTopic($topicName) { $publisherConfig = $this->getPublisherConfigByTopic($topicName); - return isset($publisherConfig[ConfigInterface::PUBLISHER_EXCHANGE]) - ? $publisherConfig[ConfigInterface::PUBLISHER_EXCHANGE] - : null; + return $publisherConfig[ConfigInterface::PUBLISHER_EXCHANGE] ?? null; } /** @@ -76,9 +74,7 @@ public function getConnectionByTopic($topic) } catch (\Magento\Framework\Exception\LocalizedException $e) { return null; } - return isset($publisherConfig[ConfigInterface::PUBLISHER_CONNECTION]) - ? $publisherConfig[ConfigInterface::PUBLISHER_CONNECTION] - : null; + return $publisherConfig[ConfigInterface::PUBLISHER_CONNECTION] ?? null; } /** diff --git a/lib/internal/Magento/Framework/MessageQueue/Consumer/Config/Env/Reader.php b/lib/internal/Magento/Framework/MessageQueue/Consumer/Config/Env/Reader.php index aa318ba5f19cf..a75aa1ea8ead2 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Consumer/Config/Env/Reader.php +++ b/lib/internal/Magento/Framework/MessageQueue/Consumer/Config/Env/Reader.php @@ -33,8 +33,6 @@ public function __construct(\Magento\Framework\MessageQueue\Config\Reader\Env $e public function read($scope = null) { $configData = $this->envConfig->read($scope); - return isset($configData[\Magento\Framework\MessageQueue\Config\Reader\Env::ENV_CONSUMERS]) - ? $configData[\Magento\Framework\MessageQueue\Config\Reader\Env::ENV_CONSUMERS] - : []; + return $configData[\Magento\Framework\MessageQueue\Config\Reader\Env::ENV_CONSUMERS] ?? []; } } diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Schema.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Schema.php index 3e68b985283cf..8ee8ed0440eed 100644 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Schema.php +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Schema.php @@ -71,6 +71,6 @@ public function addTable(Table $table) public function getTableByName($name) { $name = $this->resourceConnection->getTableName($name); - return isset($this->tables[$name]) ? $this->tables[$name] : false; + return $this->tables[$name] ?? false; } } diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Table.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Table.php index 4f020b1a0320f..8b9e03e3ec266 100644 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Table.php +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Table.php @@ -138,7 +138,7 @@ public function getConstraints() */ public function getConstraintByName($name) { - return isset($this->constraints[$name]) ? $this->constraints[$name] : false; + return $this->constraints[$name] ?? false; } /** @@ -168,9 +168,7 @@ public function getReferenceConstraints() */ public function getPrimaryConstraint() { - return isset($this->constraints[Internal::PRIMARY_NAME]) ? - $this->constraints[Internal::PRIMARY_NAME] : - false; + return $this->constraints[Internal::PRIMARY_NAME] ?? false; } /** @@ -196,7 +194,7 @@ public function getInternalConstraints() : array */ public function getIndexByName($name) { - return isset($this->indexes[$name]) ? $this->indexes[$name] : false; + return $this->indexes[$name] ?? false; } /**