@@ -33,13 +33,13 @@ |
||
33 | 33 | protected function configure() |
34 | 34 | { |
35 | 35 | $this->setName('orm:run-dql') |
36 | - ->setDescription('Executes arbitrary DQL directly from the command line') |
|
37 | - ->addArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.') |
|
38 | - ->addOption('hydrate', null, InputOption::VALUE_REQUIRED, 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', 'object') |
|
39 | - ->addOption('first-result', null, InputOption::VALUE_REQUIRED, 'The first result in the result set.') |
|
40 | - ->addOption('max-result', null, InputOption::VALUE_REQUIRED, 'The maximum number of results in the result set.') |
|
41 | - ->addOption('show-sql', null, InputOption::VALUE_NONE, 'Dump generated SQL instead of executing query') |
|
42 | - ->setHelp('Executes arbitrary DQL directly from the command line.'); |
|
36 | + ->setDescription('Executes arbitrary DQL directly from the command line') |
|
37 | + ->addArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.') |
|
38 | + ->addOption('hydrate', null, InputOption::VALUE_REQUIRED, 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', 'object') |
|
39 | + ->addOption('first-result', null, InputOption::VALUE_REQUIRED, 'The first result in the result set.') |
|
40 | + ->addOption('max-result', null, InputOption::VALUE_REQUIRED, 'The maximum number of results in the result set.') |
|
41 | + ->addOption('show-sql', null, InputOption::VALUE_NONE, 'Dump generated SQL instead of executing query') |
|
42 | + ->setHelp('Executes arbitrary DQL directly from the command line.'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | $hydrationModeName = $input->getOption('hydrate'); |
61 | - $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_' . strtoupper(str_replace('-', '_', $hydrationModeName)); |
|
61 | + $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_'.strtoupper(str_replace('-', '_', $hydrationModeName)); |
|
62 | 62 | |
63 | - if (! defined($hydrationMode)) { |
|
63 | + if ( ! defined($hydrationMode)) { |
|
64 | 64 | throw new RuntimeException(sprintf( |
65 | 65 | "Hydration mode '%s' does not exist. It should be either: object. array, scalar or single-scalar.", |
66 | 66 | $hydrationModeName |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $firstResult = $input->getOption('first-result'); |
72 | 72 | |
73 | 73 | if ($firstResult !== null) { |
74 | - if (! is_numeric($firstResult)) { |
|
74 | + if ( ! is_numeric($firstResult)) { |
|
75 | 75 | throw new LogicException("Option 'first-result' must contain an integer value"); |
76 | 76 | } |
77 | 77 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $maxResult = $input->getOption('max-result'); |
82 | 82 | |
83 | 83 | if ($maxResult !== null) { |
84 | - if (! is_numeric($maxResult)) { |
|
84 | + if ( ! is_numeric($maxResult)) { |
|
85 | 85 | throw new LogicException("Option 'max-result' must contain an integer value"); |
86 | 86 | } |
87 | 87 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $resultSet = $query->execute([], constant($hydrationMode)); |
97 | 97 | |
98 | - $dumper = new CliDumper(static function (string $payload) use ($output) : void { |
|
98 | + $dumper = new CliDumper(static function(string $payload) use ($output) : void { |
|
99 | 99 | $output->write($payload); |
100 | 100 | }); |
101 | 101 | $dumper->dump((new VarCloner())->cloneVar($resultSet)); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | { |
87 | 87 | $cache = self::createCacheInstance($isDevMode, $cache); |
88 | 88 | |
89 | - if (! $cache instanceof CacheProvider) { |
|
89 | + if ( ! $cache instanceof CacheProvider) { |
|
90 | 90 | return $cache; |
91 | 91 | } |
92 | 92 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $namespace .= ':'; |
97 | 97 | } |
98 | 98 | |
99 | - $cache->setNamespace($namespace . 'dc2_' . md5($proxyDir) . '_'); // to avoid collisions |
|
99 | + $cache->setNamespace($namespace.'dc2_'.md5($proxyDir).'_'); // to avoid collisions |
|
100 | 100 | |
101 | 101 | return $cache; |
102 | 102 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | public function tearDown() : void |
37 | 37 | { |
38 | - if (! $this->originalIncludePath) { |
|
38 | + if ( ! $this->originalIncludePath) { |
|
39 | 39 | return; |
40 | 40 | } |
41 | 41 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $config = Setup::createConfiguration(false, __DIR__); |
75 | 75 | $cache = $config->getMetadataCacheImpl(); |
76 | 76 | |
77 | - self::assertSame('dc2_' . md5(__DIR__) . '_', $cache->getNamespace()); |
|
77 | + self::assertSame('dc2_'.md5(__DIR__).'_', $cache->getNamespace()); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $config = Setup::createConfiguration(false, __DIR__, new ArrayCache()); |
86 | 86 | $cache = $config->getMetadataCacheImpl(); |
87 | 87 | |
88 | - self::assertSame('dc2_' . md5(__DIR__) . '_', $cache->getNamespace()); |
|
88 | + self::assertSame('dc2_'.md5(__DIR__).'_', $cache->getNamespace()); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $cache = $config->getMetadataCacheImpl(); |
101 | 101 | |
102 | 102 | self::assertSame($originalCache, $cache); |
103 | - self::assertSame('foo:dc2_' . md5(__DIR__) . '_', $cache->getNamespace()); |
|
103 | + self::assertSame('foo:dc2_'.md5(__DIR__).'_', $cache->getNamespace()); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |