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

Invalid Namespace definition #2876

Open
microwin7 opened this issue May 4, 2024 · 0 comments
Open

Invalid Namespace definition #2876

microwin7 opened this issue May 4, 2024 · 0 comments

Comments

@microwin7
Copy link

Describe the bug
A clear and concise description of what the bug is.
I changed the receiving method on my computer so that it would accept not the name from the Enum, but the Enum itself. I saw an error. Now I have launched the code in a clean workspace, which is displayed on GitHub, and when I hover over it, I again see the wrong Enum type. In fact, this Enum cannot exist at all in this namespace.
My dev:

Expected type 'Microwin7\PHPUtils\Contracts\Texture\Enum\ResponseTypeEnum'. Found 'null|Microwin7\TextureProvider\Commands\ResponseTypeEnum::SKIN|Microwin7\TextureProvider\Commands\ResponseTypeEnum::CAPE'.intelephense(P1006)

Code from GitHub:

Microwin7\TextureProvider\Commands\MigrationToHash::$selectedMode

<?php
protected ?ResponseTypeEnum $selectedMode;
@var null|\Microwin7\TextureProvider\Commands\ResponseTypeEnum::SKIN|\Microwin7\TextureProvider\Commands\ResponseTypeEnum::CAPE

To Reproduce
A code snippet (NOT a screenshot of a code snippet) or steps to reproduce the issue
This problem ->

$this->selectedMode
Texture::validateHDSize($w, $h, $this->selectedMode->name);

in
https://github.com/microwin7/GravitLauncher-TextureProvider/blob/44288d0edfb888a0722a5b456a78d8dd5933c7da/src/Commands/MigrationToHash.php#L119

Texture::validateSize($w, $h, $this->selectedMode->name);

in
https://github.com/microwin7/GravitLauncher-TextureProvider/blob/44288d0edfb888a0722a5b456a78d8dd5933c7da/src/Commands/MigrationToHash.php#L122

ProviderTexture::insertOrUpdateAssetDB((string)$user_id, $this->selectedMode->name, $dataHash, $meta_texture);

in
https://github.com/microwin7/GravitLauncher-TextureProvider/blob/44288d0edfb888a0722a5b456a78d8dd5933c7da/src/Commands/MigrationToHash.php#L140

Expected behavior
A clear and concise description of what you expected to happen.

Microwin7\TextureProvider\Commands\MigrationToHash::$selectedMode

<?php
protected ?ResponseTypeEnum $selectedMode;
@var \Microwin7\PHPUtils\Contracts\Texture\Enum\ResponseTypeEnum::SKIN|\Microwin7\PHPUtils\Contracts\Texture\Enum\ResponseTypeEnum::CAPE

Here, after checking, I indicated that there cannot already be null, which is declared in a class field:
https://github.com/microwin7/GravitLauncher-TextureProvider/blob/44288d0edfb888a0722a5b456a78d8dd5933c7da/src/Commands/MigrationToHash.php#L53

Screenshots
If applicable, add screenshots to help explain your problem.

Code from GitHub (Clear):

Methods:

https://github.com/microwin7/PHP-Utils/blob/8320b9f686560dfaaddf9a6064b29c6b183c4b90/src/Utils/Texture.php#L83
https://github.com/microwin7/PHP-Utils/blob/8320b9f686560dfaaddf9a6064b29c6b183c4b90/src/Utils/Texture.php#L101

Screenshots:

image

Code from DEV (method changed string -> Enum)

Methods:

https://github.com/microwin7/PHP-Utils/blob/50029a7778edea357c9512a6e98303e66dbb44a0/src/Utils/Texture.php#L57
https://github.com/microwin7/PHP-Utils/blob/50029a7778edea357c9512a6e98303e66dbb44a0/src/Utils/Texture.php#L68

Screenshots:

image

Platform and version
OS and Intelephense version.
Windows 10
PHP Intelephense
v1.10.4
Ben Mewburn
intelephense.com

  • Connect to SSH Server VS Code (GitHub clear code)
  • Connect to WSL (DEV)

P.S.
Due to the fact that the method previously accepted string, I did not notice the error, it was not displayed, and I did not point to find out what type was being defined there. And yes, I did Index Workspace to reset the index, because sometimes before there were errors if I changed the code, so it is not the case that the Index was broken

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

No branches or pull requests

1 participant