Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is 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  }