Making WordPress.org


Ignore:
Timestamp:
04/25/2016 03:38:34 PM (8 years ago)
Author:
ocean90
Message:

Translate: Refactor the Custom Routes plugin to use an autoloader.

See #1682.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc
Files:
1 added
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-wp-directory.php

    r2999 r3002  
    11<?php
    22
    3 class WPorg_GP_Route_WP_Directory extends GP_Route {
     3namespace WordPressdotorg\GlotPress\Routes\Routes;
     4
     5use DateInterval;
     6use DatePeriod;
     7use DateTime;
     8use GP_Route;
     9
     10class WP_Directory extends GP_Route {
    411
    512    /**
     
    4653        unset( $translation_editors );
    4754
    48         foreach( $this->get_translation_contributors_by_locale( $project->id ) as $row ) {
     55        foreach ( $this->get_translation_contributors_by_locale( $project->id ) as $row ) {
    4956            if ( ! isset( $contributors_by_locale[ $row->locale ] ) ) {
    5057                $contributors_by_locale[ $row->locale ] = $default_value;
     
    7986
    8087        foreach ( $sub_projects as $sub_project ) {
    81             foreach( $this->get_translation_contributors_by_locale( $sub_project ) as $row ) {
     88            foreach ( $this->get_translation_contributors_by_locale( $sub_project ) as $row ) {
    8289                if ( ! isset( $contributors_by_locale[ $row->locale ] ) ) {
    8390                    $contributors_by_locale[ $row->locale ] = $default_value;
     
    112119     * Generates the chart data for contributors activity.
    113120     *
    114      * @param GP_Project $project_id The project.
     121     * @param \GP_Project $project The project.
    115122     * @return array The data to build a chart via Chartist.js.
    116123     */
     
    126133        $project_ids = array_merge( array( $project->id ), $sub_projects );
    127134        $translation_set_ids = $wpdb->get_col( "
    128             SELECT `id` FROM {$wpdb->gp_translation_sets} WHERE `project_id` IN (" . implode( ',', $project_ids ) . ")
     135            SELECT `id` FROM {$wpdb->gp_translation_sets} WHERE `project_id` IN ( " . implode( ',', $project_ids ) . ")
    129136        " );
    130137
     
    139146
    140147        $days = array();
    141         foreach( $date_range as $date ) {
     148        foreach ( $date_range as $date ) {
    142149            $days[] = $date->format( 'Y-m-d' );
    143150        }
Note: See TracChangeset for help on using the changeset viewer.