top-think / top-think/think-orm

模型查询find后->toArray()无代码提示

Open
#833 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
437
Forks
188
PR merge metrics
No merged PRs in 30d

Description

模型查询find后->toArray()无代码提示,没有识别变量的模型对象类型
新版:
/**
* 查找单条记录.
*
* @param mixed $data 主键数据
* @param ?Closure $closure 闭包数据
*
* @throws Exception
* @throws ModelNotFoundException
* @throws DataNotFoundException
*
* @return mixed|static
*/

3.0版本:
/**
* 查找单条记录.
*
* @param mixed $data 主键数据
* @param ?Closure $closure 闭包数据
*
* @throws Exception
* @throws ModelNotFoundException
* @throws DataNotFoundException
*
* @return static|\think\Model|array|null
*/

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the model query implementation and the find() PHPDoc, then compare its return annotation with the shown newer and 3.0 versions. Reproduce the missing completion with a model query followed by toArray(); done means the intended model type is correctly recognized by the editor without regressing the documented return possibilities.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.