From 0ed37d4d92fb317a68a8d5b08992e72ceca4c2b7 Mon Sep 17 00:00:00 2001 From: Andrey Savchenko Date: Thu, 5 Dec 2013 23:40:42 +0200 Subject: [PATCH] Updated for coding style --- laps.php | 2 +- src/class-laps.php | 41 +++++++++++++++++++++++++---------------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/laps.php b/laps.php index 9ac0274..43cd47f 100644 --- a/laps.php +++ b/laps.php @@ -29,7 +29,7 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR DEALINGS IN THE SOFTWARE. */ -if( file_exists( __DIR__ . '/vendor/autoload.php' ) ) +if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) require __DIR__ . '/vendor/autoload.php'; Rarst\Laps\Laps::on_load(); \ No newline at end of file diff --git a/src/class-laps.php b/src/class-laps.php index 1e142d6..3b90ffd 100644 --- a/src/class-laps.php +++ b/src/class-laps.php @@ -90,10 +90,13 @@ class Laps { $filter = current_filter(); $priority = key( $wp_filter[$filter] ); - $event = wp_parse_args( self::$events[$filter][$priority], array( - 'action' => 'start', - 'category' => null, - ) ); + $event = wp_parse_args( + self::$events[$filter][$priority], + array( + 'action' => 'start', + 'category' => null, + ) + ); self::$stopwatch->$event['action']( $event['event'], $event['category'] ); @@ -183,9 +186,11 @@ class Laps { global $timestart, $wpdb; - $mustache = new \Mustache_Engine( array( - 'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/views' ), - ) ); + $mustache = new \Mustache_Engine( + array( + 'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/views' ), + ) + ); $events = self::$stopwatch->getSectionEvents( '__root__' ); $start = $timestart * 1000; @@ -262,15 +267,19 @@ class Laps { ) ); - $wp_admin_bar->add_node( array( - 'id' => 'laps', - 'title' => sprintf( 'Lap: %ss', round( $total / 1000, 3 ) ), - ) ); + $wp_admin_bar->add_node( + array( + 'id' => 'laps', + 'title' => sprintf( 'Lap: %ss', round( $total / 1000, 3 ) ), + ) + ); - $wp_admin_bar->add_node( array( - 'id' => 'laps_output', - 'parent' => 'laps', - 'meta' => array( 'html' => $html ), - ) ); + $wp_admin_bar->add_node( + array( + 'id' => 'laps_output', + 'parent' => 'laps', + 'meta' => array( 'html' => $html ), + ) + ); } } \ No newline at end of file