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

Incompatible with PHP 8.2 #27

Open
yovannygomez opened this issue Aug 29, 2023 · 1 comment · May be fixed by #28
Open

Incompatible with PHP 8.2 #27

yovannygomez opened this issue Aug 29, 2023 · 1 comment · May be fixed by #28

Comments

@yovannygomez
Copy link

yovannygomez commented Aug 29, 2023

Hi,

I work with Drupal, and in my current project I'm updating the PHP version to PHP 8.2.9

After the updated, I'm receiving the next warning

Deprecated: Creation of dynamic property Drupal\flysystem\FlysystemBridge::$context is deprecated

I am checking and flysystem class extends from https://github.com/twistor/flysystem-stream-wrapper/blob/master/src/FlysystemStreamWrapper.php

And in the latter it does not have that property declared. I think it's a good solution to declare it in this class, since many extend from it. Currently I have added a patch in my project about twistor/flysystem-stream-wrapper and I have fixed the warning. But I don't know how to add that patch here in the github project to create a Pull request.

The only thing I have added is:

/**
* Context value.
*/
public $context = null;

I know it might be another idea to add it directly to the flysystem module, but I'm going here to see if you have any idea what's best.

Greetings,

@adam-vessey
Copy link

I've thrown together #28, that I think should address this.

hyrsky added a commit to City-of-Helsinki/drupal-module-helfi-azure-fs that referenced this issue Nov 7, 2023
PHP requires that stream wrapper implementations have public $context
property. This property is missing from drupal/flysystem stream
wrappers. Since PHP 8.2, assigning dynamic properties is deprecated.

See:
 - https://www.php.net/manual/en/class.streamwrapper.php#streamwrapper.props.context
 - https://www.drupal.org/project/flysystem/issues/3387094
 - twistor/flysystem-stream-wrapper#27
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 a pull request may close this issue.

2 participants