diff --git a/UPDATE.md b/UPDATE.md index bfe97d5943..e736d8490a 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -2,8 +2,4 @@ ## Propel Update Information -Any and all update information pertaining to `Propel` is now available on the -project website. Please reference the link below for details about updates, -new features, and backwards incompatabilities. - -[**Propel Update Information**](http://propelorm.org/documentation/whats-new.html) +[**Propel Update Information**](https://github.com/propelorm/Propel2/releases) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 0401880d75..62a39a46bd 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -545,8 +545,7 @@ - - $tableMap::addSelectColumns($this, $this->useAliasInSQL ? $this->modelAlias : null) + new $secondaryCriteriaClass() diff --git a/src/Propel/Generator/Builder/Om/ObjectBuilder.php b/src/Propel/Generator/Builder/Om/ObjectBuilder.php index 65ef45f0c7..95c28f6e26 100644 --- a/src/Propel/Generator/Builder/Om/ObjectBuilder.php +++ b/src/Propel/Generator/Builder/Om/ObjectBuilder.php @@ -3004,7 +3004,7 @@ public function toArray(\$keyType = TableMap::$defaultKeyType, \$includeLazyLoad if ($col->isTemporalType()) { $script .= " if (\$result[\$keys[$num]] instanceof \DateTimeInterface) { - \$result[\$keys[$num]] = \$result[\$keys[$num]]->format('c'); + \$result[\$keys[$num]] = \$result[\$keys[$num]]->format('" . $this->getTemporalFormatter($col) . "'); } "; } diff --git a/src/Propel/Runtime/ActiveQuery/ModelCriteria.php b/src/Propel/Runtime/ActiveQuery/ModelCriteria.php index 09ca5e58f6..873868ac2f 100644 --- a/src/Propel/Runtime/ActiveQuery/ModelCriteria.php +++ b/src/Propel/Runtime/ActiveQuery/ModelCriteria.php @@ -953,6 +953,7 @@ public function addSelfSelectColumns($force = false) return $this; } + /** @var string $tableMap */ $tableMap = $this->modelTableMapName; $tableMap::addSelectColumns($this, $this->useAliasInSQL ? $this->modelAlias : null); $this->isSelfSelected = true; @@ -973,6 +974,7 @@ public function removeSelfSelectColumns($force = false) return $this; } + /** @var string $tableMap */ $tableMap = $this->modelTableMapName; $tableMap::removeSelectColumns($this, $this->useAliasInSQL ? $this->modelAlias : null); $this->isSelfSelected = false; diff --git a/tests/Propel/Tests/Generator/Builder/Om/GeneratedObjectTest.php b/tests/Propel/Tests/Generator/Builder/Om/GeneratedObjectTest.php index b605f360ab..cb122c740b 100644 --- a/tests/Propel/Tests/Generator/Builder/Om/GeneratedObjectTest.php +++ b/tests/Propel/Tests/Generator/Builder/Om/GeneratedObjectTest.php @@ -12,6 +12,7 @@ use Exception; use MyNameSpace\TestKeyTypeTable; use Propel\Generator\Config\QuickGeneratorConfig; +use Propel\Tests\Bookstore\BookClubList; use Propel\Generator\Util\QuickBuilder; use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\Adapter\Pdo\SqliteAdapter; @@ -816,7 +817,15 @@ public function testToArrayDateTimeAsString() $review = new Review(); $review->setReviewDate($date); - $this->assertEquals('2015-01-04T16:00:02+00:00', $review->toArray()['ReviewDate'], 'toArray() format temporal colums as ISO8601'); + $bookstore = new Bookstore(); + $bookstore->setStoreOpenTime($date); + + $bookClubList = new BookClubList(); + $bookClubList->setCreatedAt($date); + + $this->assertEquals('2015-01-04', $review->toArray()['ReviewDate'], 'toArray() format colums of type DATE as Y-m-d'); + $this->assertEquals('16:00:02.000000', $bookstore->toArray()['StoreOpenTime'], 'toArray() format toArray() colums of type TIME as H:i:s.u'); + $this->assertEquals('2015-01-04 16:00:02.000000', $bookClubList->toArray()['CreatedAt'], 'toArray() format toArray() colums of type TIMESTAMP as Y-m-d H:i:s.u'); } /** diff --git a/tests/Propel/Tests/Generator/Builder/Om/GeneratedObjectWithDateImmutableClassTest.php b/tests/Propel/Tests/Generator/Builder/Om/GeneratedObjectWithDateImmutableClassTest.php index 73c1796b78..61b5ed65fe 100644 --- a/tests/Propel/Tests/Generator/Builder/Om/GeneratedObjectWithDateImmutableClassTest.php +++ b/tests/Propel/Tests/Generator/Builder/Om/GeneratedObjectWithDateImmutableClassTest.php @@ -97,10 +97,10 @@ public function testWithDateTimeToArrayWorks() $ModelA = new SomeTableA(); $ModelA->setCreatedAt(clone $Date); - $this->assertSame(['Id' => null, 'CreatedAt' => $Date->format('c')], $ModelA->toArray()); + $this->assertSame(['Id' => null, 'CreatedAt' => $Date->format('Y-m-d H:i:s.u')], $ModelA->toArray()); $ModelB = new SomeTableB(); $ModelB->setCreatedAt(clone $Date); - $this->assertSame(['Id' => null, 'CreatedAt' => $Date->format('c')], $ModelB->toArray()); + $this->assertSame(['Id' => null, 'CreatedAt' => $Date->format('Y-m-d H:i:s.u')], $ModelB->toArray()); } } diff --git a/tests/Propel/Tests/Issues/Issue1420Test.php b/tests/Propel/Tests/Issues/Issue1420Test.php index 4ac71221b5..604577e18b 100644 --- a/tests/Propel/Tests/Issues/Issue1420Test.php +++ b/tests/Propel/Tests/Issues/Issue1420Test.php @@ -19,7 +19,7 @@ */ class Issue1420Test extends TestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); if (!class_exists('\Table1420A')) { @@ -34,7 +34,7 @@ protected function setUp() - + @@ -43,7 +43,7 @@ protected function setUp() - + @@ -54,7 +54,7 @@ protected function setUp() } } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); \Table1420CQuery::create()->deleteAll();