Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]

   1  <?php
   2  
   3  namespace PhpOffice\PhpSpreadsheet\Chart\Renderer;
   4  
   5  /**
   6   * Jpgraph is not oficially maintained in Composer, so the version there
   7   * could be out of date. For that reason, all unit test requiring Jpgraph
   8   * are skipped. So, do not measure code coverage for this class till that
   9   * is fixed.
  10   *
  11   * This implementation uses abandoned package
  12   * https://packagist.org/packages/jpgraph/jpgraph
  13   *
  14   * @codeCoverageIgnore
  15   */
  16  class JpGraph extends JpGraphRendererBase
  17  {
  18      protected static function init(): void
  19      {
  20          static $loaded = false;
  21          if ($loaded) {
  22              return;
  23          }
  24  
  25          // JpGraph is no longer included with distribution, but user may install it.
  26          // So Scrutinizer's complaint that it can't find it is reasonable, but unfixable.
  27          \JpGraph\JpGraph::load();
  28          \JpGraph\JpGraph::module('bar');
  29          \JpGraph\JpGraph::module('contour');
  30          \JpGraph\JpGraph::module('line');
  31          \JpGraph\JpGraph::module('pie');
  32          \JpGraph\JpGraph::module('pie3d');
  33          \JpGraph\JpGraph::module('radar');
  34          \JpGraph\JpGraph::module('regstat');
  35          \JpGraph\JpGraph::module('scatter');
  36          \JpGraph\JpGraph::module('stock');
  37  
  38          $loaded = true;
  39      }
  40  }