From b048c6cf061733188d8b57ace8759db424393170 Mon Sep 17 00:00:00 2001 From: Felix Date: Thu, 14 Aug 2025 16:41:04 +0200 Subject: [PATCH 1/2] Update Record.php fix docs & return types of Doctrine_Record::safe() and Doctrine_Record::trySafe() --- lib/Doctrine/Record.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index 6edaeb31a..30990af99 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -1725,28 +1725,30 @@ public function resetPendingUnlinks() * * this method also saves the related components * - * @param Doctrine_Connection $conn optional connection parameter - * @throws Exception if record is not valid and validation is active + * @param Doctrine_Connection|null $conn optional connection parameter * @return void + * @throws Exception if record is not valid and validation is active */ - public function save(?Doctrine_Connection $conn = null) + public function save(?Doctrine_Connection $conn = null): void { if ($conn === null) { $conn = $this->_table->getConnection(); } $conn->unitOfWork->saveGraph($this); } - + /** * tries to save the object and all its related components. * In contrast to Doctrine_Record::save(), this method does not * throw an exception when validation fails but returns TRUE on * success or FALSE on failure. * - * @param Doctrine_Connection $conn optional connection parameter - * @return TRUE if the record was saved sucessfully without errors, FALSE otherwise. + * @param Doctrine_Connection|null $conn optional connection parameter + * @return bool TRUE if the record was saved successfully without errors, FALSE otherwise. + * @throws Exception */ - public function trySave(?Doctrine_Connection $conn = null) { + public function trySave(?Doctrine_Connection $conn = null): bool + { try { $this->save($conn); return true; From ee1d45af9882bfeaf3bca6c2c598cad2e0938ba6 Mon Sep 17 00:00:00 2001 From: Felix Date: Thu, 14 Aug 2025 16:42:59 +0200 Subject: [PATCH 2/2] Update Record.php fix empty line --- lib/Doctrine/Record.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index 30990af99..9c40ad3cb 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -1736,7 +1736,7 @@ public function save(?Doctrine_Connection $conn = null): void } $conn->unitOfWork->saveGraph($this); } - + /** * tries to save the object and all its related components. * In contrast to Doctrine_Record::save(), this method does not