Skip to content

Fix: Add scssphp 2.x compatibility while maintaining backward compatibility#717

Merged
glensc merged 3 commits into
mrclay:masterfrom
Medienplanet24:master
Feb 14, 2026
Merged

Fix: Add scssphp 2.x compatibility while maintaining backward compatibility#717
glensc merged 3 commits into
mrclay:masterfrom
Medienplanet24:master

Conversation

@Be-Mann

@Be-Mann Be-Mann commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds compatibility with scssphp 2.x while maintaining backward compatibility with scssphp 1.x.

Problem

The current implementation uses Compiler::getParsedFiles() which was removed in scssphp 2.0. This causes a fatal error when using mrclay/minify with scssphp 2.x:

Fatal error: Call to undefined method ScssPhp\ScssPhp\Compiler::getParsedFiles()
in vendor/mrclay/minify/lib/Minify/ScssCssSource.php

Since scssphp 2.x is required for PHP 8.5 compatibility, this fix is necessary for future PHP versions.

Changes

  • Updated Minify_ScssCssSource::compile() to use CompilationResult::getIncludedFiles() for scssphp 2.x
  • Falls back to Compiler::getParsedFiles() for scssphp 1.x (runtime detection via method_exists())
  • The new scssphp 2.x API returns file paths only, so modification times are now retrieved via filemtime()
  • Updated composer.json to allow scssphp/scssphp: ^1.12|^2.0

Related Issues

Fixes #715

- Use CompilationResult::getIncludedFiles() for scssphp 2.x
- Fall back to Compiler::getParsedFiles() for scssphp 1.x
- Runtime detection via method_exists()

Fixes compatibility with PHP 8.5+ which requires scssphp 2.x
Related: mrclay#715
- Update .semver to 4.0.2
- Add changelog entry for scssphp 2.x compatibility
- Update composer.json to allow scssphp ^1.12|^2.0
@glensc

glensc commented Feb 14, 2026

Copy link
Copy Markdown
Collaborator
  1. you should not bump version in a feature pr
  2. you should not create pull request from master branch
  3. you should keep your commits atomic: https://www.freshconsulting.com/insights/blog/atomic-commits/

so, in this manner, should drop 7157647 commit, but i'm trying to merge and release this with browser only.

@glensc glensc changed the title Add scssphp 2.x compatibility while maintaining backward compatibility Fix: Add scssphp 2.x compatibility while maintaining backward compatibility Feb 14, 2026
Comment thread CHANGELOG.md Outdated
@glensc glensc merged commit 1bc4326 into mrclay:master Feb 14, 2026
4 checks passed
@Be-Mann

Be-Mann commented Feb 16, 2026

Copy link
Copy Markdown
Contributor Author

so, in this manner, should drop 7157647 commit, but i'm trying to merge and release this with browser only.

First of all, thank you for that.

  1. you should not bump version in a feature pr
  2. you should not create pull request from master branch
  3. you should keep your commits atomic: https://www.freshconsulting.com/insights/blog/atomic-commits/

Thank you, I will take this to heart and keep it in mind for the future.

Be-Mann added a commit to Medienplanet24/minify that referenced this pull request Feb 16, 2026
Merge pull request mrclay#717 from Medienplanet24/master
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.

Support scssphp 2.0 – Remove usage of removed getParsedFiles() method

2 participants