File tree Expand file tree Collapse file tree 5 files changed +22
-14
lines changed
Expand file tree Collapse file tree 5 files changed +22
-14
lines changed Original file line number Diff line number Diff line change 5151 </properties >
5252 </rule >
5353
54+ <rule ref =" WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound" >
55+ <exclude-pattern >*/src/WP_CLI/Fetchers/(Comment|Post|Site|User)\.php$</exclude-pattern >
56+ </rule >
57+
5458</ruleset >
Original file line number Diff line number Diff line change @@ -10,17 +10,17 @@ class Comment extends Base {
1010 /**
1111 * @var string $msg Error message to use when invalid data is provided
1212 */
13- protected $ msg = " Could not find the comment with ID %d. " ;
13+ protected $ msg = ' Could not find the comment with ID %d. ' ;
1414
1515 /**
1616 * Get a comment object by ID
17- *
17+ *
1818 * @param int $arg
1919 * @return object|false
2020 */
2121 public function get ( $ arg ) {
2222 $ comment_id = (int ) $ arg ;
23- $ comment = get_comment ( $ comment_id );
23+ $ comment = get_comment ( $ comment_id );
2424
2525 if ( is_null ( $ comment ) ) {
2626 return false ;
Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ class Post extends Base {
1010 /**
1111 * @var string $msg Error message to use when invalid data is provided
1212 */
13- protected $ msg = " Could not find the post with ID %d. " ;
13+ protected $ msg = ' Could not find the post with ID %d. ' ;
1414
1515 /**
1616 * Get a post object by ID
17- *
17+ *
1818 * @param int $arg
1919 * @return WP_Post|false
2020 */
Original file line number Diff line number Diff line change @@ -10,32 +10,36 @@ class Site extends Base {
1010 /**
1111 * @var string $msg Error message to use when invalid data is provided
1212 */
13- protected $ msg = " Could not find the site with ID %d. " ;
13+ protected $ msg = ' Could not find the site with ID %d. ' ;
1414
1515 /**
1616 * Get a site object by ID
17- *
17+ *
1818 * @param int $site_id
1919 * @return object|false
2020 */
2121 public function get ( $ site_id ) {
22- return $ this ->_get_site ( $ site_id );
22+ return $ this ->get_site ( $ site_id );
2323 }
24-
24+
2525 /**
2626 * Get site (blog) data for a given id.
2727 *
2828 * @param int $site_id
2929 * @return bool|array False if no site found with given id, array otherwise
3030 */
31- private function _get_site ( $ site_id ) {
31+ private function get_site ( $ site_id ) {
3232 global $ wpdb ;
3333
3434 // Load site data
35- $ site = $ wpdb ->get_row ( $ wpdb ->prepare (
36- "SELECT * FROM $ wpdb ->blogs WHERE blog_id = %d " , $ site_id ) );
35+ $ site = $ wpdb ->get_row (
36+ $ wpdb ->prepare (
37+ "SELECT * FROM {$ wpdb ->blogs } WHERE blog_id = %d " ,
38+ $ site_id
39+ )
40+ );
3741
38- if ( !empty ( $ site ) ) {
42+ if ( ! empty ( $ site ) ) {
3943 // Only care about domain and path which are set here
4044 return $ site ;
4145 }
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class User extends Base {
1414
1515 /**
1616 * Get a user object by one of its identifying attributes
17- *
17+ *
1818 * @param mixed $id_email_or_login
1919 * @return WP_User|false
2020 */
You can’t perform that action at this time.
0 commit comments