| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 60 | public function __construct( $type, $file ) { |
||
| 61 | $this->type = new ConfigType( $type ); |
||
| 62 | $this->file = $file; |
||
| 63 | |||
| 64 | switch ( $this->type->getValue() ) { |
||
| 65 | case ConfigType::PLUGIN: |
||
| 66 | case ConfigType::MU_PLUGIN: |
||
| 67 | $this->url = plugin_dir_url( $file ); |
||
| 68 | $this->path = plugin_dir_path( $file ); |
||
| 69 | $this->slug = dirname( $this->basename = plugin_basename( $file ) ); |
||
| 70 | break; |
||
| 71 | case ConfigType::THEME: |
||
| 72 | $this->url = get_stylesheet_directory_uri() . '/'; |
||
| 73 | $this->path = get_stylesheet_directory() . '/'; |
||
| 74 | $this->slug = dirname( $this->basename = plugin_basename( $file ) ); |
||
| 75 | break; |
||
| 76 | } |
||
| 77 | } |
||
| 78 | |||
| 100 |