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

Downgrade to php7.4 #14

Merged
merged 5 commits into from Jun 1, 2022
Merged

Conversation

jonassiewertsen
Copy link
Contributor

This PR does downgrade so Shiki does support PHP7.4 on top of PHP8 support.

To make the tests pass, I needed to remove some nice PHP8 syntax.

// Instead of this
$highlightedCode = Shiki::highlight($code, highlightLines: ['1', '2-4']);

// Downgrade to PHP 7.4
$highlightedCode = Shiki::highlight($code, null, null, ['1', '2-4']);

The good thing is, that someone who is using Shiki with PHP 8, can still use the nice PHP 8 syntax. It does only affect those, who wanna use it with PHP7.4.

  • Tests do pass for PHP 7.4
  • Readme has been updated

Motivation

It's a little dependency fun :-)

We are working on a PR to add TipTap 2 for Statamic. Statamic does support PHP 7.4 at the moment.
statamic/cms#6043

To upgrade, Statamic requires tiptap-php
In theory, it does support PHP 7.4

As tiptap does require shiki, shiki does require PHP 8 which does prevent it from beeing usable with PHP 7.4

@riasvdv riasvdv merged commit 34fe614 into spatie:main Jun 1, 2022
@riasvdv
Copy link
Member

riasvdv commented Jun 1, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants