Blame view

vendor/yiisoft/multiparser/ParserConfigurator.php 764 Bytes
e4e4ce76   Administrator   update rep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  <?php
  namespace yii\multiparser;
  
  class ParserConfigurator
  {
  
      protected static  $configuration;
  
      public static function getConfiguration($extension, $parameter)
      {
          self::setConfiguration();
  
          if (!isset( self::$configuration[$extension] )){
              throw new \ErrorException( "Parser do not maintain file with extension  {$extension}");
          }
          if (!isset( self::$configuration[$extension][$parameter] )){
              throw new \ErrorException( "Parser configurator do not have settings for {$parameter} parameter");
          }
  
          return self::$configuration[$extension][$parameter];
      }
  
   protected static function setConfiguration()
      {
  
         self::$configuration = require(__DIR__ . '/config.php');
  
      }
  
  
  
  }