From aca9121332fb59709839367ac654d9998459034d Mon Sep 17 00:00:00 2001 From: visavi Date: Fri, 25 Oct 2019 19:01:33 +0300 Subject: [PATCH] php update --- composer.json | 2 +- src/Mapper/Map.php | 2 +- src/Mapper/MapFactory.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index c18ee31..1199311 100755 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ ], "require": { "ext-json": "*", - "php": ">=7.2" + "php": ">=7.1" }, "require-dev": { "phpunit/phpunit": "8.3.5" diff --git a/src/Mapper/Map.php b/src/Mapper/Map.php index 16ea7b3..ccfb37d 100644 --- a/src/Mapper/Map.php +++ b/src/Mapper/Map.php @@ -44,7 +44,7 @@ public function containsObjectPath($objectPath) */ public function get($objectPath) { - return isset($this->map[$objectPath]) ? $this->map[$objectPath] : null; + return $this->map[$objectPath] ?? null; } /** diff --git a/src/Mapper/MapFactory.php b/src/Mapper/MapFactory.php index fe2d89a..11cd5a0 100644 --- a/src/Mapper/MapFactory.php +++ b/src/Mapper/MapFactory.php @@ -24,7 +24,7 @@ public static function create(array $mapSchema) foreach ($mapSchema as $key => $value) { $tags = []; if (strpos($key, ':') !== false) { - list($key, $tags) = explode(':', $key); + [$key, $tags] = explode(':', $key); $tags = self::normaliseTags($tags); } $map->add(new MapItem($key, $value, $tags)); @@ -82,7 +82,7 @@ protected static function tagsFromString($tags) if (strpos($tag, ' ') !== false) { list($tag, $value) = explode(' ', $tag); } - $result[$tag] = isset($value) ? $value : true; + $result[$tag] = $value ?? true; } return $result; }