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

add support for PHP 8 #24

Merged
merged 9 commits into from
Aug 16, 2023
Merged

add support for PHP 8 #24

merged 9 commits into from
Aug 16, 2023

Conversation

drealecs
Copy link
Member

@drealecs drealecs commented Jul 27, 2023

The update to PHP 8.* would probably greatly improve performance as JIT is ideal for these kind of long running PHP processes.

tests/Application/Observer/ProgressTest.php Outdated Show resolved Hide resolved
@@ -286,8 +287,12 @@ public function testRun(): void

private function makeLineStream(array $lines)
{
$fp = fopen('data://text/plain;base64,' . base64_encode(implode("\n", $lines)), 'ab+');

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think this code is problematic for the input stream and it works well.
But for the output stream is not working, as data wrapper is not writable.
And maybe that's helpful for the future, as the STDIN input is similar, not writable and we can generate a proper stream that will issue a warning in case app tries to write to input.

I would suggest to:

  • keep the function as it was but rename it to makeInputStream() and keep use it for $inputStream.
  • create a new function makeOutputStream() that just fopen to php://memory and use it for $outputStream.

tests-integration/AfterScriptRunTest.php Outdated Show resolved Hide resolved
benigheorghita
benigheorghita previously approved these changes Aug 16, 2023
composer.json Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you think that we should remove the platform from config (line 19), so we won't have any hard restriction on version number?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we might want to remove that "php": "7.4" platform config.
If we don't run composer as a container (that runs on various php version, usually latest), it's not needed anymore.

But I'm not sure if it bothers us if we keep it at minimum. So I think we don't need to change it now.

tests/Application/Observer/ProgressTest.php Outdated Show resolved Hide resolved
tests-integration/AfterScriptRunTest.php Outdated Show resolved Hide resolved
tests/AnonymizerTest.php Outdated Show resolved Hide resolved
@drealecs drealecs self-assigned this Aug 16, 2023
@drealecs
Copy link
Member Author

Looks good.

@benigheorghita benigheorghita merged commit 3d0eed9 into master Aug 16, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants