Remove usage of Functional\map function

This commit is contained in:
Alejandro Celaya
2023-11-29 12:34:13 +01:00
parent a91a560651
commit f50263d2d9
37 changed files with 201 additions and 140 deletions

View File

@@ -4,8 +4,8 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\Rest;
use function array_map;
use function Functional\first;
use function Functional\map;
use function Shlinkio\Shlink\Config\loadConfigFromGlob;
use function sprintf;
@@ -23,11 +23,11 @@ class ConfigProvider
public static function applyRoutesPrefix(array $routes): array
{
$healthRoute = self::buildUnversionedHealthRouteFromExistingRoutes($routes);
$prefixedRoutes = map($routes, static function (array $route) {
$prefixedRoutes = array_map(static function (array $route) {
['path' => $path] = $route;
$route['path'] = sprintf('%s%s', self::ROUTES_PREFIX, $path);
return $route;
});
}, $routes);
return $healthRoute !== null ? [...$prefixedRoutes, $healthRoute] : $prefixedRoutes;
}