diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 0a0f393100..48d3e0f550 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -56,6 +56,7 @@ Yii Framework 2 Change Log - Bug #20595: Fix `@return` annotation for `BaseHtml::getAttributeValue()` (mspirkov) - Bug #20604: Fix `@var` annotation for `yii\db\Command::$pdoStatement` (mspirkov) - Bug #20600: Fix `@var` annotation for `yii\test\FileFixtureTrait::$dataFile` (mspirkov) +- Bug #20608: Fix `@return` annotations for `yii\rest\Serializer` methods (mspirkov) - Bug #20610: Fix `@var` annotation for `ActiveQueryTrait::$with` (mspirkov) - Bug #20611: Fix `@return` annotations for `yii\i18n\GettextMoFile` methods (mspirkov) diff --git a/framework/rest/Serializer.php b/framework/rest/Serializer.php index bc761e340b..3905c14240 100644 --- a/framework/rest/Serializer.php +++ b/framework/rest/Serializer.php @@ -184,7 +184,7 @@ class Serializer extends Component /** * Serializes a data provider. * @param DataProviderInterface $dataProvider - * @return array the array representation of the data provider. + * @return array|null the array representation of the data provider. */ protected function serializeDataProvider($dataProvider) { @@ -256,7 +256,7 @@ class Serializer extends Component /** * Serializes a model object. * @param Arrayable $model - * @return array the array representation of the model + * @return array|null the array representation of the model */ protected function serializeModel($model) {