mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-12 03:01:32 +00:00
Import latest app updates from streamline
An updated set of source files and initialization was provided by streamline to address issues observed during initial testing. These files have been updated in order to generate a new set of app images.
This commit is contained in:
Vendored
-121
@@ -1,121 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Generator\Dumper;
|
||||
|
||||
use Symfony\Component\Routing\Exception\RouteCircularReferenceException;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Routing\Matcher\Dumper\CompiledUrlMatcherDumper;
|
||||
|
||||
/**
|
||||
* CompiledUrlGeneratorDumper creates a PHP array to be used with CompiledUrlGenerator.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Tobias Schultze <http://tobion.de>
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class CompiledUrlGeneratorDumper extends GeneratorDumper
|
||||
{
|
||||
public function getCompiledRoutes(): array
|
||||
{
|
||||
$compiledRoutes = [];
|
||||
foreach ($this->getRoutes()->all() as $name => $route) {
|
||||
$compiledRoute = $route->compile();
|
||||
|
||||
$compiledRoutes[$name] = [
|
||||
$compiledRoute->getVariables(),
|
||||
$route->getDefaults(),
|
||||
$route->getRequirements(),
|
||||
$compiledRoute->getTokens(),
|
||||
$compiledRoute->getHostTokens(),
|
||||
$route->getSchemes(),
|
||||
[],
|
||||
];
|
||||
}
|
||||
|
||||
return $compiledRoutes;
|
||||
}
|
||||
|
||||
public function getCompiledAliases(): array
|
||||
{
|
||||
$routes = $this->getRoutes();
|
||||
$compiledAliases = [];
|
||||
foreach ($routes->getAliases() as $name => $alias) {
|
||||
$deprecations = $alias->isDeprecated() ? [$alias->getDeprecation($name)] : [];
|
||||
$currentId = $alias->getId();
|
||||
$visited = [];
|
||||
while (null !== $alias = $routes->getAlias($currentId) ?? null) {
|
||||
if (false !== $searchKey = array_search($currentId, $visited)) {
|
||||
$visited[] = $currentId;
|
||||
|
||||
throw new RouteCircularReferenceException($currentId, \array_slice($visited, $searchKey));
|
||||
}
|
||||
|
||||
if ($alias->isDeprecated()) {
|
||||
$deprecations[] = $deprecation = $alias->getDeprecation($currentId);
|
||||
trigger_deprecation($deprecation['package'], $deprecation['version'], $deprecation['message']);
|
||||
}
|
||||
|
||||
$visited[] = $currentId;
|
||||
$currentId = $alias->getId();
|
||||
}
|
||||
|
||||
if (null === $target = $routes->get($currentId)) {
|
||||
throw new RouteNotFoundException(sprintf('Target route "%s" for alias "%s" does not exist.', $currentId, $name));
|
||||
}
|
||||
|
||||
$compiledTarget = $target->compile();
|
||||
|
||||
$compiledAliases[$name] = [
|
||||
$compiledTarget->getVariables(),
|
||||
$target->getDefaults(),
|
||||
$target->getRequirements(),
|
||||
$compiledTarget->getTokens(),
|
||||
$compiledTarget->getHostTokens(),
|
||||
$target->getSchemes(),
|
||||
$deprecations,
|
||||
];
|
||||
}
|
||||
|
||||
return $compiledAliases;
|
||||
}
|
||||
|
||||
public function dump(array $options = []): string
|
||||
{
|
||||
return <<<EOF
|
||||
<?php
|
||||
|
||||
// This file has been auto-generated by the Symfony Routing Component.
|
||||
|
||||
return [{$this->generateDeclaredRoutes()}
|
||||
];
|
||||
|
||||
EOF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates PHP code representing an array of defined routes
|
||||
* together with the routes properties (e.g. requirements).
|
||||
*/
|
||||
private function generateDeclaredRoutes(): string
|
||||
{
|
||||
$routes = '';
|
||||
foreach ($this->getCompiledRoutes() as $name => $properties) {
|
||||
$routes .= sprintf("\n '%s' => %s,", $name, CompiledUrlMatcherDumper::export($properties));
|
||||
}
|
||||
|
||||
foreach ($this->getCompiledAliases() as $alias => $properties) {
|
||||
$routes .= sprintf("\n '%s' => %s,", $alias, CompiledUrlMatcherDumper::export($properties));
|
||||
}
|
||||
|
||||
return $routes;
|
||||
}
|
||||
}
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Generator\Dumper;
|
||||
|
||||
use Symfony\Component\Routing\RouteCollection;
|
||||
|
||||
/**
|
||||
* GeneratorDumper is the base class for all built-in generator dumpers.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
abstract class GeneratorDumper implements GeneratorDumperInterface
|
||||
{
|
||||
private RouteCollection $routes;
|
||||
|
||||
public function __construct(RouteCollection $routes)
|
||||
{
|
||||
$this->routes = $routes;
|
||||
}
|
||||
|
||||
public function getRoutes(): RouteCollection
|
||||
{
|
||||
return $this->routes;
|
||||
}
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Generator\Dumper;
|
||||
|
||||
use Symfony\Component\Routing\RouteCollection;
|
||||
|
||||
/**
|
||||
* GeneratorDumperInterface is the interface that all generator dumper classes must implement.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
interface GeneratorDumperInterface
|
||||
{
|
||||
/**
|
||||
* Dumps a set of routes to a string representation of executable code
|
||||
* that can then be used to generate a URL of such a route.
|
||||
*/
|
||||
public function dump(array $options = []): string;
|
||||
|
||||
/**
|
||||
* Gets the routes to dump.
|
||||
*/
|
||||
public function getRoutes(): RouteCollection;
|
||||
}
|
||||
Reference in New Issue
Block a user