kaystrobach / TYPO3.dyncss_less

Dyncss Less Adapter
http://forge.typo3.org/projects/extension-dyncss
5 stars 14 forks source link

Add PHP 7.2 Support for count() #25

Open tobiasgraeber opened 5 years ago

tobiasgraeber commented 5 years ago

Info: Generating css on PHP 7. 2 does not work due warning. Check compiled css on PHP7.2 (doesnt work).

kaystrobach commented 5 years ago

Can you please add the warnings here as logfile? Thanknyou.

tobiasgraeber commented 5 years ago

Problem is this change here in PHP 7.2 i think: https://www.php.net/manual/de/migration72.incompatible.php#migration72.incompatible.warn-on-non-countable-types

Sorry i cannot provide the log at the moment as i wont get back to the machine. Just came here to inform you. It would be the best you check your code / extension on PHP 7.2 regarding this. Should be visible instantly looking in the generated .css urls from source after cleaning caches and reloading frontend on PHP 7.2. with i think. There are multiple occurrences of this in several files.

kaystrobach commented 5 years ago

Thank you.

Mairex commented 5 years ago

Core: Error handler (FE): PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/www/website/typo3conf/ext/dyncss_less/Resources/Private/Php/less.php/Visitor/toCSS.php line 113

from $nodeRuleCnt = count($rulesetNode->rules);

to $nodeRuleCnt = ($rulesetNode->rules === null ? 0 : count($rulesetNode->rules));

I'm not a coder, but I have tried to fix the problem. At the moment it seems to work. ;)

kaystrobach commented 5 years ago

will check if updating the less parser works easily.

kaystrobach commented 5 years ago

still in the pipeline, we are working on automating the release process, incl. updating dependencies for ter

tbal commented 4 years ago

Solution on the problem we are using in production:

-               $nodeRuleCnt = count($rulesetNode->rules);
+               $nodeRuleCnt = is_array($rulesetNode->rules) ? count($rulesetNode->rules) : 0;`