-
Notifications
You must be signed in to change notification settings - Fork 650
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
Include specifics about invalid type references #8842
Labels
Comments
I found these snippets: https://psalm.dev/r/e582824f31<?php
/**
* Elastica query object.
*
* Creates different types of queries
*
* @author Nicolas Ruflin <spam@ruflin.com>
*
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html
* @phpstan-type TCreateQueryArgs = TCreateQueryArgsMatching|AbstractSuggest|Collapse|Suggest
* @phpstan-type TCreateQueryArgsMatching = AbstractQuery|TRawQuery|self|string|null
* @phpstan-type TRawQuery = array{
* _source?: TSourceArgs,
* aggs?: list<AbstractAggregation>,
* collapse?: Collapse,
* docvalue_fields?: TDocValueFields,
* explain?: bool,
* from?: int,
* highlight?: THighlightArgs,
* indices_boost?: array<string, float>,
* min_score?: float,
* pit?: PointInTime,
* post_filter?: AbstractQuery,
* post_filter?: AbstractQuery,
* query?: AbstractQuery|array<string, array<string, mixed>>,
* rescore?: TRescoreArgs,
* script_fields?: ScriptFields,
* size?: int,
* sort?: TSortArgs,
* stored_fields?: TStoredFields,
* suggest?: Suggest,
* track_scores?: bool,
* track_total_hits?: bool|int,
* version?: bool,
* }
* @phpstan-type TSortArgs = list<TSortArg>|TSortArrayArg
* @phpstan-type TSortArg = non-empty-string|TSortArrayArg
* @phpstan-type TSortArrayArg = array<string, string>|array<string, array{
* order?: non-empty-string,
* mode?: non-empty-string,
* numeric_type?: non-empty-string,
* nested?: array{path: non-empty-string, filter?: array<mixed>, max_children?: int, nested?: array<mixed>},
* missing?: non-empty-string,
* unmapped_type?: non-empty-string,
* }>|array{_geo_distance: array<string, mixed>}
* @todo: improve THighlightArgs https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html
* @phpstan-type THighlightArgs = array<mixed>
* @phpstan-type TStoredFields = list<string>
* @todo: improve TDocValueFields https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html#request-body-search-docvalue-fields
* @phpstan-type TDocValueFields = array<mixed>
* @phpstan-type TRescoreArgs = QueryRescore|list<QueryRescore>
* @phpstan-type TSourceArgs = non-empty-string|list<non-empty-string>|array{includes?: list<non-empty-string>, excludes?: list<non-empty-string>}|false
*/
class Query
{
}
abstract class AbstractQuery
{}
abstract class AbstractSuggest
{}
abstract class AbstractAggregation
{}
class Collapse
{}
class Suggest
{}
class ScriptFields
{}
class PointInTime
{}
|
With #8996 it would read:
It won't tell you why it's invalid, though. |
weirdan
added a commit
that referenced
this issue
Dec 23, 2022
Thanks @weirdan! 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's hard to understand WHAT references are actually invalid
https://psalm.dev/r/e582824f31
The text was updated successfully, but these errors were encountered: