Conditions | 4 |
Paths | 4 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 4.407 |
Changes | 0 |
1 | <?php |
||
69 | 27 | public function __construct( $type, $file ) { |
|
70 | 27 | $this->type = new ConfigType( $type ); |
|
71 | 27 | $this->file = $file; |
|
72 | |||
73 | 27 | switch ( $this->type->getValue() ) { |
|
74 | 27 | case ConfigType::PLUGIN: |
|
75 | 18 | case ConfigType::MU_PLUGIN: |
|
76 | 27 | $this->url = plugin_dir_url( $file ); |
|
77 | 27 | $this->path = plugin_dir_path( $file ); |
|
78 | 27 | $this->slug = dirname( $this->basename = plugin_basename( $file ) ); |
|
79 | 27 | break; |
|
80 | case ConfigType::THEME: |
||
81 | $this->url = get_stylesheet_directory_uri() . '/'; |
||
82 | $this->path = get_stylesheet_directory() . '/'; |
||
83 | $this->slug = dirname( $this->basename = plugin_basename( $file ) ); |
||
84 | break; |
||
85 | 18 | } |
|
86 | 27 | } |
|
87 | |||
115 |