Hello,

PHPCS compatibility reports the following warnings for PHP 7.2:

FILE: .../views_json_query/views_json_query_plugin_query_json.inc
----------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------
 256 | WARNING | Function create_function() is deprecated since PHP 7.2;
     |         | Use an anonymous function instead
     |         | (PHPCompatibility.PHP.DeprecatedFunctions.create_functionDeprecated)
 257 | WARNING | Function create_function() is deprecated since PHP 7.2;
     |         | Use an anonymous function instead
     |         | (PHPCompatibility.PHP.DeprecatedFunctions.create_functionDeprecated)
 258 | WARNING | Function create_function() is deprecated since PHP 7.2;
     |         | Use an anonymous function instead
     |         | (PHPCompatibility.PHP.DeprecatedFunctions.create_functionDeprecated)
 259 | WARNING | Function create_function() is deprecated since PHP 7.2;
     |         | Use an anonymous function instead
     |         | (PHPCompatibility.PHP.DeprecatedFunctions.create_functionDeprecated)
 260 | WARNING | Function create_function() is deprecated since PHP 7.2;
     |         | Use an anonymous function instead
     |         | (PHPCompatibility.PHP.DeprecatedFunctions.create_functionDeprecated)
 261 | WARNING | Function create_function() is deprecated since PHP 7.2;
     |         | Use an anonymous function instead
     |         | (PHPCompatibility.PHP.DeprecatedFunctions.create_functionDeprecated)
 262 | WARNING | Function create_function() is deprecated since PHP 7.2;
     |         | Use an anonymous function instead
     |         | (PHPCompatibility.PHP.DeprecatedFunctions.create_functionDeprecated)
----------------------------------------------------------------------

Patch will follow.

Comments

herved created an issue. See original summary.

herved’s picture

Issue summary: View changes
herved’s picture

Here it is.
This simply uses a switch/case.
I also used drupal_strlen() instead of strlen() as recommended by phpcs.

herved’s picture

Status: Active » Needs review
rajesh kairamkonda’s picture

@herved
Your patch is not working.

patching file views_json_query_plugin_query_json.inc
Hunk #1 FAILED at 67.
Hunk #2 FAILED at 252.
2 out of 2 hunks FAILED -- saving rejects to file views_json_query_plugin_query_json.inc.rej

herved’s picture

Hello,

I'm guessing you are on the 7.x-1.0 release.
I just re-tested it, it does apply cleanly to the latest dev branch (7.x-1-x).

emersonreis.dev’s picture

Attaching patch for the 7.x-1.0 release.