Skip to content

Commit 36475cc

Browse files
committed
Minor corrections: documentation and linting.
1 parent e139137 commit 36475cc

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

classes/ActionScheduler_Versions.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,21 @@ public static function initialize_latest_version() {
110110
}
111111

112112
/**
113-
* Get directory of active source.
113+
* Returns information about the plugin or theme which contains the current active version
114+
* of Action Scheduler.
114115
*
115-
* @return string
116+
* If this cannot be determined, or if Action Scheduler is being loaded via some other
117+
* method, then it will return an empty array. Otherwise, if populated, the array will
118+
* look like the following:
119+
*
120+
* [
121+
* 'type' => 'plugin', # or 'theme'
122+
* 'name' => 'Name',
123+
* ]
124+
*
125+
* @return array
116126
*/
117-
public function active_source() {
127+
public function active_source(): array {
118128
$file = __FILE__;
119129
$dir = __DIR__;
120130
$plugins = get_plugins();
@@ -157,14 +167,20 @@ public function active_source() {
157167

158168
return array(
159169
'type' => 'theme',
170+
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
160171
'name' => $theme->Name,
161172
);
162173
}
163174

164175
return array();
165176
}
166177

167-
public function active_source_path() {
178+
/**
179+
* Returns the directory path for the currently active installation of Action Scheduler.
180+
*
181+
* @return string
182+
*/
183+
public function active_source_path(): string {
168184
return trailingslashit( dirname( __DIR__ ) );
169185
}
170186
}

0 commit comments

Comments
 (0)