@@ -76,7 +76,7 @@ |
||
76 | 76 | */ |
77 | 77 | public function getTime(): float |
78 | 78 | { |
79 | - return (float)($this->data[self::TIME_KEYWORD] * 1000); |
|
79 | + return (float) ($this->data[self::TIME_KEYWORD] * 1000); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -90,7 +90,7 @@ |
||
90 | 90 | */ |
91 | 91 | public function setFilters($filters) |
92 | 92 | { |
93 | - $this->filters = (array)$filters ?? []; |
|
93 | + $this->filters = (array) $filters ?? []; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function loadFromDirectory(string $dir) |
33 | 33 | { |
34 | - if (! is_dir($dir)) { |
|
34 | + if (!is_dir($dir)) { |
|
35 | 35 | throw new \InvalidArgumentException(sprintf('"%s" does not exist', $dir)); |
36 | 36 | } |
37 | 37 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | return array_reduce( |
66 | 66 | $declared, |
67 | - function ($classList, string $className) use ($includedFiles) { |
|
67 | + function($classList, string $className) use ($includedFiles) { |
|
68 | 68 | $reflClass = new \ReflectionClass($className); |
69 | 69 | $sourceFile = $reflClass->getFileName(); |
70 | 70 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | { |
105 | 105 | $listClass = \get_class($list); |
106 | 106 | |
107 | - if (! isset($this->loadedClasses[$listClass])) { |
|
107 | + if (!isset($this->loadedClasses[$listClass])) { |
|
108 | 108 | $this->loadedClasses[$listClass] = $list; |
109 | 109 | } |
110 | 110 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function loadFromFile(string $fileName) |
118 | 118 | { |
119 | - if (! is_readable($fileName)) { |
|
119 | + if (!is_readable($fileName)) { |
|
120 | 120 | throw new \InvalidArgumentException(sprintf('"%s" does not exist or is not readable', $fileName)); |
121 | 121 | } |
122 | 122 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | try { |
51 | 51 | $result = $service->execute($query); |
52 | - } catch (\InvalidArgumentException $e) { |
|
52 | + }catch (\InvalidArgumentException $e) { |
|
53 | 53 | return new JsonResponse([ |
54 | 54 | "err" => $e->getMessage() |
55 | 55 | ]); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | private function walkAndConvertToUTCDatetime($data) |
67 | 67 | { |
68 | - if (! \is_array($data)) { |
|
68 | + if (!\is_array($data)) { |
|
69 | 69 | return $data; |
70 | 70 | } |
71 | 71 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | if (method_exists($item, 'toDateTime')) { |
59 | - return 'ISODate("' . $item->toDateTime()->format('c') . '")'; |
|
59 | + return 'ISODate("'.$item->toDateTime()->format('c').'")'; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | if (method_exists($item, '__toString')) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | if (\is_array($item) || \is_object($item)) { |
71 | - return self::prepareUnserializableData((array)$item); |
|
71 | + return self::prepareUnserializableData((array) $item); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | return $item; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $this->containerBuilder = $container; |
34 | 34 | $config = $this->processConfiguration(new Configuration(), $configs); |
35 | 35 | |
36 | - $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
36 | + $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
37 | 37 | $loader->load('services.xml'); |
38 | 38 | |
39 | 39 | $this->defineClientRegistry($config['clients'], $container->getParameter("kernel.environment")); |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | ); |
103 | 103 | $connectionDefinition->setFactory([new Reference('mongo.connection_factory'), 'createConnection']); |
104 | 104 | $connectionDefinition->setPublic(true); |
105 | - $this->containerBuilder->setDefinition('mongo.connection.' . $name, $connectionDefinition); |
|
105 | + $this->containerBuilder->setDefinition('mongo.connection.'.$name, $connectionDefinition); |
|
106 | 106 | } |
107 | - $this->containerBuilder->setAlias('mongo.connection', new Alias('mongo.connection.' . array_keys($connections)[0], true)); |
|
107 | + $this->containerBuilder->setAlias('mongo.connection', new Alias('mongo.connection.'.array_keys($connections)[0], true)); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | private function attachDataCollectionListenerToEventManager() |
@@ -43,7 +43,7 @@ |
||
43 | 43 | ->defaultValue('primaryPreferred') |
44 | 44 | ->validate() |
45 | 45 | ->ifNotInArray($readPreferenceValidOptions) |
46 | - ->thenInvalid('Invalid readPreference option %s, must be one of [' . implode(", ", $readPreferenceValidOptions) . ']') |
|
46 | + ->thenInvalid('Invalid readPreference option %s, must be one of ['.implode(", ", $readPreferenceValidOptions).']') |
|
47 | 47 | ->end() |
48 | 48 | ->end() |
49 | 49 | ->scalarNode('replicaSet')->defaultValue(null)->end() |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | return implode( |
90 | 90 | ',', |
91 | 91 | array_map( |
92 | - function (array $host) { |
|
92 | + function(array $host) { |
|
93 | 93 | return sprintf("%s:%d", $host['host'], $host['port']); |
94 | 94 | }, |
95 | 95 | $hosts |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function getClient(string $name, string $databaseName = null): Client |
126 | 126 | { |
127 | - $clientKey = null !== $databaseName ? $name . '.' . $databaseName : $name; |
|
127 | + $clientKey = null !== $databaseName ? $name.'.'.$databaseName : $name; |
|
128 | 128 | |
129 | - if (! isset($this->clients[$clientKey])) { |
|
129 | + if (!isset($this->clients[$clientKey])) { |
|
130 | 130 | $conf = $this->configurations[$name]; |
131 | 131 | $uri = sprintf('mongodb://%s', $conf->getHosts()); |
132 | 132 | $options = array_merge( |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function getLoggedEvent(): Query |
54 | 54 | { |
55 | - if (! $this->hasLoggedEvents()) { |
|
55 | + if (!$this->hasLoggedEvents()) { |
|
56 | 56 | throw new \LogicException('No more events logged!'); |
57 | 57 | } |
58 | 58 | |
@@ -64,6 +64,6 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function hasLoggedEvents(): bool |
66 | 66 | { |
67 | - return ! $this->logs->isEmpty(); |
|
67 | + return !$this->logs->isEmpty(); |
|
68 | 68 | } |
69 | 69 | } |