File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -203,11 +203,11 @@ protected function add_listeners(): void {
203
203
* @return string
204
204
*/
205
205
protected function get_slug (): string {
206
- if ( empty ( $ this ->args [ ' file ' ] ) ) {
206
+ if ( empty ( $ this ->file ) ) {
207
207
return '' ;
208
208
}
209
209
210
- return basename ( dirname ( $ this ->args [ ' file ' ] ) );
210
+ return basename ( dirname ( $ this ->file ) );
211
211
}
212
212
213
213
/**
@@ -217,11 +217,11 @@ protected function get_slug(): string {
217
217
* @return string
218
218
*/
219
219
protected function get_name (): string {
220
- if ( empty ( $ this ->args [ ' file ' ] ) ) {
220
+ if ( empty ( $ this ->file ) ) {
221
221
return '' ;
222
222
}
223
223
224
- return plugin_basename ( $ this ->args [ ' file ' ] );
224
+ return plugin_basename ( $ this ->file );
225
225
}
226
226
227
227
/**
Original file line number Diff line number Diff line change @@ -33,6 +33,13 @@ abstract class Updater {
33
33
*/
34
34
protected $ args = array ();
35
35
36
+ /**
37
+ * The file for the updater.
38
+ *
39
+ * @var string
40
+ */
41
+ protected $ file = '' ;
42
+
36
43
/**
37
44
* The class constructor.
38
45
*
@@ -42,6 +49,7 @@ abstract class Updater {
42
49
*/
43
50
public function __construct ( $ api_url , $ args = array () ) {
44
51
$ this ->api_url = $ api_url ;
52
+ $ this ->file = $ args ['file ' ];
45
53
$ defaults = $ this ->get_api_request_defaults ();
46
54
$ this ->args = array_merge ( $ defaults , array_intersect_key ( $ args , $ defaults ) );
47
55
$ this ->add_listeners ();
You can’t perform that action at this time.
0 commit comments