cloudinary / cloudinary_php

PHP extension for Cloudinary
https://cloudinary.com/documentation/php_integration
MIT License
389 stars 151 forks source link

Support for php 8 #236

Closed SlimGee closed 3 years ago

SlimGee commented 3 years ago

Explain your use case

I am upgrading my projects to php 8 and I'm using this library but most features are deprecated in PHP 8

Describe the problem you’re trying to solve

I understand this is a legacy library is it possible to release a version that only supports php 8 and above for legacy project they can use a previous version this very version. I know this a lot to ask maintaining 2 separate versions.

Do you have a proposed solution?

I think I just said that above

cloudinaraz commented 3 years ago

Hey @SlimGee,

Are you referring to the older v1 of the SDK or the newly released v2? If it's the latter, would you be able to share more details about the errors that you get?

SlimGee commented 3 years ago

This is happening in v2 because of This deprecation optional parameters follows required parameters. What I've seen so far is on Cloudinary\ArrayUtils::implodeFiltered which has this signature

Cloudinary\ArrayUtils::implodeFiltered(
    $glue='', 
    array $pieces, 
    $filterCallback = __NAMESPACE__ . '\ArrayUtils::safeFilterFunc',
    $flag = 0
)

The optional parameter $glue should follow required parameter $pieces and this throws a type error in php 8 whenever this class is used

const-cloudinary commented 3 years ago

@SlimGee , this issue was fixed in version 2.0.0