@@ -73,21 +73,21 @@ discard block |
||
73 | 73 | * @param string $type |
74 | 74 | * @param string $file |
75 | 75 | */ |
76 | - public function __construct( $type, $file ) { |
|
77 | - $this->type = new ConfigType( $type ); |
|
76 | + public function __construct($type, $file) { |
|
77 | + $this->type = new ConfigType($type); |
|
78 | 78 | $this->file = $file; |
79 | 79 | |
80 | - switch ( $this->type->getValue() ) { |
|
80 | + switch ($this->type->getValue()) { |
|
81 | 81 | case ConfigType::PLUGIN: |
82 | 82 | case ConfigType::MU_PLUGIN: |
83 | - $this->url = plugin_dir_url( $file ); |
|
84 | - $this->path = plugin_dir_path( $file ); |
|
85 | - $this->slug = dirname( $this->basename = plugin_basename( $file ) ); |
|
83 | + $this->url = plugin_dir_url($file); |
|
84 | + $this->path = plugin_dir_path($file); |
|
85 | + $this->slug = dirname($this->basename = plugin_basename($file)); |
|
86 | 86 | break; |
87 | 87 | case ConfigType::THEME: |
88 | - $this->url = get_stylesheet_directory_uri() . '/'; |
|
89 | - $this->path = get_stylesheet_directory() . '/'; |
|
90 | - $this->slug = dirname( $this->basename = plugin_basename( $file ) ); |
|
88 | + $this->url = get_stylesheet_directory_uri().'/'; |
|
89 | + $this->path = get_stylesheet_directory().'/'; |
|
90 | + $this->slug = dirname($this->basename = plugin_basename($file)); |
|
91 | 91 | break; |
92 | 92 | } |
93 | 93 | } |
@@ -99,24 +99,24 @@ discard block |
||
99 | 99 | * |
100 | 100 | * @return array|null |
101 | 101 | */ |
102 | - public function get_config_json( $filename ) { |
|
103 | - if ( isset( $this->json[ $filename ] ) ) { |
|
104 | - return $this->json[ $filename ]; |
|
102 | + public function get_config_json($filename) { |
|
103 | + if (isset($this->json[$filename])) { |
|
104 | + return $this->json[$filename]; |
|
105 | 105 | } |
106 | 106 | |
107 | - $path = $this->path . 'config/' . $filename . '.json'; |
|
107 | + $path = $this->path.'config/'.$filename.'.json'; |
|
108 | 108 | |
109 | - if ( ! file_exists( $path ) ) { |
|
109 | + if (!file_exists($path)) { |
|
110 | 110 | return null; |
111 | 111 | } |
112 | 112 | |
113 | - $contents = file_get_contents( $path ); |
|
113 | + $contents = file_get_contents($path); |
|
114 | 114 | |
115 | - if ( false === $contents ) { |
|
115 | + if (false === $contents) { |
|
116 | 116 | return null; |
117 | 117 | } |
118 | 118 | |
119 | - return $this->json[ $filename ] = json_decode( $contents, true ); |
|
119 | + return $this->json[$filename] = json_decode($contents, true); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -126,17 +126,17 @@ discard block |
||
126 | 126 | * |
127 | 127 | * @return array|null |
128 | 128 | */ |
129 | - public function get_config_php( $filename ) { |
|
130 | - if ( isset( $this->php[ $filename ] ) ) { |
|
131 | - return $this->php[ $filename ]; |
|
129 | + public function get_config_php($filename) { |
|
130 | + if (isset($this->php[$filename])) { |
|
131 | + return $this->php[$filename]; |
|
132 | 132 | } |
133 | 133 | |
134 | - $path = $this->path . 'config/' . $filename . '.php'; |
|
134 | + $path = $this->path.'config/'.$filename.'.php'; |
|
135 | 135 | |
136 | - if ( ! file_exists( $path ) ) { |
|
136 | + if (!file_exists($path)) { |
|
137 | 137 | return null; |
138 | 138 | } |
139 | 139 | |
140 | - return $this->php[ $filename ] = require $path; |
|
140 | + return $this->php[$filename] = require $path; |
|
141 | 141 | } |
142 | 142 | } |