Full blown refactor of JpGraph v3.5. Distant cousin of current official package
Given PHP 5.6 reached its long announced end of life, we're dropping support for it (albeit you can still use this library as long as you use release ~3.6).
Setting the minimum PHP version at 7.0 allows to require Symfony Dotenv version 4 instead of being pinned to the long outdated 3.6 version.
Closes #68
When users are running jpgraph in a project which also uses Kint v1.x, polyfilling this class would break things, as reported in #63.
Now, in config.inc.php we check if Kint has property enabled_mode (in which case it's version 2.x) or method enabled in which case it's Kint v1.x. In either case, the debug mode is set accordingly.
As described in #62, the library uses count
without checking if the parameter is an array or a countable object.
In versions of PHP prior to v7.1, this would return 0 for null and 1 for non-arrays/non-countables. From 7.2 onwards, this practice will emit an E_WARNING.
On this release, we've implemented a global safe_count
function, which in turn will call is_countable
(if available, as of PHP 7.3) or a polyfill of it declared if the native function does not exist, then return 0 if the parameter is not countable, or the proper item count otherwise.