Skip to content

Commit 9120cf1

Browse files
committed
Fix model column helper Psalm contract
1 parent 2511452 commit 9120cf1

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ release notes.
136136
send-time network behavior.
137137
- Replaced internal references to deprecated Phalcon events interfaces with
138138
their `Phalcon\Contracts\Events` equivalents.
139+
- Relaxed `modelHasColumn()` PHPDoc to match its nullable string contract so
140+
Psalm accepts the controller trait implementation.
139141

140142
## 3.0.3 - 2026-06-10
141143

src/Mvc/Controller/Traits/Interfaces/ModelInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public function loadModel(?string $modelName = null): \Phalcon\Mvc\ModelInterfac
7979
* strategy and cache.
8080
*
8181
* @param string $column Database column or mapped model attribute.
82-
* @param class-string<\Phalcon\Mvc\ModelInterface>|null $modelName Optional
83-
* model override; defaults to the current controller model.
82+
* @param string|null $modelName Optional model override; defaults to the
83+
* current controller model. Non-model strings should return false.
8484
*/
8585
public function modelHasColumn(string $column, ?string $modelName = null): bool;
8686
}

src/Mvc/Controller/Traits/Model.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ public function loadModel(?string $modelName = null): ModelInterface
188188
* runtime failure.
189189
*
190190
* @param string $column Database column name or mapped model attribute name.
191-
* @param class-string<ModelInterface>|null $modelName Optional model class;
192-
* defaults to the current controller model.
191+
* @param string|null $modelName Optional model class; defaults to the
192+
* current controller model. Non-model strings return false.
193193
*
194194
* @return bool True when the model column map contains the raw column or
195195
* mapped attribute name.

0 commit comments

Comments
 (0)