use valid type annotation for Entity::$id#62
Open
paranoiq wants to merge 1 commit intoPetrP:v0.4from
paranoiq:patch-1
Open
use valid type annotation for Entity::$id#62paranoiq wants to merge 1 commit intoPetrP:v0.4from paranoiq:patch-1
paranoiq wants to merge 1 commit intoPetrP:v0.4from
paranoiq:patch-1
Conversation
Owner
|
Validace na typ Takže typ nelze takhle volně zaměnit. Řešit by to šlo tím že by se jednalo o macro: /**
* @property-read int|string $id {id}
*/Které ide vyhazuje "chybu" při použití knihovny s nesprávném typem? Chápal bych kdyby ti to zvyrazňovalo v tvém kódu, ale vyhozovat chyby na "knihovny" je divné. |
Author
|
zneužíváš standartní typovou anotaci k vlastnímu účelu a znemožňuješ tím správnou funkci statické analýzy kódu (to se nemusí týkat jen IDE) "id" není platné jméno datového typu ani pseudo-typu, takže vyvozovat, že jde o chybu IDE je chybné, bez ohledu na to o jaké IDE jde. "id" prostě není typ
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tahle drobnost mě tam neuvěřitelně štve. má to nějaký důvod?
IDE kvůli tomu háže warningy, kdykoliv použiju $e->id jako klíč pole
v projektech to řeším překrytím anotace na vyšší úrovni, ale je to zbytečné. lepší aby to bylo správně hned od počátku