Skip to content

Makes serializable closure work with PHP 8.1#810

Closed
mnapoli wants to merge 3 commits intomasterfrom
opis-closure
Closed

Makes serializable closure work with PHP 8.1#810
mnapoli wants to merge 3 commits intomasterfrom
opis-closure

Conversation

@mnapoli
Copy link
Copy Markdown
Member

@mnapoli mnapoli commented Mar 16, 2022

Reopen #793

@hemberger
Copy link
Copy Markdown
Contributor

In my earlier comment about this being a workable solution (#808 (comment)), I forgot about the fundamental issue with the composer dependency requirements.

If there were an equivalent of the commandline --ignore-platform-reqs=laravel/serializable-closure that could be baked into composer.json, that would solve the problem, but I don't think such a thing exists. There is the platform option, which could fake a specific version of PHP for dependency resolution, but that seems like a dangerous hack because it applies to all dependencies (not just laravel/serializable-closure).

Sadly, I'm all out of ideas here.

@hemberger
Copy link
Copy Markdown
Contributor

Maybe we can put laravel/serializable-closure in the suggest field and use it if it's installed?

Something like:

{
    "suggest": {
        "laravel/serializable-closure": "Allows a closure interface that isn't deprecated in PHP 8.1+"
    }
}
if (class_exists('Laravel\SerializableClosure\SerializableClosure')) {
    # use laravel/serializable-closure
} else {
    # use opis/closure
}

@shadowhand
Copy link
Copy Markdown
Contributor

@hemberger I like that solution as a minor release solution.

@mnapoli I understand that you probably don't want to rush a major version, but this seems like a very good time to drop support for unsupported PHP versions.

@mnapoli
Copy link
Copy Markdown
Member Author

mnapoli commented Mar 17, 2022

🤦 I completely forgot about PHP 7.2 and the Composer requirement.

Yeah… I think we'll need to jump to PHP 7.3. We won't need a major release though.

@mnapoli mnapoli closed this Mar 17, 2022
@plasid
Copy link
Copy Markdown

plasid commented Mar 22, 2022

Yep pretty stupid - PHP7 is old news, now need to deal with this problem causing a MC system to fail.

@mnapoli mnapoli deleted the opis-closure branch March 24, 2022 12:28
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 this pull request may close these issues.

5 participants