Deprecated: Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter::__construct(): Implicitly marking parameter $registry as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/DoctrineParamConverter.php on line 46

Deprecated: Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter::__construct(): Implicitly marking parameter $expressionLanguage as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/DoctrineParamConverter.php on line 46

Deprecated: Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::__construct(): Implicitly marking parameter $twig as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/sensio/framework-extra-bundle/src/EventListener/TemplateListener.php on line 39

Deprecated: Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener::__construct(): Implicitly marking parameter $language as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/sensio/framework-extra-bundle/src/EventListener/SecurityListener.php on line 43

Deprecated: Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener::__construct(): Implicitly marking parameter $trustResolver as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/sensio/framework-extra-bundle/src/EventListener/SecurityListener.php on line 43

Deprecated: Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener::__construct(): Implicitly marking parameter $roleHierarchy as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/sensio/framework-extra-bundle/src/EventListener/SecurityListener.php on line 43

Deprecated: Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener::__construct(): Implicitly marking parameter $tokenStorage as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/sensio/framework-extra-bundle/src/EventListener/SecurityListener.php on line 43

Deprecated: Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener::__construct(): Implicitly marking parameter $authChecker as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/sensio/framework-extra-bundle/src/EventListener/SecurityListener.php on line 43

Deprecated: Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener::__construct(): Implicitly marking parameter $logger as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/sensio/framework-extra-bundle/src/EventListener/SecurityListener.php on line 43

Deprecated: Sensio\Bundle\FrameworkExtraBundle\EventListener\IsGrantedListener::__construct(): Implicitly marking parameter $authChecker as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/sensio/framework-extra-bundle/src/EventListener/IsGrantedListener.php on line 33

Deprecated: Symfony\WebpackEncoreBundle\Asset\EntrypointLookupCollectionInterface::getEntrypointLookup(): Implicitly marking parameter $buildName as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/symfony/webpack-encore-bundle/src/Asset/EntrypointLookupCollectionInterface.php on line 21

Deprecated: Symfony\WebpackEncoreBundle\Asset\EntrypointLookupCollection::__construct(): Implicitly marking parameter $defaultBuildName as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/symfony/webpack-encore-bundle/src/Asset/EntrypointLookupCollection.php on line 28

Deprecated: Symfony\WebpackEncoreBundle\Asset\EntrypointLookupCollection::getEntrypointLookup(): Implicitly marking parameter $buildName as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/symfony/webpack-encore-bundle/src/Asset/EntrypointLookupCollection.php on line 34

Deprecated: Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension::renderWebpackScriptTags(): Implicitly marking parameter $packageName as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/symfony/webpack-encore-bundle/src/Twig/EntryFilesTwigExtension.php on line 51

Deprecated: Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension::renderWebpackLinkTags(): Implicitly marking parameter $packageName as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/symfony/webpack-encore-bundle/src/Twig/EntryFilesTwigExtension.php on line 57

Deprecated: Symfony\WebpackEncoreBundle\Twig\StimulusTwigExtension::renderStimulusAction(): Implicitly marking parameter $actionName as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/symfony/webpack-encore-bundle/src/Twig/StimulusTwigExtension.php on line 76

Deprecated: Symfony\WebpackEncoreBundle\Twig\StimulusTwigExtension::renderStimulusAction(): Implicitly marking parameter $eventName as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/symfony/webpack-encore-bundle/src/Twig/StimulusTwigExtension.php on line 76

Deprecated: Symfony\WebpackEncoreBundle\Twig\StimulusTwigExtension::appendStimulusAction(): Implicitly marking parameter $eventName as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/symfony/webpack-encore-bundle/src/Twig/StimulusTwigExtension.php on line 124

Deprecated: Symfony\WebpackEncoreBundle\Twig\StimulusTwigExtension::renderStimulusTarget(): Implicitly marking parameter $targetNames as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/symfony/webpack-encore-bundle/src/Twig/StimulusTwigExtension.php on line 135

Deprecated: Symfony\WebpackEncoreBundle\Twig\StimulusTwigExtension::appendStimulusTarget(): Implicitly marking parameter $targetNames as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/symfony/webpack-encore-bundle/src/Twig/StimulusTwigExtension.php on line 163

Deprecated: Symfony\WebpackEncoreBundle\Asset\EntrypointLookup::__construct(): Implicitly marking parameter $cache as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/symfony/webpack-encore-bundle/src/Asset/EntrypointLookup.php on line 36

Deprecated: Symfony\WebpackEncoreBundle\Asset\EntrypointLookup::__construct(): Implicitly marking parameter $cacheKey as nullable is deprecated, the explicit nullable type must be used instead in /home/minisme/www/geopos_proj/vendor/symfony/webpack-encore-bundle/src/Asset/EntrypointLookup.php on line 36
Symfony Profiler

src/App/Controller/GpsController.php line 47

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Madi\Geo\Gps;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  8. class GpsController extends AbstractController
  9. {
  10. /**
  11. * @Route("/gps", name="app_gps")
  12. */
  13. public function index(Request $request): Response
  14. {
  15. // show_all_errors();
  16. // $request = Request::createFromGlobals();
  17. // Fusion des paramètres _GET (qui deviennent prioritaires) dans _POST
  18. foreach ($request->query->all() as $k => $v) {
  19. $request->request->set($k, $v); // request=POST et query=GET
  20. }
  21. // dump($request->request);
  22. // Extraction des paramètres de filtrage
  23. # ===========
  24. $cc_str = $request->request->get("cc_str", "");
  25. $cc_str = strtoupper($cc_str);
  26. // Extraction du paramètres du paramètre précision pour les coordonnées GPS
  27. # ===========
  28. $cc_prec = $request->request->get("cc_prec", 4);
  29. // $cc_str = strtoupper(@$_REQUEST["cc_str"]);
  30. if (empty($cc_str)) {
  31. // $cc_str = "E02° 33' 11'' / N48° 23' 25''" ; // OK
  32. $cc_str = "GPS 48°35’ 19’’ N 2° 31’ 01’’ E" ; // bug reconversion en DMS
  33. }
  34. // $cc_str = htmlspecialchars($cc_str); // inutile ici
  35. dump($cc_str);
  36. dump($cc_prec);
  37. $msg = "";
  38. // On analyse les coordonnées GPS, qu'elle soient siasies par l'utilisateur
  39. // ou définies par défaut
  40. $gps = null;
  41. try {
  42. $gps = new Gps($cc_str, $cc_prec);
  43. // dump($gps);
  44. } catch (\Throwable $e) {
  45. $msg = "Erreur lors de l'analyse des coordonnées GPS \"cc_str\"";
  46. }
  47. $placeholder = htmlentities($cc_str, ENT_QUOTES);
  48. // $vars = array(
  49. // "msg" => $msg,
  50. // "gps" => $gps,
  51. // "cc_str" => $cc_str, // le chaine d'origine
  52. // "cc_prec" => $cc_prec, // précision coord gps
  53. // "placeholder" => $placeholder,
  54. // );
  55. // $main = sf_twig()->render('main_gps.html.twig', $vars);
  56. // $reply['header_title'] = "main@gps";
  57. // $reply['main'] = $main;
  58. // return $reply;
  59. return $this->render('gps/index.html.twig', [
  60. "title" => "Convertion coordonnées GPS",
  61. "msg" => $msg,
  62. "gps" => $gps,
  63. "cc_str" => $cc_str, // le chaine d'origine
  64. "cc_prec" => $cc_prec, // précision coord gps
  65. "placeholder" => $placeholder,
  66. ]);
  67. }
  68. }