* 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
*/
public function __construct( array $params = [] ) {
$this->clearMarks();
- $this->setLogger( isset( $params['logger'] ) ? $params['logger'] : new NullLogger() );
+ $this->setLogger( $params['logger'] ?? new NullLogger() );
}
/**
'requestStart' => [
'name' => 'requestStart',
'entryType' => 'mark',
- 'startTime' => isset( $_SERVER['REQUEST_TIME_FLOAT'] )
- ? $_SERVER['REQUEST_TIME_FLOAT']
- : $_SERVER['REQUEST_TIME'],
+ 'startTime' => $_SERVER['REQUEST_TIME_FLOAT'],
'duration' => 0,
],
];
*/
private function sortEntries() {
uasort( $this->entries, function ( $a, $b ) {
- return 10000 * ( $a['startTime'] - $b['startTime'] );
+ return $a['startTime'] <=> $b['startTime'];
} );
}
* @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;
}
}