Skip to content

Commit

Permalink
Few more changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dev4press committed Jan 6, 2021
1 parent c91c510 commit 55ef3d0
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 51 deletions.
80 changes: 40 additions & 40 deletions core/display/SQLFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,9 @@ class SQLFormat {
/**
* Get stats about the token cache
*
* @return Array An array containing the keys 'hits', 'misses', 'entries', and 'size' in bytes
* @return array An array containing the keys 'hits', 'misses', 'entries', and 'size' in bytes
*/
public static function getCacheStats() {
public static function getCacheStats() : array {
return array(
'hits' => self::$cache_hits,
'misses' => self::$cache_misses,
Expand Down Expand Up @@ -783,10 +783,10 @@ protected static function init() {
* Return the next token and token type in a SQL string.
* Quoted strings, comments, reserved words, whitespace, and punctuation are all their own tokens.
*
* @param String $string The SQL string
* @param string $string The SQL string
* @param array $previous The result of the previous getNextToken() call
*
* @return Array An associative array containing the type and value of the token.
* @return array An associative array containing the type and value of the token.
*/
protected static function getNextToken( $string, $previous = null ) {
// Whitespace
Expand Down Expand Up @@ -931,9 +931,9 @@ protected static function getQuotedString( $string ) {
* Takes a SQL string and breaks it into tokens.
* Each token is an associative array with type and value.
*
* @param String $string The SQL string
* @param string $string The SQL string
*
* @return Array An array of tokens.
* @return array An array of tokens.
*/
protected static function tokenize( $string ) {
self::init();
Expand Down Expand Up @@ -1002,10 +1002,10 @@ protected static function tokenize( $string ) {
/**
* Format the whitespace in a SQL string to make it easier to read.
*
* @param String $string The SQL string
* @param string $string The SQL string
* @param boolean $highlight If true, syntax highlighting will also be performed
*
* @return String The SQL string with HTML styles and formatting wrapped in a <pre> tag
* @return string The SQL string with HTML styles and formatting wrapped in a <pre> tag
*/
public static function format( $string, $highlight = true ) {
// This variable will be populated with formatted html
Expand Down Expand Up @@ -1291,9 +1291,9 @@ public static function format( $string, $highlight = true ) {
/**
* Add syntax highlighting to a SQL string
*
* @param String $string The SQL string
* @param string $string The SQL string
*
* @return String The SQL string with HTML styles applied
* @return string The SQL string with HTML styles applied
*/
public static function highlight( $string ) {
$tokens = self::tokenize( $string );
Expand All @@ -1311,9 +1311,9 @@ public static function highlight( $string ) {
* Split a SQL string into multiple queries.
* Uses ";" as a query delimiter.
*
* @param String $string The SQL string
* @param string $string The SQL string
*
* @return Array An array of individual query strings without trailing semicolons
* @return array An array of individual query strings without trailing semicolons
*/
public static function splitQuery( $string ) {
$queries = array();
Expand Down Expand Up @@ -1351,9 +1351,9 @@ public static function splitQuery( $string ) {
/**
* Remove all comments from a SQL string
*
* @param String $string The SQL string
* @param string $string The SQL string
*
* @return String The SQL string without comments
* @return string The SQL string without comments
*/
public static function removeComments( $string ) {
$result = '';
Expand All @@ -1376,9 +1376,9 @@ public static function removeComments( $string ) {
/**
* Compress a query by collapsing white space and removing comments
*
* @param String $string The SQL string
* @param string $string The SQL string
*
* @return String The SQL string without comments
* @return string The SQL string without comments
*/
public static function compress( $string ) {
$result = '';
Expand Down Expand Up @@ -1417,9 +1417,9 @@ public static function compress( $string ) {
/**
* Highlights a token depending on its type.
*
* @param Array $token An associative array containing type and value.
* @param array $token An associative array containing type and value.
*
* @return String HTML code of the highlighted token.
* @return string HTML code of the highlighted token.
*/
protected static function highlightToken( $token ) {
$type = $token[ self::TOKEN_TYPE ];
Expand Down Expand Up @@ -1462,9 +1462,9 @@ protected static function highlightToken( $token ) {
/**
* Highlights a quoted string
*
* @param String $value The token's value
* @param string $value The token's value
*
* @return String HTML code of the highlighted token.
* @return string HTML code of the highlighted token.
*/
protected static function highlightQuote( $value ) {
if ( self::is_cli() ) {
Expand All @@ -1477,9 +1477,9 @@ protected static function highlightQuote( $value ) {
/**
* Highlights a backtick quoted string
*
* @param String $value The token's value
* @param string $value The token's value
*
* @return String HTML code of the highlighted token.
* @return string HTML code of the highlighted token.
*/
protected static function highlightBacktickQuote( $value ) {
if ( self::is_cli() ) {
Expand All @@ -1492,9 +1492,9 @@ protected static function highlightBacktickQuote( $value ) {
/**
* Highlights a reserved word
*
* @param String $value The token's value
* @param string $value The token's value
*
* @return String HTML code of the highlighted token.
* @return string HTML code of the highlighted token.
*/
protected static function highlightReservedWord( $value ) {
if ( self::is_cli() ) {
Expand All @@ -1507,9 +1507,9 @@ protected static function highlightReservedWord( $value ) {
/**
* Highlights a boundary token
*
* @param String $value The token's value
* @param string $value The token's value
*
* @return String HTML code of the highlighted token.
* @return string HTML code of the highlighted token.
*/
protected static function highlightBoundary( $value ) {
if ( $value === '(' || $value === ')' ) {
Expand All @@ -1526,9 +1526,9 @@ protected static function highlightBoundary( $value ) {
/**
* Highlights a number
*
* @param String $value The token's value
* @param string $value The token's value
*
* @return String HTML code of the highlighted token.
* @return string HTML code of the highlighted token.
*/
protected static function highlightNumber( $value ) {
if ( self::is_cli() ) {
Expand All @@ -1541,9 +1541,9 @@ protected static function highlightNumber( $value ) {
/**
* Highlights an error
*
* @param String $value The token's value
* @param string $value The token's value
*
* @return String HTML code of the highlighted token.
* @return string HTML code of the highlighted token.
*/
protected static function highlightError( $value ) {
if ( self::is_cli() ) {
Expand All @@ -1556,9 +1556,9 @@ protected static function highlightError( $value ) {
/**
* Highlights a comment
*
* @param String $value The token's value
* @param string $value The token's value
*
* @return String HTML code of the highlighted token.
* @return string HTML code of the highlighted token.
*/
protected static function highlightComment( $value ) {
if ( self::is_cli() ) {
Expand All @@ -1571,9 +1571,9 @@ protected static function highlightComment( $value ) {
/**
* Highlights a word token
*
* @param String $value The token's value
* @param string $value The token's value
*
* @return String HTML code of the highlighted token.
* @return string HTML code of the highlighted token.
*/
protected static function highlightWord( $value ) {
if ( self::is_cli() ) {
Expand All @@ -1586,9 +1586,9 @@ protected static function highlightWord( $value ) {
/**
* Highlights a variable token
*
* @param String $value The token's value
* @param string $value The token's value
*
* @return String HTML code of the highlighted token.
* @return string HTML code of the highlighted token.
*/
protected static function highlightVariable( $value ) {
if ( self::is_cli() ) {
Expand All @@ -1601,9 +1601,9 @@ protected static function highlightVariable( $value ) {
/**
* Helper function for building regular expressions for reserved words and boundary characters
*
* @param String $a The string to be quoted
* @param string $a The string to be quoted
*
* @return String The quoted string
* @return string The quoted string
*/
private static function quote_regex( $a ) {
return preg_quote( $a, '/' );
Expand All @@ -1612,9 +1612,9 @@ private static function quote_regex( $a ) {
/**
* Helper function for building string output
*
* @param String $string The string to be quoted
* @param string $string The string to be quoted
*
* @return String The quoted string
* @return string The quoted string
*/
private static function output( $string ) {
if ( self::is_cli() ) {
Expand Down
8 changes: 4 additions & 4 deletions core/main/Panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function add_column( $name, $class = '', $style = '', $reset = false ) {

public function table_init_standard() {
$this->add_column( __( "Name", "debugpress" ), '', '', true );
$this->add_column( __( "Value", "debugpress" ), '', '' );
$this->add_column( __( "Value", "debugpress" ) );
}

public function table_init_right() {
Expand Down Expand Up @@ -126,7 +126,7 @@ public function table_row( $data ) {
}

public function list_defines( $defines, $subtitle = '' ) {
$this->block_header( true );
$this->block_header();

if ( $subtitle != '' ) {
$this->sub_title( $subtitle );
Expand All @@ -144,7 +144,7 @@ public function list_defines( $defines, $subtitle = '' ) {
}

public function list_array( $data, $subtitle = '' ) {
$this->block_header( true );
$this->block_header();

if ( $subtitle != '' ) {
$this->sub_title( $subtitle );
Expand All @@ -164,7 +164,7 @@ public function list_array( $data, $subtitle = '' ) {
}

public function list_properties( $object, $properties = array(), $subtitle = '' ) {
$this->block_header( true );
$this->block_header();

if ( $subtitle != '' ) {
$this->sub_title( $subtitle );
Expand Down
6 changes: 3 additions & 3 deletions core/panel/HTTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public function single() {
$this->title( __( "Logged HTTP API Requests", "debugpress" ), true );
$this->block_header( true );
$this->add_column( __( "URL", "debugpress" ), "", "", true );
$this->add_column( __( "Request", "debugpress" ), "", "" );
$this->add_column( __( "Response", "debugpress" ), "", "" );
$this->add_column( __( "Time", "debugpress" ), "", "" );
$this->add_column( __( "Request", "debugpress" ) );
$this->add_column( __( "Response", "debugpress" ) );
$this->add_column( __( "Time", "debugpress" ) );
$this->table_head();
foreach ( debugpress_tracker()->httpapi as $request ) {
$this->render_request( $request );
Expand Down
6 changes: 3 additions & 3 deletions core/panel/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public function single() {
$this->title( __( "Stored objects and other data", "debugpress" ), true );
$this->block_header( true );
$this->add_column( __( "Time", "debugpress" ), "", "", true );
$this->add_column( __( "Title", "debugpress" ), "", "" );
$this->add_column( __( "Logged Data", "debugpress" ), "", "" );
$this->add_column( __( "Caller", "debugpress" ), "", "" );
$this->add_column( __( "Title", "debugpress" ) );
$this->add_column( __( "Logged Data", "debugpress" ) );
$this->add_column( __( "Caller", "debugpress" ) );
$this->table_head();
foreach ( debugpress_tracker()->logged as $item ) {
$this->render_item( $item );
Expand Down
2 changes: 1 addition & 1 deletion core/panel/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function right() {
$this->block_header( true );
$this->sub_title( __( "Google PageSpeed Insights", "debugpress" ) );
echo '<p>' . __( "Run the current page in the Google PageSpeed Insights test tool.", "debugpress" ) . '</p>';
echo '<a target="_blank" rel="noopener" href="' . $this->_google_pagespeed_url( 'mobile' ) . '" class="debugpress-button-action">' . __( "Run Mobile Test", "debugpress" ) . '</a>';
echo '<a target="_blank" rel="noopener" href="' . $this->_google_pagespeed_url() . '" class="debugpress-button-action">' . __( "Run Mobile Test", "debugpress" ) . '</a>';
echo '<a target="_blank" rel="noopener" href="' . $this->_google_pagespeed_url( 'desktop' ) . '" class="debugpress-button-action">' . __( "Run Desktop Test", "debugpress" ) . '</a>';
$this->block_footer();

Expand Down

0 comments on commit 55ef3d0

Please sign in to comment.