File tree Expand file tree Collapse file tree 7 files changed +17
-23
lines changed
tests/_data/console/app/models/files Expand file tree Collapse file tree 7 files changed +17
-23
lines changed Original file line number Diff line number Diff line change 1+ # [ 4.0.6] ( https://github.com/phalcon/cphalcon/releases/tag/v4.0.6 )
2+ ## Fixed
3+ - Fixed model findFirst return type error [ #1478 ] ( https://github.com/phalcon/phalcon-devtools/issues/1478 )
4+
15# [ 4.0.5] ( https://github.com/phalcon/cphalcon/releases/tag/v4.0.5 ) (2021-03-14)
26## Fixed
37- Fixed model creation failure in webtools due to wrong variable mutation [ #1415 ] ( https://github.com/phalcon/phalcon-devtools/issues/1415 )
Original file line number Diff line number Diff line change @@ -265,9 +265,9 @@ public function getModelFindFirst($className)
265265 * Allows to query the first record that match the specified conditions
266266 *
267267 * @param mixed \$parameters
268- * @return %s|\Phalcon\Mvc\Model\ResultInterface
268+ * @return %s|\Phalcon\Mvc\Model\ResultInterface|\Phalcon\Mvc\ModelInterface|null
269269 */
270- public static function findFirst( \$parameters = null)
270+ public static function findFirst( \$parameters = null): ?\Phalcon\Mvc\ModelInterface
271271 {
272272 return parent::findFirst( \$parameters);
273273 }
Original file line number Diff line number Diff line change @@ -57,9 +57,9 @@ public static function find($parameters = null): \Phalcon\Mvc\Model\ResultsetInt
5757 * Allows to query the first record that match the specified conditions
5858 *
5959 * @param mixed $parameters
60- * @return TestModel|\Phalcon\Mvc\Model\ResultInterface
60+ * @return TestModel|\Phalcon\Mvc\Model\ResultInterface|\Phalcon\Mvc\ModelInterface|null
6161 */
62- public static function findFirst ($ parameters = null )
62+ public static function findFirst ($ parameters = null ): ? \ Phalcon \ Mvc \ ModelInterface
6363 {
6464 return parent ::findFirst ($ parameters );
6565 }
Original file line number Diff line number Diff line change @@ -43,9 +43,9 @@ public static function find($parameters = null): \Phalcon\Mvc\Model\ResultsetInt
4343 * Allows to query the first record that match the specified conditions
4444 *
4545 * @param mixed $parameters
46- * @return TestModel2|\Phalcon\Mvc\Model\ResultInterface
46+ * @return TestModel2|\Phalcon\Mvc\Model\ResultInterface|\Phalcon\Mvc\ModelInterface|null
4747 */
48- public static function findFirst ($ parameters = null )
48+ public static function findFirst ($ parameters = null ): ? \ Phalcon \ Mvc \ ModelInterface
4949 {
5050 return parent ::findFirst ($ parameters );
5151 }
Original file line number Diff line number Diff line change @@ -43,9 +43,9 @@ public static function find($parameters = null): \Phalcon\Mvc\Model\ResultsetInt
4343 * Allows to query the first record that match the specified conditions
4444 *
4545 * @param mixed $parameters
46- * @return TestModel3|\Phalcon\Mvc\Model\ResultInterface
46+ * @return TestModel3|\Phalcon\Mvc\Model\ResultInterface|\Phalcon\Mvc\ModelInterface|null
4747 */
48- public static function findFirst ($ parameters = null )
48+ public static function findFirst ($ parameters = null ): ? \ Phalcon \ Mvc \ ModelInterface
4949 {
5050 return parent ::findFirst ($ parameters );
5151 }
Original file line number Diff line number Diff line change @@ -27,23 +27,13 @@ public function initialize()
2727 $ this ->setSource ("TestModel5 " );
2828 }
2929
30- /**
31- * Returns table name mapped in the model.
32- *
33- * @return string
34- */
35- public function getSource ()
36- {
37- return 'TestModel5 ' ;
38- }
39-
4030 /**
4131 * Allows to query a set of records that match the specified conditions
4232 *
4333 * @param mixed $parameters
4434 * @return TestModel5[]|TestModel5|\Phalcon\Mvc\Model\ResultSetInterface
4535 */
46- public static function find ($ parameters = null )
36+ public static function find ($ parameters = null ): \ Phalcon \ Mvc \ Model \ ResultsetInterface
4737 {
4838 return parent ::find ($ parameters );
4939 }
@@ -52,9 +42,9 @@ public static function find($parameters = null)
5242 * Allows to query the first record that match the specified conditions
5343 *
5444 * @param mixed $parameters
55- * @return TestModel5|\Phalcon\Mvc\Model\ResultInterface
45+ * @return TestModel5|\Phalcon\Mvc\Model\ResultInterface|\Phalcon\Mvc\ModelInterface|null
5646 */
57- public static function findFirst ($ parameters = null )
47+ public static function findFirst ($ parameters = null ): ? \ Phalcon \ Mvc \ ModelInterface
5848 {
5949 return parent ::findFirst ($ parameters );
6050 }
Original file line number Diff line number Diff line change @@ -43,9 +43,9 @@ public static function find($parameters = null): \Phalcon\Mvc\Model\ResultsetInt
4343 * Allows to query the first record that match the specified conditions
4444 *
4545 * @param mixed $parameters
46- * @return Testmodel4|\Phalcon\Mvc\Model\ResultInterface
46+ * @return Testmodel4|\Phalcon\Mvc\Model\ResultInterface|\Phalcon\Mvc\ModelInterface|null
4747 */
48- public static function findFirst ($ parameters = null )
48+ public static function findFirst ($ parameters = null ): ? \ Phalcon \ Mvc \ ModelInterface
4949 {
5050 return parent ::findFirst ($ parameters );
5151 }
You can’t perform that action at this time.
0 commit comments