Making WordPress.org


Ignore:
Timestamp:
02/25/2016 10:49:24 PM (9 years ago)
Author:
obenland
Message:

Plugins Directory: Formatting update.

  • Updates phpdocs throughout the plugin.
  • Breaks out classes into their own files.
  • Some minor namespace-related tweaks.

See #1584.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-tools.php

    r2611 r2621  
    55 * Various functions used by other processes, will make sense to move to specific classes.
    66 *
    7  * @package WordPressdotorg_Plugin_Directory
     7 * @package WordPressdotorg\Plugin_Directory
    88 */
    99class Tools {
     
    5454
    5555        $tonesque = new \Tonesque( $file_location );
     56
    5657        return $tonesque->color();
    5758    }
     
    7273     * Grant a user RW access to a plugin.
    7374     *
    74      * @param string         $plugin_slug The plugin slug.
    75      * @param string|WP_User $user        The user to grant access to.
     75     * @param string          $plugin_slug The plugin slug.
     76     * @param string|\WP_User $user        The user to grant access to.
     77     * @return bool
    7678     */
    7779    public static function grant_plugin_committer( $plugin_slug, $user ) {
    7880        global $wpdb;
     81
    7982        if ( ! $user instanceof \WP_User ) {
    8083            $user = new \WP_User( $user );
     
    9194        }
    9295
    93         return (bool)$wpdb->insert(
     96        return (bool) $wpdb->insert(
    9497            PLUGINS_TABLE_PREFIX . 'svn_access',
    9598            array(
     
    104107     * Revoke a users RW access to a plugin.
    105108     *
    106      * @param string         $plugin_slug The plugin slug.
    107      * @param string|WP_User $user        The user to revoke access of.
     109     * @param string          $plugin_slug The plugin slug.
     110     * @param string|\WP_User $user        The user to revoke access of.
     111     * @return bool
    108112     */
    109113    public static function revoke_plugin_committer( $plugin_slug, $user ) {
    110114        global $wpdb;
     115
    111116        if ( ! $user instanceof \WP_User ) {
    112117            $user = new \WP_User( $user );
     
    120125            PLUGINS_TABLE_PREFIX . 'svn_access',
    121126            array(
    122                 'path'   => "/{$plugin_slug}",
    123                 'user'   => $user->user_login
     127                'path' => "/{$plugin_slug}",
     128                'user' => $user->user_login,
    124129            )
    125130        );
    126131    }
    127 
    128 
    129132}
Note: See TracChangeset for help on using the changeset viewer.