@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Facile\MongoDbBundle\Capsule; |
4 | 4 |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | class FacileMongoDbBundleExtension extends \Twig_Extension |
6 | 6 | { |
7 | - private $methodDataTranslationMap = [ |
|
7 | + private $methodDataTranslationMap = [ |
|
8 | 8 | 'aggregate' => 'Pipeline', |
9 | 9 | 'insertOne' => 'Document', |
10 | 10 | 'updateOne' => 'Update', |
@@ -15,7 +15,7 @@ |
||
15 | 15 | ]; |
16 | 16 | |
17 | 17 | /** |
18 | - * @return array |
|
18 | + * @return \Twig_SimpleFunction[] |
|
19 | 19 | */ |
20 | 20 | public function getFunctions() |
21 | 21 | { |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Facile\MongoDbBundle\Models; |
4 | 4 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function setFilters($filters) |
101 | 101 | { |
102 | - $this->filters = (array)$filters ?? []; |
|
102 | + $this->filters = (array) $filters ?? []; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Facile\MongoDbBundle\Capsule; |
4 | 4 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Facile\MongoDbBundle\Capsule; |
4 | 4 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | */ |
227 | 227 | private function translateReadPreference(ReadPreference $readPreference): string |
228 | 228 | { |
229 | - switch($readPreference->getMode()){ |
|
229 | + switch ($readPreference->getMode()) { |
|
230 | 230 | case ReadPreference::RP_PRIMARY: |
231 | 231 | return 'primary'; |
232 | 232 | case ReadPreference::RP_PRIMARY_PREFERRED: |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Facile\MongoDbBundle\Controller; |
4 | 4 | |
5 | 5 | use Facile\MongoDbBundle\DataCollector\MongoQuerySerializer; |
6 | -use MongoDB\BSON\UTCDateTime; |
|
7 | 6 | use Symfony\Component\DependencyInjection\Container; |
8 | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
9 | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Facile\MongoDbBundle\Controller; |
4 | 4 | |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | |
40 | 40 | $service = $this->container->get('mongo.explain_query_service'); |
41 | 41 | |
42 | - try{ |
|
42 | + try { |
|
43 | 43 | $result = $service->execute($query); |
44 | - } catch (\InvalidArgumentException $e) { |
|
44 | + }catch (\InvalidArgumentException $e) { |
|
45 | 45 | return new JsonResponse([ |
46 | 46 | "err" => $e->getMessage() |
47 | 47 | ]); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | foreach ($data as $key => $item) { |
65 | 65 | |
66 | 66 | if (\is_string($item) && 0 === strpos($item, "ISODate")) { |
67 | - $time = str_replace(['ISODate("','")'], '', $item); |
|
67 | + $time = str_replace(['ISODate("', '")'], '', $item); |
|
68 | 68 | $dateTime = new \DateTime($time); |
69 | 69 | $item = new UTCDatetime($dateTime->getTimestamp() * 1000); |
70 | 70 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Facile\MongoDbBundle\Services\Explain; |
4 | 4 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | return [ |
115 | 115 | 'delete' => $query->getCollection(), |
116 | 116 | 'deletes' => [ |
117 | - ['q' => $query->getFilters(), 'limit' => $query->getOptions()['limit'] ?? 0,] |
|
117 | + ['q' => $query->getFilters(), 'limit' => $query->getOptions()['limit'] ?? 0, ] |
|
118 | 118 | ] |
119 | 119 | ]; |
120 | 120 | } |
@@ -71,7 +71,7 @@ |
||
71 | 71 | { |
72 | 72 | $indexList->loadData(); |
73 | 73 | $indexList->loadIndexes(); |
74 | - $this->io->writeln('Loaded fixture: '. \get_class($indexList)); |
|
74 | + $this->io->writeln('Loaded fixture: '.\get_class($indexList)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | const VERBOSITY_EXECUTION_STATS = 'executionStats'; |
14 | 14 | const VERBOSITY_ALL_PLAN_EXECUTION = 'allPlansExecution'; |
15 | 15 | |
16 | - public static $acceptedMethods= [ |
|
16 | + public static $acceptedMethods = [ |
|
17 | 17 | 'count', |
18 | 18 | 'distinct', |
19 | 19 | 'find', |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | { |
58 | 58 | if (!\in_array($query->getMethod(), self::$acceptedMethods)) { |
59 | 59 | throw new \InvalidArgumentException( |
60 | - 'Cannot explain the method \''.$query->getMethod().'\'. Allowed methods: '. implode(', ',self::$acceptedMethods) |
|
60 | + 'Cannot explain the method \''.$query->getMethod().'\'. Allowed methods: '.implode(', ', self::$acceptedMethods) |
|
61 | 61 | ); |
62 | 62 | }; |
63 | 63 | |
64 | - $manager = $this->clientRegistry->getClient($query->getClient(),$query->getDatabase())->__debugInfo()['manager']; |
|
64 | + $manager = $this->clientRegistry->getClient($query->getClient(), $query->getDatabase())->__debugInfo()['manager']; |
|
65 | 65 | |
66 | 66 | return $manager |
67 | 67 | ->executeCommand( |