nodespark/des-connector

Potential issue with magic method __sleep visibility

Opened this issue · 2 comments

When running PHPcompatibility phpcs sniff, following error appears:

FILE: vendor/nodespark/des-connector/src/DESConnector/Elasticsearch/Aggregations/Aggregations.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------
 76 | ERROR | Visibility for magic method __sleep must be public. Found: private
----------------------------------------------------------------------------------------------------------------------------------------

It seems that the issue is still present in the current master HEAD. Based on wpengine/phpcompat#83 I believe, that it's probably a false positive. Can you confirm that, please?

According to the PHP documentation, all magic methods must be declared as public:
https://www.php.net/manual/en/language.oop5.magic.php

This is not a false positive.

These warnings are showing up on my staging site right now so it looks like this issue is still open.

The magic method nodespark\DESConnector\Elasticsearch\Aggregations\Aggregations::__wakeup() must have public visibility in /app/vendor/nodespark/des-connector/src/DESConnector/Elasticsearch/Aggregations/Aggregations.php on line 68