Do not strip Content-Type header for POST requests to swift
[lhc/web/wiklou.git] / includes / libs / Timing.php
index 00ceda3..57c253d 100644 (file)
@@ -36,21 +36,21 @@ use Psr\Log\NullLogger;
  *   getEntryByName().
  *
  * The in-line documentation incorporates content from the User Timing Specification
- * http://www.w3.org/TR/user-timing/
+ * https://www.w3.org/TR/user-timing/
  * Copyright © 2013 World Wide Web Consortium, (MIT, ERCIM, Keio, Beihang).
- * http://www.w3.org/Consortium/Legal/2015/doc-license
+ * https://www.w3.org/Consortium/Legal/2015/doc-license
  *
  * @since 1.27
  */
 class Timing implements LoggerAwareInterface {
 
        /** @var array[] */
-       private $entries = array();
+       private $entries = [];
 
        /** @var LoggerInterface */
        protected $logger;
 
-       public function __construct( array $params = array() ) {
+       public function __construct( array $params = [] ) {
                $this->clearMarks();
                $this->setLogger( isset( $params['logger'] ) ? $params['logger'] : new NullLogger() );
        }
@@ -73,12 +73,12 @@ class Timing implements LoggerAwareInterface {
         * @return array The mark that has been created.
         */
        public function mark( $markName ) {
-               $this->entries[$markName] = array(
+               $this->entries[$markName] = [
                        'name'      => $markName,
                        'entryType' => 'mark',
                        'startTime' => microtime( true ),
                        'duration'  => 0,
-               );
+               ];
                return $this->entries[$markName];
        }
 
@@ -90,16 +90,16 @@ class Timing implements LoggerAwareInterface {
                if ( $markName !== null ) {
                        unset( $this->entries[$markName] );
                } else {
-                       $this->entries = array(
-                               'requestStart' => array(
+                       $this->entries = [
+                               'requestStart' => [
                                        'name'      => 'requestStart',
                                        'entryType' => 'mark',
                                        'startTime' => isset( $_SERVER['REQUEST_TIME_FLOAT'] )
                                                ? $_SERVER['REQUEST_TIME_FLOAT']
                                                : $_SERVER['REQUEST_TIME'],
                                        'duration'  => 0,
-                               ),
-                       );
+                               ],
+                       ];
                }
        }
 
@@ -142,12 +142,12 @@ class Timing implements LoggerAwareInterface {
                        $endTime = microtime( true );
                }
 
-               $this->entries[$measureName] = array(
+               $this->entries[$measureName] = [
                        'name'      => $measureName,
                        'entryType' => 'measure',
                        'startTime' => $startTime,
                        'duration'  => $endTime - $startTime,
-               );
+               ];
 
                return $this->entries[$measureName];
        }
@@ -176,7 +176,7 @@ class Timing implements LoggerAwareInterface {
         */
        public function getEntriesByType( $entryType ) {
                $this->sortEntries();
-               $entries = array();
+               $entries = [];
                foreach ( $this->entries as $entry ) {
                        if ( $entry['entryType'] === $entryType ) {
                                $entries[] = $entry;