Skip to content

Conversation

@ababkov
Copy link
Contributor

@ababkov ababkov commented Jul 18, 2023

Overview

  • Deprecated PHP 7 support
  • Adds PHP 8+ support
  • Adds github workflows and removes travis

Before merge

After Merge

  • Tag 3.0.0 release
@ababkov ababkov requested a review from BlankaK July 18, 2023 16:12
@ababkov ababkov changed the title feat: Deprecated PHP 7, Add PHP 8+ support, new test workflows Deprecate PHP 7, Add PHP 8+ support, new test workflows Jul 18, 2023
composer.json Outdated
"rexlabs/utility-belt": "^3.0"
"php" : "^8.0",
"rexlabs/utility-belt": "dev-feat/github-tests",
"dms/phpunit-arraysubset-asserts": "^0.5.0"
Copy link

Choose a reason for hiding this comment

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

Should this package be included under require-dev if it's only needed to support the tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

* @throws \Rexlabs\ArrayObject\Exceptions\InvalidOffsetException
*/
public function offsetGet($offset)
public function offsetGet($offset): mixed
Copy link

Choose a reason for hiding this comment

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

I see that we are dropping support for php 7. I think it's because of this change as that's only supported from php 8. I am wondering if that is strictly required here.

Are we looking at just going with php 8 migration for wings without running in parallel with 7.4 like we did with the previous upgrade? I am not against it, just trying to understand that context for this change 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PHP 8 fatals or warns can't recall due to not matching the underlying interface return types.

mixed was only introduced in php 8.

If you remove this the tests pass in php 7 but fail in all versions of php 8.

If you add this, the tests pass in php 8 but fail in all versions of php 7.

You could maybe? do this as a two stage release:

  • Release 1: PHP 7.4 without this change with tests only for 7.4 tag as 4.0.0
  • Release 2: PHP 8 (drop PHP 7.4) with this change with tests only for 8 tag as 4.1.0
Copy link

Choose a reason for hiding this comment

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

I am happy for us to go all in with php 8. Thank you for the explanation 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Going to try for the two stage release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2 stage release not needed - #14 (comment)

@ababkov ababkov force-pushed the feat/php-8 branch 9 times, most recently from e37c9a4 to 1b5afa0 Compare July 19, 2023 12:50
*
* @return mixed
*/
#[\ReturnTypeWillChange]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BlankaK found a way to avoid the php 7/8 issue that's caused by type hints in this case. There's a specific attribute that php 8 introduces to help deal with cross version compatibility issues. https://www.php.net/manual/en/class.returntypewillchange.php

@ababkov ababkov changed the title Deprecate PHP 7, Add PHP 8+ support, new test workflows Add PHP 8+ support, new test workflows Jul 19, 2023
@ababkov ababkov merged commit c666158 into master Jul 19, 2023
@ababkov ababkov deleted the feat/php-8 branch July 19, 2023 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants