Skip to content

PHP 7.x compatibility - #82

Merged
MightyMCoder merged 5 commits into
MightyMCoder:masterfrom
Rvice:master
May 21, 2025
Merged

PHP 7.x compatibility#82
MightyMCoder merged 5 commits into
MightyMCoder:masterfrom
Rvice:master

Conversation

@Rvice

@RviceRvice commented May 21, 2025

Copy link
Copy Markdown
Contributor

Fixes#81
Also added translation for default category, unfortunately, I don't understand German.

Rvice added 2 commits May 21, 2025 17:59
match() is only available in PHP 8
@MightyMCoderMightyMCoder added the bug Something isn't working label May 21, 2025
@MightyMCoderMightyMCoder added this to the Release 1.2.0 milestone May 21, 2025

@MightyMCoderMightyMCoder left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solution will work fine but please use this instead:

$contentTypes = array(
'csv' => 'text/csv; charset=' . $charset,
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
);
$writerClasses = array(
'csv' => Csv::class,
'xlsx' => Xlsx::class,
'ods' => Ods::class,
);
if (!isset($contentTypes[$getMode], $writerClasses[$getMode])) {
thrownewInvalidArgumentException('Invalid mode');
}
$contentType = $contentTypes[$getMode];
$writerClass = $writerClasses[$getMode];

@Rvice

Copy link
Copy Markdown
ContributorAuthor

Changed and also added a translation for the default category

@MightyMCoder
MightyMCoder self-requested a review May 21, 2025 22:44

@MightyMCoderMightyMCoder left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the implementation!

@MightyMCoder
MightyMCoder merged commit cef1c2a into MightyMCoder:masterMay 21, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.1.3 -> 1.1.4 throws 500 error - PHP 7.4.10 not supported for match()

2 participants

@Rvice@MightyMCoder