filebackend: clean up some comments and remove unused FileBackendStoreOpHandle field
[lhc/web/wiklou.git] / includes / libs / Timing.php
index 7b1a914..65a9247 100644 (file)
@@ -52,7 +52,7 @@ class Timing implements LoggerAwareInterface {
 
        public function __construct( array $params = [] ) {
                $this->clearMarks();
-               $this->setLogger( isset( $params['logger'] ) ? $params['logger'] : new NullLogger() );
+               $this->setLogger( $params['logger'] ?? new NullLogger() );
        }
 
        /**
@@ -83,7 +83,7 @@ class Timing implements LoggerAwareInterface {
        }
 
        /**
-        * @param string $markName The name of the mark that should
+        * @param string|null $markName The name of the mark that should
         *  be cleared. If not specified, all marks will be cleared.
         */
        public function clearMarks( $markName = null ) {
@@ -117,7 +117,7 @@ class Timing implements LoggerAwareInterface {
         *
         * @param string $measureName
         * @param string $startMark
-        * @param string $endMark
+        * @param string|null $endMark
         * @return array|bool The measure that has been created, or false if either
         *  the start mark or the end mark do not exist.
         */
@@ -155,7 +155,7 @@ class Timing implements LoggerAwareInterface {
         */
        private function sortEntries() {
                uasort( $this->entries, function ( $a, $b ) {
-                       return 10000 * ( $a['startTime'] - $b['startTime'] );
+                       return $a['startTime'] <=> $b['startTime'];
                } );
        }
 
@@ -188,6 +188,6 @@ class Timing implements LoggerAwareInterface {
         * @return array|null Entry named $name or null if it does not exist.
         */
        public function getEntryByName( $name ) {
-               return isset( $this->entries[$name] ) ? $this->entries[$name] : null;
+               return $this->entries[$name] ?? null;
        }
 }