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

Install phpstan locally and use extensions #2606

Merged
merged 2 commits into from
Mar 13, 2019

Conversation

teohhanhui
Copy link
Contributor

@teohhanhui teohhanhui commented Mar 12, 2019

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets N/A
License MIT
Doc PR N/A

Replaces #2603

@teohhanhui teohhanhui force-pushed the phpstan-shim-and-extensions branch 5 times, most recently from 1b6f881 to 98cfc26 Compare March 12, 2019 19:36
composer.json Outdated Show resolved Hide resolved

if (!isset($item['data'])) {
throw new InvalidArgumentException('The JSON API document must contain a "data" key.');
throw new UnexpectedValueException('The JSON API document must contain a "data" key.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be a BC break?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd consider it a bug fix, because we're not supposed to throw this type of exception from NormalizerInterface::normalize in the first place.

composer.json Outdated Show resolved Hide resolved
@bendavies
Copy link
Contributor

title says Switch to phpstan-shim but you are not (and i would advise against it)

@teohhanhui
Copy link
Contributor Author

@bendavies What do you mean? It does make the switch to phpstan-shim, which allows us to use extensions. That's very important as otherwise many problems go undetected.

@bendavies
Copy link
Contributor

bendavies commented Mar 13, 2019

@teohhanhui where do you use the shim? i see "phpstan/phpstan": "^0.11.3", in composer.json, not phpstan/phpstan-shim. I use extensions without the shim just fine.

@teohhanhui
Copy link
Contributor Author

@bendavies Oops. You're right. I didn't even realize that, but the intention was to use the shim. 😂😂😂

Yeah, I guess it's not actually necessary to use the shim.

@bendavies
Copy link
Contributor

FYI here is why i'd advise against the shim:
composer/composer#7573

@teohhanhui
Copy link
Contributor Author

@bendavies That looks like a general Composer issue, but yeah, we have no need to use the shim, and could easily switch if / when the need arises.

@bendavies
Copy link
Contributor

yes, it's a composer issue, but one that manifests if you use the shim, which is very annoying :)

@teohhanhui teohhanhui force-pushed the phpstan-shim-and-extensions branch 2 times, most recently from 7bbfa76 to e2874b4 Compare March 13, 2019 13:26
@teohhanhui teohhanhui changed the title Switch to phpstan-shim and use extensions Install phpstan locally and use extensions Mar 13, 2019
teohhanhui and others added 2 commits March 13, 2019 14:30
Co-authored-by: soyuka <soyuka@users.noreply.github.com>
@soyuka soyuka merged commit 770e767 into api-platform:2.4 Mar 13, 2019
@soyuka
Copy link
Member

soyuka commented Mar 13, 2019

Thanks @teohhanhui !

@teohhanhui teohhanhui deleted the phpstan-shim-and-extensions branch March 13, 2019 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants