Skip to content

Commit c4eaa67

Browse files
committed
Complete docblocks
1 parent 9cb4c1e commit c4eaa67

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

src/Capabilities_Command.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
*/
2424
class Capabilities_Command extends WP_CLI_Command {
2525

26+
/**
27+
* List of available fields.
28+
*
29+
* @var array
30+
*/
2631
private $fields = [ 'name' ];
2732

2833
/**
@@ -199,6 +204,13 @@ public function remove( $args ) {
199204
WP_CLI::success( sprintf( $message, $count, $role ) );
200205
}
201206

207+
/**
208+
* Retrieve a specific role from the system.
209+
*
210+
* @param string $role Role to retrieve.
211+
* @return WP_Role Requested role.
212+
* @throws \WP_CLI\ExitException If the role could not be found.
213+
*/
202214
private static function get_role( $role ) {
203215
global $wp_roles;
204216

@@ -211,6 +223,12 @@ private static function get_role( $role ) {
211223
return $role_obj;
212224
}
213225

226+
/**
227+
* Assert that the roles are persisted to the database.
228+
*
229+
* @throws \WP_CLI\ExitException If the roles are not persisted to the
230+
* database.
231+
*/
214232
private static function persistence_check() {
215233
global $wp_roles;
216234

src/Role_Command.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,18 @@
3939
*/
4040
class Role_Command extends WP_CLI_Command {
4141

42+
/**
43+
* Available fields.
44+
*
45+
* @var array
46+
*/
4247
private $fields = [ 'name', 'role' ];
4348

44-
// Array of default roles.
49+
/**
50+
* Default roles ad provided by WordPress Core.
51+
*
52+
* @var array
53+
*/
4554
private $roles = [ 'administrator', 'editor', 'author', 'contributor', 'subscriber' ];
4655

4756
/**
@@ -377,6 +386,12 @@ public function reset( $args, $assoc_args ) {
377386
}
378387
}
379388

389+
/**
390+
* Assert that the roles are persisted to the database.
391+
*
392+
* @throws \WP_CLI\ExitException If the roles are not persisted to the
393+
* database.
394+
*/
380395
private static function persistence_check() {
381396
global $wp_roles;
382397

0 commit comments

Comments
 (0)