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

Merge current 1.x release into master #360

Closed
wants to merge 16 commits into from

Conversation

bbrala
Copy link

@bbrala bbrala commented Nov 24, 2020

I've run into a blocker for us in issue #327 and thought I'd just go through the code and create a merge. This merges #345 and #347 so 2.x branch is up-to-date.

Hopefully this will unblock a 2.x release, since Drupal is waiting for this and out package swisnl/json-api-client.

@andypost
Copy link

Great news, thank you! It could use nightly for PHP 8.0 run

@bbrala
Copy link
Author

bbrala commented Nov 24, 2020

Ok, onbly check that fails is the phpstan one. But not sure how much i should change for these errors.

 ------ -----------------------------------------------------------------------------------
  Line   Message.php
 ------ -----------------------------------------------------------------------------------
  148    Variable $headerLines in PHPDoc tag @var does not match assigned variable $count.
 ------ -----------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------
  Line   Utils.php
 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------
  301    Parameter #1 $fp of function fwrite expects resource, resource|false given.
  301    Parameter #2 $str of function fwrite expects string, bool|float|int|string given.
  302    Parameter #1 $fp of function fseek expects resource, resource|false given.
  304    Parameter #1 $stream of class GuzzleHttp\Psr7\Stream constructor expects resource, resource|false given.
  309    Parameter #1 $stream of class GuzzleHttp\Psr7\Stream constructor expects resource, (callable)|Iterator|Psr\Http\Message\StreamInterface|resource|null given.
  322    Parameter #1 $object of function method_exists expects object|string, (callable)|resource|null given.
  327    Parameter #1 $stream of class GuzzleHttp\Psr7\Stream constructor expects resource, resource|false given.
  353    Parameter #1 $callback of function set_error_handler expects (callable(int, string, string, int, array): bool)|null, Closure(): void given.
  370    Method GuzzleHttp\Psr7\Utils::tryFopen() should return resource but returns resource|false.
  396    Unreachable statement - code above always terminates.
 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------

…dle `gettype` very well and some cases were already handled in later in the stack.
@bbrala
Copy link
Author

bbrala commented Nov 24, 2020

There, i've fixed the last phpstan errors, either by some extra checks or adding an ignore to lines where phpstan doesn't completely understand the code.

@bbrala bbrala mentioned this pull request Nov 24, 2020
@GrahamCampbell
Copy link
Member

So, just to confirm, there are no calls to the "functions" now, only to "static class methods", just like in the 1.x series. The next step would be to delete the functions entirely from the 2.x series.

@bbrala
Copy link
Author

bbrala commented Nov 26, 2020 via email

@GrahamCampbell
Copy link
Member

Excellent. 👍

Copy link
Member

@Tobion Tobion left a comment

Choose a reason for hiding this comment

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

this seems to be missing phpunit 9 update from #350

@Tobion Tobion mentioned this pull request Dec 8, 2020
@bbrala
Copy link
Author

bbrala commented Dec 8, 2020

@Tobion valid point, will fix that. Seems there was some feedback also on the PR which was disregarded until 2.0, so that would mean some slight extra changes.

@GrahamCampbell
Copy link
Member

I think it would be fine for that to be sorted in a follow-up PR. It's more important the other changes from 1.x make it into master than the test suite runs on PHPUnit 9. End users don't use the tests, but they do use what's in src. ;)

@bbrala
Copy link
Author

bbrala commented Dec 8, 2020

Seems the tests were already merged, but forgot the change in the composer.json and phpunit.xml.dist. Everything is green. I did go though the feedback that was left on the phpunit PR and everything seems as promised :)

@bbrala bbrala requested a review from Tobion December 8, 2020 18:33
@xjm
Copy link

xjm commented Dec 29, 2020

I believe the changes requested in #360 (review) have been resolved, correct? @Tobion can you confirm that they've been addressed? Thanks!

@bbrala
Copy link
Author

bbrala commented Jan 4, 2021

@Tobion hope you had a nice newyears, any chance you can review this any time soon?

@GrahamCampbell
Copy link
Member

The HHVM specific code in this PR should be deleted. 2.x does not support HHVM, so the HHVM fixes in this PR should be taken out.

Copy link
Member

@GrahamCampbell GrahamCampbell left a comment

Choose a reason for hiding this comment

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

See my comment about removing HHVM.

@bbrala
Copy link
Author

bbrala commented Jan 14, 2021

Sure, i removed the 2 skips for the tests on HHVM.

@bbrala
Copy link
Author

bbrala commented Mar 1, 2021

Would be nice to get this moving again :)

@barryvdh
Copy link
Contributor

barryvdh commented Mar 2, 2021

I've looked at this and at first sight it looks good to me. Hard to compare the functions to the static calls though, but the tests are passing so 👍

@Nyholm
Copy link
Member

Nyholm commented Mar 2, 2021

Thank you Barry.

The more people that review and tests this the more confident will the maintainer be to merge it. Your comment is much appreciated.

tests/MimeTypeTest.php Outdated Show resolved Hide resolved
@GrahamCampbell
Copy link
Member

@Nyholm and I have discussed this PR, and it includes unrelated changes and the merges to the utils classes seem to accidentally remove 2.x changes including return types. For this reason, I am going to start again here, so I can be sure everything is correct. Verifying everything in this PR is correct is as much work as me starting again here.

I appreciate everyone's efforts here, and I hope this doesn't put anyone off future contributions. We just have to make sure the merge is good. :)

@Nyholm
Copy link
Member

Nyholm commented Mar 7, 2021

I’m sure you done the best you possible can for this PR. But I cannot be 100% sure of the correctness. I also don’t know you as a contributors.

This might be an issue with my need for control or trust issues, but if you where a person with poor intentions, this is a exactly the kind of PR one should hide bad code in.

We will make sure a version of this PR is merged in the next few days.

@bbrala
Copy link
Author

bbrala commented Mar 7, 2021 via email

@xjm
Copy link

xjm commented Mar 8, 2021

If there is a new PR, can it be linked? As I understand this was blocking the availability of PSR-17 support in a stable release. Thanks!

@Nyholm
Copy link
Member

Nyholm commented Mar 8, 2021

It is not.

It has been multiple PRs. See the PRs creates in the past few days. Also note that master is already updated with code from 1.x.

@xjm
Copy link

xjm commented Mar 8, 2021

Reference for my comment: #327 (comment)

@xjm
Copy link

xjm commented Mar 8, 2021

I guess my question is, if this is not the way forward to have PSR-17 support in a stable release, then what is? We need some guidance since #327 has been stalled nearly a year and the last advice we were given here was to try to make the above merge happen.

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.

None yet

7 participants