@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $query->addProperty('foo', 'vrs', 'abh'); |
38 | 38 | $sql = new Dialects\TransactSQL(); |
39 | 39 | $this->assertEquals('INSERT INTO "foo" ("bar", "htf", "vrs") VALUES (:bar_0, :htf_1, :vrs_2);', $sql->insert($query)); |
40 | - $this->assertEquals([ ':bar_0' => 'baz', ':htf_1' => 'yjd', ':vrs_2' => 'abh', ], $query->getParams()); |
|
40 | + $this->assertEquals([':bar_0' => 'baz', ':htf_1' => 'yjd', ':vrs_2' => 'abh', ], $query->getParams()); |
|
41 | 41 | $query->resetCounter(); |
42 | 42 | } |
43 | 43 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $query->setLimit(5); |
54 | 54 | $sql = new Dialects\TransactSQL(); |
55 | 55 | $this->assertEquals('DELETE TOP(5) FROM "foo" WHERE "dbt" = :dbt_0 AND "dfd" != :dfd_1;', $sql->delete($query)); |
56 | - $this->assertEquals([ ':dbt_0' => 'ggf', ':dfd_1' => 'yxn', ], $query->getParams()); |
|
56 | + $this->assertEquals([':dbt_0' => 'ggf', ':dfd_1' => 'yxn', ], $query->getParams()); |
|
57 | 57 | $query->resetCounter(); |
58 | 58 | } |
59 | 59 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $query->addCondition('foo', 'dfd', IQueryBuilder::OPERATION_NEQ, 'yxn'); |
72 | 72 | $sql = new Dialects\TransactSQL(); |
73 | 73 | $this->assertEquals('UPDATE "foo" SET "bar" = :bar_0, "htf" = :htf_1, "vrs" = :vrs_2 WHERE "dbt" = :dbt_3 AND "dfd" != :dfd_4;', $sql->update($query)); |
74 | - $this->assertEquals([ ':bar_0' => 'baz', ':htf_1' => 'yjd', ':vrs_2' => 'abh', ':dbt_3' => 'ggf', ':dfd_4' => 'yxn', ], $query->getParams()); |
|
74 | + $this->assertEquals([':bar_0' => 'baz', ':htf_1' => 'yjd', ':vrs_2' => 'abh', ':dbt_3' => 'ggf', ':dfd_4' => 'yxn', ], $query->getParams()); |
|
75 | 75 | $query->resetCounter(); |
76 | 76 | } |
77 | 77 | |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | $query->addCondition('foo', 'dfd', IQueryBuilder::OPERATION_NEQ, 'yxn'); |
91 | 91 | $query->addOrderBy('dfg', 'vrs', IQueryBuilder::ORDER_ASC); |
92 | 92 | $query->addGroupBy('foo', 'gds'); |
93 | - $query->setLimits(5,3); |
|
93 | + $query->setLimits(5, 3); |
|
94 | 94 | $sql = new Dialects\TransactSQL(); |
95 | 95 | $this->assertEquals('SELECT TOP(3) "foo"."bar" AS "baz", "foo"."htf" AS "yjd", "dfg"."vrs" AS "abh" FROM "foo" LEFT JOIN "btr" AS "dfg" ON ("foo"."fds" = "dfg"."gda") WHERE "foo"."dbt" = :dbt_0 AND "foo"."dfd" != :dfd_1 GROUP BY "foo"."gds" ORDER BY "dfg"."vrs" ASC OFFSET 5 ;', $sql->select($query)); |
96 | - $this->assertEquals([ ':dbt_0' => 'ggf', ':dfd_1' => 'yxn', ], $query->getParams()); |
|
96 | + $this->assertEquals([':dbt_0' => 'ggf', ':dfd_1' => 'yxn', ], $query->getParams()); |
|
97 | 97 | $query->resetCounter(); |
98 | 98 | } |
99 | 99 | } |
@@ -38,19 +38,19 @@ |
||
38 | 38 | protected function setUp(): void |
39 | 39 | { |
40 | 40 | $location = getenv('MSSERVER'); |
41 | - $location = false !== $location ? strval($location) : '127.0.0.1' ; |
|
41 | + $location = false !== $location ? strval($location) : '127.0.0.1'; |
|
42 | 42 | |
43 | 43 | $port = getenv('MSPORT'); |
44 | - $port = false !== $port ? intval($port) : 3306 ; |
|
44 | + $port = false !== $port ? intval($port) : 3306; |
|
45 | 45 | |
46 | 46 | $user = getenv('MSUSER'); |
47 | - $user = false !== $user ? strval($user) : 'testing' ; |
|
47 | + $user = false !== $user ? strval($user) : 'testing'; |
|
48 | 48 | |
49 | 49 | $pass = getenv('MSPASS'); |
50 | - $pass = false !== $pass ? strval($pass) : 'testing' ; |
|
50 | + $pass = false !== $pass ? strval($pass) : 'testing'; |
|
51 | 51 | |
52 | 52 | $db = getenv('MSDB'); |
53 | - $db = false !== $db ? strval($db) : 'testing' ; |
|
53 | + $db = false !== $db ? strval($db) : 'testing'; |
|
54 | 54 | |
55 | 55 | $conf = Config::init()->setTarget( |
56 | 56 | IDriverSources::TYPE_PDO_MSSQL, |
@@ -38,19 +38,19 @@ |
||
38 | 38 | protected function setUp(): void |
39 | 39 | { |
40 | 40 | $location = getenv('PGSERVER'); |
41 | - $location = false !== $location ? strval($location) : '127.0.0.1' ; |
|
41 | + $location = false !== $location ? strval($location) : '127.0.0.1'; |
|
42 | 42 | |
43 | 43 | $port = getenv('PGPORT'); |
44 | - $port = false !== $port ? intval($port) : 5432 ; |
|
44 | + $port = false !== $port ? intval($port) : 5432; |
|
45 | 45 | |
46 | 46 | $user = getenv('PGUSER'); |
47 | - $user = false !== $user ? strval($user) : 'postgres' ; |
|
47 | + $user = false !== $user ? strval($user) : 'postgres'; |
|
48 | 48 | |
49 | 49 | $pass = getenv('PGPASS'); |
50 | - $pass = false !== $pass ? strval($pass) : 'postgres' ; |
|
50 | + $pass = false !== $pass ? strval($pass) : 'postgres'; |
|
51 | 51 | |
52 | 52 | $db = getenv('PGDB'); |
53 | - $db = false !== $db ? strval($db) : 'testing' ; |
|
53 | + $db = false !== $db ? strval($db) : 'testing'; |
|
54 | 54 | |
55 | 55 | $conf = Config::init()->setTarget( |
56 | 56 | IDriverSources::TYPE_PDO_POSTGRES, |
@@ -37,19 +37,19 @@ |
||
37 | 37 | protected function setUp(): void |
38 | 38 | { |
39 | 39 | $location = getenv('MYSERVER'); |
40 | - $location = false !== $location ? strval($location) : '127.0.0.1' ; |
|
40 | + $location = false !== $location ? strval($location) : '127.0.0.1'; |
|
41 | 41 | |
42 | 42 | $port = getenv('MYPORT'); |
43 | - $port = false !== $port ? intval($port) : 3306 ; |
|
43 | + $port = false !== $port ? intval($port) : 3306; |
|
44 | 44 | |
45 | 45 | $user = getenv('MYUSER'); |
46 | - $user = false !== $user ? strval($user) : 'testing' ; |
|
46 | + $user = false !== $user ? strval($user) : 'testing'; |
|
47 | 47 | |
48 | 48 | $pass = getenv('MYPASS'); |
49 | - $pass = false !== $pass ? strval($pass) : 'testing' ; |
|
49 | + $pass = false !== $pass ? strval($pass) : 'testing'; |
|
50 | 50 | |
51 | 51 | $db = getenv('MYDB'); |
52 | - $db = false !== $db ? strval($db) : 'testing' ; |
|
52 | + $db = false !== $db ? strval($db) : 'testing'; |
|
53 | 53 | |
54 | 54 | $conf = Config::init()->setTarget( |
55 | 55 | IDriverSources::TYPE_PDO_MYSQL, |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $record = new XRecordChild(); |
41 | 41 | $record2 = new XRecordParent(); |
42 | 42 | $lib = new Filler($record); |
43 | - $records = [ // you must define all wanted records with their aliases used for join |
|
43 | + $records = [// you must define all wanted records with their aliases used for join |
|
44 | 44 | (new RecordsInJoin())->setData($record, $record->getMapper()->getAlias(), null, ''), // primary record has its alias as key and must have empty parent |
45 | 45 | (new RecordsInJoin())->setData($record2, 'as_is', $record->getMapper()->getAlias(), 'prt'), // other records has aliases defined by their parents or by custom value |
46 | 46 | ]; |
@@ -57,21 +57,21 @@ discard block |
||
57 | 57 | '' // referred in query |
58 | 58 | ); |
59 | 59 | $struct = $lib->getColumns([$this->basicJoin(), $join2]); |
60 | - $this->assertEquals([ // tables |
|
60 | + $this->assertEquals([// tables |
|
61 | 61 | 'kw_mapper_child_testing', |
62 | 62 | 'kw_mapper_child_testing', |
63 | 63 | 'kw_mapper_child_testing', |
64 | 64 | 'as_is', |
65 | 65 | 'as_is', |
66 | 66 | ], array_column($struct, 0)); |
67 | - $this->assertEquals([ // columns |
|
67 | + $this->assertEquals([// columns |
|
68 | 68 | 'kmct_id', |
69 | 69 | 'kmct_name', |
70 | 70 | 'kmpt_id', |
71 | 71 | 'kmpt_id', |
72 | 72 | 'kmpt_name', |
73 | 73 | ], array_column($struct, 1)); |
74 | - $this->assertEquals([ // aliases |
|
74 | + $this->assertEquals([// aliases |
|
75 | 75 | 'kw_mapper_child_testing____kmct_id', |
76 | 76 | 'kw_mapper_child_testing____kmct_name', |
77 | 77 | 'kw_mapper_child_testing____kmpt_id', |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $record = new XRecordChild(); |
89 | 89 | $lib = new Filler($record); |
90 | 90 | |
91 | - $wantedRecords = [ // you must define all wanted records with their aliases used for join |
|
91 | + $wantedRecords = [// you must define all wanted records with their aliases used for join |
|
92 | 92 | (new RecordsInJoin())->setData($record, $record->getMapper()->getAlias(), null, ''), // primary record has its alias as key and must have empty parent |
93 | 93 | ]; |
94 | 94 | $lib->initTreeSolver($wantedRecords); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $record = new XRecordChild(); |
120 | 120 | $lib = new Filler($record); |
121 | 121 | |
122 | - $wantedRecords = [ // you must define all wanted records with their aliases used for join |
|
122 | + $wantedRecords = [// you must define all wanted records with their aliases used for join |
|
123 | 123 | (new RecordsInJoin())->setData($record, $record->getMapper()->getAlias(), null, ''), // primary record has its alias as key and must have empty parent |
124 | 124 | ]; |
125 | 125 | $lib->initTreeSolver($wantedRecords); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $record2 = new XRecordParent(); |
152 | 152 | $lib = new Filler($record); |
153 | 153 | |
154 | - $wantedRecords = [ // you must define all wanted records with their aliases used for join |
|
154 | + $wantedRecords = [// you must define all wanted records with their aliases used for join |
|
155 | 155 | (new RecordsInJoin())->setData($record, $record->getMapper()->getAlias(), null, ''), // primary record has its alias as key and must have empty parent |
156 | 156 | (new RecordsInJoin())->setData($record2, 'as_is', $record->getMapper()->getAlias(), 'prt'), // other records has aliases defined by their parents or by custom value |
157 | 157 | ]; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $record2 = new XRecordParent(); |
218 | 218 | $lib = new Filler($record); |
219 | 219 | |
220 | - $wantedRecords = [ // you must define all wanted records with their aliases used for join |
|
220 | + $wantedRecords = [// you must define all wanted records with their aliases used for join |
|
221 | 221 | (new RecordsInJoin())->setData($record, $record->getMapper()->getAlias(), null, ''), // primary record has its alias as key and must have empty parent |
222 | 222 | (new RecordsInJoin())->setData($record2, 'as_is', $record->getMapper()->getAlias(), 'prt'), // other records has aliases defined by their parents or by custom value |
223 | 223 | ]; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | $record2 = new XRecordParent(); |
296 | 296 | $lib = new Filler($record); |
297 | 297 | |
298 | - $wantedRecords = [ // you must define all wanted records with their aliases used for join |
|
298 | + $wantedRecords = [// you must define all wanted records with their aliases used for join |
|
299 | 299 | (new RecordsInJoin())->setData($record, $record->getMapper()->getAlias(), null, ''), // primary record has its alias as key and must have empty parent |
300 | 300 | (new RecordsInJoin())->setData($record2, 'not_known', $record->getMapper()->getAlias(), 'prt'), // other records has aliases defined by their parents or by custom value |
301 | 301 | ]; |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | $record2 = new XRecordParent(); |
314 | 314 | $lib = new Filler($record); |
315 | 315 | |
316 | - $wantedRecords = [ // you must define all wanted records with their aliases used for join |
|
316 | + $wantedRecords = [// you must define all wanted records with their aliases used for join |
|
317 | 317 | (new RecordsInJoin())->setData($record, $record->getMapper()->getAlias(), 'not_known', ''), // primary record has its alias as key and must have empty parent |
318 | 318 | (new RecordsInJoin())->setData($record2, 'as_is', 'not_known', 'prt'), // other records has aliases defined by their parents or by custom value |
319 | 319 | ]; |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | protected function resultData4(): array |
444 | 444 | { |
445 | 445 | return [ |
446 | - [ // 4 with cross references |
|
446 | + [// 4 with cross references |
|
447 | 447 | 'kw_mapper_child_testing____kmct_id' => 1, |
448 | 448 | 'kw_mapper_child_testing____kmct_name' => 'abc', |
449 | 449 | 'kw_mapper_child_testing____kmpt_id' => 1, |
@@ -471,14 +471,14 @@ discard block |
||
471 | 471 | 'as_is____kmpt_id' => 2, |
472 | 472 | 'as_is____kmpt_name' => 'opq', |
473 | 473 | ], |
474 | - [ // no child |
|
474 | + [// no child |
|
475 | 475 | 'kw_mapper_child_testing____kmct_id' => 3, |
476 | 476 | 'kw_mapper_child_testing____kmct_name' => 'jkl', |
477 | 477 | 'kw_mapper_child_testing____kmpt_id' => null, |
478 | 478 | 'as_is____kmpt_id' => null, |
479 | 479 | 'as_is____kmpt_name' => null, |
480 | 480 | ], |
481 | - [ // one separated, no another reference |
|
481 | + [// one separated, no another reference |
|
482 | 482 | 'kw_mapper_child_testing____kmct_id' => 4, |
483 | 483 | 'kw_mapper_child_testing____kmct_name' => 'mno', |
484 | 484 | 'kw_mapper_child_testing____kmpt_id' => 3, |
@@ -268,7 +268,7 @@ |
||
268 | 268 | |
269 | 269 | protected function initSource(ARecord $record, string $source = ''): void |
270 | 270 | { |
271 | - $source = empty($source) ? $this->getSourceFileMeta() : $source ; |
|
271 | + $source = empty($source) ? $this->getSourceFileMeta() : $source; |
|
272 | 272 | $target = $this->getTestFile(); |
273 | 273 | copy($source, $target); |
274 | 274 | $record->getMapper()->setSource($target); |
@@ -58,7 +58,7 @@ |
||
58 | 58 | { |
59 | 59 | protected function setMap(): void |
60 | 60 | { |
61 | - $this->setSource(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'index.short'); |
|
61 | + $this->setSource(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'index.short'); |
|
62 | 62 | $this->setFormat('\kalanis\kw_mapper\Storage\File\Formats\SeparatedElements'); |
63 | 63 | $this->orderFromFirst(false); |
64 | 64 | $this->setRelation('id', 0); |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | $this->addEntry('photo', IEntryType::TYPE_STRING, 255); |
89 | 89 | $this->addEntry('photoX', IEntryType::TYPE_INTEGER, 2048); |
90 | 90 | $this->addEntry('photoY', IEntryType::TYPE_INTEGER, 2048); |
91 | - $this->addEntry('breed', IEntryType::TYPE_SET, ['no','yes','died']); |
|
92 | - $this->addEntry('sex', IEntryType::TYPE_SET, ['female','male']); |
|
93 | - $this->addEntry('blood', IEntryType::TYPE_SET, ['our','other']); |
|
91 | + $this->addEntry('breed', IEntryType::TYPE_SET, ['no', 'yes', 'died']); |
|
92 | + $this->addEntry('sex', IEntryType::TYPE_SET, ['female', 'male']); |
|
93 | + $this->addEntry('blood', IEntryType::TYPE_SET, ['our', 'other']); |
|
94 | 94 | $this->addEntry('text', IEntryType::TYPE_STRING, 8192); |
95 | 95 | $this->addEntry('parents', IEntryType::TYPE_ARRAY); // FK - makes the array of entries every time |
96 | 96 | $this->addEntry('children', IEntryType::TYPE_ARRAY); // FK - makes the array of entries every time |
@@ -199,9 +199,9 @@ discard block |
||
199 | 199 | $this->addEntry('photo', IEntryType::TYPE_STRING, 255); |
200 | 200 | $this->addEntry('photoX', IEntryType::TYPE_INTEGER, 2048); |
201 | 201 | $this->addEntry('photoY', IEntryType::TYPE_INTEGER, 2048); |
202 | - $this->addEntry('breed', IEntryType::TYPE_SET, ['no','yes','died']); |
|
203 | - $this->addEntry('sex', IEntryType::TYPE_SET, ['female','male']); |
|
204 | - $this->addEntry('blood', IEntryType::TYPE_SET, ['our','other']); |
|
202 | + $this->addEntry('breed', IEntryType::TYPE_SET, ['no', 'yes', 'died']); |
|
203 | + $this->addEntry('sex', IEntryType::TYPE_SET, ['female', 'male']); |
|
204 | + $this->addEntry('blood', IEntryType::TYPE_SET, ['our', 'other']); |
|
205 | 205 | $this->addEntry('text', IEntryType::TYPE_STRING, 8192); |
206 | 206 | $this->setMapper('\DebugsTests\PedigreeMapper'); |
207 | 207 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | { |
73 | 73 | use TFill; |
74 | 74 | |
75 | - public function xFill(Entry &$entry, $value) |
|
75 | + public function xFill(Entry & $entry, $value) |
|
76 | 76 | { |
77 | 77 | $this->typedFill($entry, $value); |
78 | 78 | } |