| @@ -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 | /** | 
| @@ -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; | 
| @@ -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 | |
| @@ -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 | |
| @@ -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() | 
| @@ -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 | } | 
| @@ -55,9 +55,9 @@ | ||
| 55 | 55 | */ | 
| 56 | 56 | public function execute(Query $query, string $verbosity = self::VERBOSITY_ALL_PLAN_EXECUTION): Cursor | 
| 57 | 57 |      { | 
| 58 | -        if (! \in_array($query->getMethod(), self::$acceptedMethods)) { | |
| 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 | |
| @@ -28,7 +28,7 @@ discard block | ||
| 28 | 28 | $this | 
| 29 | 29 |              ->setName('mongodb:fixtures:load') | 
| 30 | 30 |              ->addArgument('addFixturesPath', InputArgument::OPTIONAL, 'Add a path to search in for fixtures files') | 
| 31 | -            ->setDescription('Load fixtures and applies them');; | |
| 31 | +            ->setDescription('Load fixtures and applies them'); ; | |
| 32 | 32 | } | 
| 33 | 33 | |
| 34 | 34 | protected function initialize(InputInterface $input, OutputInterface $output) | 
| @@ -53,7 +53,7 @@ discard block | ||
| 53 | 53 | $fixtures = $this->loader->getLoadedClasses(); | 
| 54 | 54 |          if (empty($fixtures)) { | 
| 55 | 55 | throw new \InvalidArgumentException( | 
| 56 | -                sprintf('Could not find any class to load in: %s', "\n\n- " . implode("\n- ", $paths)) | |
| 56 | +                sprintf('Could not find any class to load in: %s', "\n\n- ".implode("\n- ", $paths)) | |
| 57 | 57 | ); | 
| 58 | 58 | } | 
| 59 | 59 | |
| @@ -73,7 +73,7 @@ discard block | ||
| 73 | 73 |      { | 
| 74 | 74 | $indexList->loadData(); | 
| 75 | 75 | $indexList->loadIndexes(); | 
| 76 | -        $this->io->writeln('Loaded fixture: ' . \get_class($indexList)); | |
| 76 | +        $this->io->writeln('Loaded fixture: '.\get_class($indexList)); | |
| 77 | 77 | } | 
| 78 | 78 | |
| 79 | 79 | /** | 
| @@ -91,7 +91,7 @@ discard block | ||
| 91 | 91 | } | 
| 92 | 92 | |
| 93 | 93 |          foreach ($kernel->getBundles() as $bundle) { | 
| 94 | - $paths[] = $bundle->getPath() . '/DataFixtures/Mongo'; | |
| 94 | + $paths[] = $bundle->getPath().'/DataFixtures/Mongo'; | |
| 95 | 95 | } | 
| 96 | 96 | |
| 97 | 97 | return $paths; | 
| @@ -121,7 +121,7 @@ discard block | ||
| 121 | 121 | */ | 
| 122 | 122 | protected function sortFixtures(&$fixtures): self | 
| 123 | 123 |      { | 
| 124 | -        usort($fixtures, function ($fixture1, $fixture2) { | |
| 124 | +        usort($fixtures, function($fixture1, $fixture2) { | |
| 125 | 125 | $isFixture1Instance = ($fixture1 instanceof OrderedFixtureInterface); | 
| 126 | 126 | $isFixture2Instance = ($fixture2 instanceof OrderedFixtureInterface); | 
| 127 | 127 | |
| @@ -129,7 +129,7 @@ discard block | ||
| 129 | 129 | return $fixture1->getOrder() - $fixture2->getOrder(); | 
| 130 | 130 | } | 
| 131 | 131 | |
| 132 | -            if (! $isFixture1Instance && ! $isFixture2Instance) { | |
| 132 | +            if (!$isFixture1Instance && !$isFixture2Instance) { | |
| 133 | 133 | return 1; | 
| 134 | 134 | } | 
| 135 | 135 | |