Updated for coding style

This commit is contained in:
Andrey Savchenko committed 2013-12-05 23:40:42 +02:00
1 parent b7028e1f5a
commit 0ed37d4d92
2 files changed
+26 -17

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
if( file_exists( __DIR__ . '/vendor/autoload.php' ) ) if ( file_exists( __DIR__ . '/vendor/autoload.php' ) )
require __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/vendor/autoload.php';
Rarst\Laps\Laps::on_load(); Rarst\Laps\Laps::on_load();
+25 -16
View File
@@ -90,10 +90,13 @@ class Laps {
$filter = current_filter(); $filter = current_filter();
$priority = key( $wp_filter[$filter] ); $priority = key( $wp_filter[$filter] );
$event = wp_parse_args( self::$events[$filter][$priority], array( $event = wp_parse_args(
'action' => 'start', self::$events[$filter][$priority],
'category' => null, array(
) ); 'action' => 'start',
'category' => null,
)
);
self::$stopwatch->$event['action']( $event['event'], $event['category'] ); self::$stopwatch->$event['action']( $event['event'], $event['category'] );
@@ -183,9 +186,11 @@ class Laps {
global $timestart, $wpdb; global $timestart, $wpdb;
$mustache = new \Mustache_Engine( array( $mustache = new \Mustache_Engine(
'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/views' ), array(
) ); 'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/views' ),
)
);
$events = self::$stopwatch->getSectionEvents( '__root__' ); $events = self::$stopwatch->getSectionEvents( '__root__' );
$start = $timestart * 1000; $start = $timestart * 1000;
@@ -262,15 +267,19 @@ class Laps {
) )
); );
$wp_admin_bar->add_node( array( $wp_admin_bar->add_node(
'id' => 'laps', array(
'title' => sprintf( 'Lap: %ss', round( $total / 1000, 3 ) ), 'id' => 'laps',
) ); 'title' => sprintf( 'Lap: %ss', round( $total / 1000, 3 ) ),
)
);
$wp_admin_bar->add_node( array( $wp_admin_bar->add_node(
'id' => 'laps_output', array(
'parent' => 'laps', 'id' => 'laps_output',
'meta' => array( 'html' => $html ), 'parent' => 'laps',
) ); 'meta' => array( 'html' => $html ),
)
);
} }
} }