@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Query; |
6 | 6 | |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function testAbstractSchemaNameSupportsClassnamesWithLeadingBackslash() |
33 | 33 | { |
34 | - $parser = $this->createParser('\\' . CmsUser::class); |
|
34 | + $parser = $this->createParser('\\'.CmsUser::class); |
|
35 | 35 | |
36 | - self::assertEquals('\\' . CmsUser::class, $parser->AbstractSchemaName()); |
|
36 | + self::assertEquals('\\'.CmsUser::class, $parser->AbstractSchemaName()); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -1657,9 +1657,9 @@ discard block |
||
1657 | 1657 | ); |
1658 | 1658 | } |
1659 | 1659 | |
1660 | - /** |
|
1661 | - * @group DDC-1430 |
|
1662 | - */ |
|
1660 | + /** |
|
1661 | + * @group DDC-1430 |
|
1662 | + */ |
|
1663 | 1663 | public function testGroupByAllFieldsWhenObjectHasForeignKeys() |
1664 | 1664 | { |
1665 | 1665 | $this->assertSqlGeneration( |
@@ -1999,9 +1999,9 @@ discard block |
||
1999 | 1999 | ); |
2000 | 2000 | } |
2001 | 2001 | |
2002 | - /** |
|
2003 | - * @group DDC-1845 |
|
2004 | - */ |
|
2002 | + /** |
|
2003 | + * @group DDC-1845 |
|
2004 | + */ |
|
2005 | 2005 | public function testQuotedWalkJoinVariableDeclaration() |
2006 | 2006 | { |
2007 | 2007 | $this->assertSqlGeneration( |
@@ -2035,9 +2035,9 @@ discard block |
||
2035 | 2035 | ); |
2036 | 2036 | } |
2037 | 2037 | |
2038 | - /** |
|
2039 | - * @group DDC-2208 |
|
2040 | - */ |
|
2038 | + /** |
|
2039 | + * @group DDC-2208 |
|
2040 | + */ |
|
2041 | 2041 | public function testCaseThenParameterArithmeticExpression() |
2042 | 2042 | { |
2043 | 2043 | $this->assertSqlGeneration( |
@@ -2057,8 +2057,8 @@ discard block |
||
2057 | 2057 | } |
2058 | 2058 | |
2059 | 2059 | /** |
2060 | - * @group DDC-2268 |
|
2061 | - */ |
|
2060 | + * @group DDC-2268 |
|
2061 | + */ |
|
2062 | 2062 | public function testCaseThenFunction() |
2063 | 2063 | { |
2064 | 2064 | $this->assertSqlGeneration( |
@@ -2123,17 +2123,17 @@ discard block |
||
2123 | 2123 | $this->assertSqlGeneration( |
2124 | 2124 | 'SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE CONCAT(u.name, u.status, \'s\') = ?1', |
2125 | 2125 | 'SELECT t0.[id] AS c0 FROM [cms_users] t0 WHERE (t0.[name] + t0.[status] + \'s\') = ?' |
2126 | - ); |
|
2126 | + ); |
|
2127 | 2127 | |
2128 | - $this->assertSqlGeneration( |
|
2128 | + $this->assertSqlGeneration( |
|
2129 | 2129 | 'SELECT CONCAT(u.id, u.name, u.status) FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1', |
2130 | 2130 | 'SELECT (t0.[id] + t0.[name] + t0.[status]) AS c0 FROM [cms_users] t0 WHERE t0.[id] = ?' |
2131 | - ); |
|
2131 | + ); |
|
2132 | 2132 | } |
2133 | 2133 | |
2134 | - /** |
|
2135 | - * @group DDC-2188 |
|
2136 | - */ |
|
2134 | + /** |
|
2135 | + * @group DDC-2188 |
|
2136 | + */ |
|
2137 | 2137 | public function testArithmeticPriority() |
2138 | 2138 | { |
2139 | 2139 | $this->assertSqlGeneration( |
@@ -2153,8 +2153,8 @@ discard block |
||
2153 | 2153 | } |
2154 | 2154 | |
2155 | 2155 | /** |
2156 | - * @group DDC-2475 |
|
2157 | - */ |
|
2156 | + * @group DDC-2475 |
|
2157 | + */ |
|
2158 | 2158 | public function testOrderByClauseShouldReplaceOrderByRelationMapping() |
2159 | 2159 | { |
2160 | 2160 | $this->assertSqlGeneration( |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Query; |
6 | 6 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | $query->free(); |
66 | 66 | } catch (\Exception $e) { |
67 | - $this->fail($e->getMessage() ."\n".$e->getTraceAsString()); |
|
67 | + $this->fail($e->getMessage()."\n".$e->getTraceAsString()); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | self::assertEquals($sqlToBeConfirmed, $sqlGenerated); |
@@ -1614,7 +1614,7 @@ discard block |
||
1614 | 1614 | public function testAliasDoesNotExceedPlatformDefinedLength() |
1615 | 1615 | { |
1616 | 1616 | $this->assertSqlGeneration( |
1617 | - 'SELECT m FROM ' . __NAMESPACE__ . '\\DDC1384Model m', |
|
1617 | + 'SELECT m FROM '.__NAMESPACE__.'\\DDC1384Model m', |
|
1618 | 1618 | 'SELECT t0."aVeryLongIdentifierThatShouldBeShortenedByTheSQLWalker_fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" AS c0 FROM "DDC1384Model" t0' |
1619 | 1619 | ); |
1620 | 1620 | } |
@@ -1647,12 +1647,12 @@ discard block |
||
1647 | 1647 | public function testSelectWithArithmeticExpressionBeforeField() |
1648 | 1648 | { |
1649 | 1649 | $this->assertSqlGeneration( |
1650 | - 'SELECT - e.value AS value, e.id FROM ' . __NAMESPACE__ . '\DDC1474Entity e', |
|
1650 | + 'SELECT - e.value AS value, e.id FROM '.__NAMESPACE__.'\DDC1474Entity e', |
|
1651 | 1651 | 'SELECT -t0."value" AS c0, t0."id" AS c1 FROM "DDC1474Entity" t0' |
1652 | 1652 | ); |
1653 | 1653 | |
1654 | 1654 | $this->assertSqlGeneration( |
1655 | - 'SELECT e.id, + e.value AS value FROM ' . __NAMESPACE__ . '\DDC1474Entity e', |
|
1655 | + 'SELECT e.id, + e.value AS value FROM '.__NAMESPACE__.'\DDC1474Entity e', |
|
1656 | 1656 | 'SELECT t0."id" AS c0, +t0."value" AS c1 FROM "DDC1474Entity" t0' |
1657 | 1657 | ); |
1658 | 1658 | } |
@@ -2328,8 +2328,8 @@ discard block |
||
2328 | 2328 | public function testHavingRegressionUsingVariableWithMathOperatorsExpression($operator) |
2329 | 2329 | { |
2330 | 2330 | $this->assertSqlGeneration( |
2331 | - 'SELECT COUNT(u.name) AS countName FROM Doctrine\Tests\Models\CMS\CmsUser u HAVING 1 ' . $operator . ' countName > 0', |
|
2332 | - 'SELECT COUNT(t0."name") AS c0 FROM "cms_users" t0 HAVING 1 ' . $operator . ' c0 > 0' |
|
2331 | + 'SELECT COUNT(u.name) AS countName FROM Doctrine\Tests\Models\CMS\CmsUser u HAVING 1 '.$operator.' countName > 0', |
|
2332 | + 'SELECT COUNT(t0."name") AS c0 FROM "cms_users" t0 HAVING 1 '.$operator.' c0 > 0' |
|
2333 | 2333 | ); |
2334 | 2334 | } |
2335 | 2335 | |
@@ -2351,7 +2351,7 @@ discard block |
||
2351 | 2351 | */ |
2352 | 2352 | public function getSql(SqlWalker $sqlWalker) |
2353 | 2353 | { |
2354 | - return 'ABS(' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) . ')'; |
|
2354 | + return 'ABS('.$sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression).')'; |
|
2355 | 2355 | } |
2356 | 2356 | |
2357 | 2357 | /** |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Query; |
6 | 6 | use Doctrine\Tests\OrmTestCase; |
@@ -25,6 +25,10 @@ |
||
25 | 25 | $this->em = $this->getTestEntityManager(); |
26 | 26 | } |
27 | 27 | |
28 | + /** |
|
29 | + * @param string $dqlToBeTested |
|
30 | + * @param string $sqlToBeConfirmed |
|
31 | + */ |
|
28 | 32 | public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed) |
29 | 33 | { |
30 | 34 | try { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Query; |
6 | 6 | |
@@ -88,6 +88,6 @@ discard block |
||
88 | 88 | public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) |
89 | 89 | { |
90 | 90 | // getParameter applies quoting automatically |
91 | - return $targetTableAlias . '.id = ' . $this->getParameter('id'); |
|
91 | + return $targetTableAlias.'.id = '.$this->getParameter('id'); |
|
92 | 92 | } |
93 | 93 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Persisters; |
6 | 6 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional\SchemaTool; |
6 | 6 | |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | parent::setUp(); |
17 | 17 | |
18 | 18 | if ($this->em->getConnection()->getDatabasePlatform()->getName() !== 'postgresql') { |
19 | - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of postgresql.'); |
|
19 | + $this->markTestSkipped('The '.__CLASS__.' requires the use of postgresql.'); |
|
20 | 20 | } |
21 | 21 | } |
22 | 22 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional\SchemaTool; |
6 | 6 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | try { |
74 | 74 | $this->schemaTool->createSchema($classMetadata); |
75 | - } catch(\Exception $e) { |
|
75 | + } catch (\Exception $e) { |
|
76 | 76 | // was already created |
77 | 77 | } |
78 | 78 | |
@@ -87,6 +87,6 @@ discard block |
||
87 | 87 | $sql = $schemaDiff->toSql($this->em->getConnection()->getDatabasePlatform()); |
88 | 88 | $sql = array_filter($sql, function($sql) { return strpos($sql, 'DROP') === false; }); |
89 | 89 | |
90 | - self::assertEquals(0, count($sql), "SQL: " . implode(PHP_EOL, $sql)); |
|
90 | + self::assertEquals(0, count($sql), "SQL: ".implode(PHP_EOL, $sql)); |
|
91 | 91 | } |
92 | 92 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional\SchemaTool; |
6 | 6 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function testDropPartSchemaWithForeignKeys() |
60 | 60 | { |
61 | - if (!$this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
61 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
62 | 62 | $this->markTestSkipped("Foreign Key test"); |
63 | 63 | } |
64 | 64 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional\SchemaTool; |
6 | 6 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | $updateSql = $this->schemaTool->getUpdateSchemaSql([$class]); |
32 | 32 | |
33 | - $updateSql = array_filter($updateSql, function ($sql) { |
|
33 | + $updateSql = array_filter($updateSql, function($sql) { |
|
34 | 34 | return strpos($sql, 'DBAL483') !== false; |
35 | 35 | }); |
36 | 36 |