Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
   1  <?php
   2  
   3  namespace Box\Spout\Common\Creator;
   4  
   5  use Box\Spout\Common\Helper\EncodingHelper;
   6  use Box\Spout\Common\Helper\FileSystemHelper;
   7  use Box\Spout\Common\Helper\GlobalFunctionsHelper;
   8  use Box\Spout\Common\Helper\StringHelper;
   9  
  10  /**
  11   * Class HelperFactory
  12   * Factory to create helpers
  13   */
  14  class HelperFactory
  15  {
  16      /**
  17       * @return GlobalFunctionsHelper
  18       */
  19      public function createGlobalFunctionsHelper()
  20      {
  21          return new GlobalFunctionsHelper();
  22      }
  23  
  24      /**
  25       * @param string $baseFolderPath The path of the base folder where all the I/O can occur
  26       * @return FileSystemHelper
  27       */
  28      public function createFileSystemHelper($baseFolderPath)
  29      {
  30          return new FileSystemHelper($baseFolderPath);
  31      }
  32  
  33      /**
  34       * @param GlobalFunctionsHelper $globalFunctionsHelper
  35       * @return EncodingHelper
  36       */
  37      public function createEncodingHelper(GlobalFunctionsHelper $globalFunctionsHelper)
  38      {
  39          return new EncodingHelper($globalFunctionsHelper);
  40      }
  41  
  42      /**
  43       * @return StringHelper
  44       */
  45      public function createStringHelper()
  46      {
  47          return new StringHelper();
  48      }
  49  }