Completed
Branch 1707_add_explain_command (902dba)
by Alessandro
06:37
created
src/Controller/ProfilerController.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,6 @@
 block discarded – undo
3 3
 namespace Facile\MongoDbBundle\Controller;
4 4
 
5 5
 use Facile\MongoDbBundle\DataCollector\MongoQuerySerializer;
6
-use Facile\MongoDbBundle\Services\Explain\ExplainQueryService;
7
-use MongoDB\BSON\UTCDateTime;
8 6
 use Symfony\Component\DependencyInjection\Container;
9 7
 use Symfony\Component\DependencyInjection\ContainerAwareInterface;
10 8
 use Symfony\Component\DependencyInjection\ContainerInterface;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 
3 3
 namespace Facile\MongoDbBundle\Controller;
4 4
 
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
 
41 41
         $service = $this->container->get('mongo.explain_query_service');
42 42
 
43
-        try{
43
+        try {
44 44
             $result = $service->execute($query);
45
-        } catch (\InvalidArgumentException $e) {
45
+        }catch (\InvalidArgumentException $e) {
46 46
             return new JsonResponse([
47 47
                 "err" => $e->getMessage()
48 48
             ]);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         foreach ($data as $key => $item) {
74 74
 
75 75
             if (is_string($item) && preg_match('/^ISODate/', $item)) {
76
-                $time = str_replace(['ISODate("','")'], '', $item);
76
+                $time = str_replace(['ISODate("', '")'], '', $item);
77 77
                 $dateTime = new \DateTime($time);
78 78
                 $item = new UTCDatetime($dateTime->getTimestamp() * 1000);
79 79
             }
Please login to merge, or discard this patch.