[], 'post' => [], 'put' => [], 'delete' => [], 'patch' => [], ]; echo 'Mapping Scopes to endpoints and methods ..' . PHP_EOL; foreach ($esi['paths'] as $path => $description) { foreach ($description as $method => $data) { if (isset($data['security'])) $scope = $data['security'][0]['evesso'][0]; else $scope = 'public'; // Update the scope map! $scope_map[$method][$path] = $scope; echo $method . ' | ' . $path . ' | ' . $scope . PHP_EOL; } } // Output the scopes in a way that we can // copy/pasta in code! echo 'Var Export of the scope map:' . PHP_EOL; echo PHP_EOL; var_export($scope_map); echo PHP_EOL;