wordlift-plugin icon indicating copy to clipboard operation
wordlift-plugin copied to clipboard

Fix deprecation warnings

Open antoscarface opened this issue 4 months ago • 2 comments

The PR aims to solve some deprecation warnings complained by some users. Here the most important ones:

Deprecated: Wordlift\Modules\Common\Symfony\Component\Config\Resource\ComposerResource implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/html/wp-content/plugins/wordlift/modules/common/third-party/vendor/symfony/config/Resource/ComposerResource.php on line 18
  |  
  | Deprecated: Wordlift\Modules\Common\Symfony\Component\Config\Resource\FileResource implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/html/wp-content/plugins/wordlift/modules/common/third-party/vendor/symfony/config/Resource/FileResource.php on line 20
  |  
  | Deprecated: Return type of Wordlift\Content\Wordpress\Wordpress_Content_Id::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/wp-content/plugins/wordlift/classes/content/wordpress/class-wordpress-content-id.php on line 63

The first twos come from an oldest Symfony libraries which needs to be updated, inside modules/common, which requires to have a min PHP req to at least 7.4+ in order to easily upgrade the library without putting checks about PHP version because of it needs different code to load base on server PHP version.

Also, I had to fix the bootstrap of PHP scoper autoload in order to include also the "autoload files" which are not supported by PHP scoper. This to solve some missing "native php functions" included by the polyfill libraries of symfony, which are required from the upgraded version of symfony dependencies.

In the PR are also fixes some other minor warnings.

The large edits in the PR comes from the dependencies update.

I tried to keep the commits speaking in order to go though them and undestand the flow of changes.

antoscarface avatar Oct 14 '24 16:10 antoscarface