Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

完善 Collection IDE 类型推导支持 #34

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

NHZEX
Copy link
Member

@NHZEX NHZEX commented Aug 20, 2024

完善后下面场景都能正确获得IDE类型推导支持

/**
 * @var $a array<\DateTime>
 */
$a = [];

$c = \think\Collection::make($a);

$c->where('a', '1')->sort()[0]->getTimezone()->getLocation();
$c->last()->getTimezone()->getLocation();

$c->all()[0]->getTimezone()->getLocation();
$c->offsetGet(0)->getTimezone()->getLocation();
$c[0]->getTimezone()->getLocation();

image

@NHZEX NHZEX force-pushed the 3.0-ide-optimize branch from 06e1de5 to c05074b Compare August 20, 2024 01:46
@NHZEX NHZEX force-pushed the 3.0-ide-optimize branch from f94219c to 5fc8c32 Compare August 20, 2024 01:57
@yunwuxin yunwuxin merged commit a9b7702 into top-think:3.0 Aug 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants