Skip to content

Commit

Permalink
Fix PHPStorm warnings in plugin_api.php
Browse files Browse the repository at this point in the history
  • Loading branch information
dregad committed Sep 25, 2020
1 parent f55f87e commit 49719d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 6 additions & 1 deletion core/database_api.php
Expand Up @@ -37,11 +37,16 @@
require_api( 'logging_api.php' );
require_api( 'utility_api.php' );

/**
* Main database connection.
* @var ADOConnection $g_db
*/
$g_db = false;

# An array in which all executed queries are stored. This is used for profiling
# @global array $g_queries_array
$g_queries_array = array();


# Stores whether a database connection was successfully opened.
# @global bool $g_db_connected
$g_db_connected = false;
Expand Down
9 changes: 5 additions & 4 deletions core/plugin_api.php
Expand Up @@ -624,20 +624,19 @@ function plugin_is_installed( $p_basename ) {
/**
* Install a plugin to the database.
* @param MantisPlugin $p_plugin Plugin basename.
* @return null
* @return void
*/
function plugin_install( MantisPlugin $p_plugin ) {
if( plugin_is_installed( $p_plugin->basename ) ) {
error_parameters( $p_plugin->basename );
trigger_error( ERROR_PLUGIN_ALREADY_INSTALLED, WARNING );
return null;
}

plugin_push_current( $p_plugin->basename );

if( !$p_plugin->install() ) {
plugin_pop_current();
return null;
return;
}

db_param_push();
Expand Down Expand Up @@ -701,6 +700,7 @@ function plugin_upgrade( MantisPlugin $p_plugin ) {
plugin_pop_current();
return false;
}
$t_status = false;

switch( $t_schema[$i][0] ) {
case 'InsertData':
Expand Down Expand Up @@ -735,7 +735,6 @@ function plugin_upgrade( MantisPlugin $p_plugin ) {
array( $t_dict, $t_schema[$i][0] ),
$t_schema[$i][1]
);
$t_status = false;
}

if( $t_sqlarray ) {
Expand Down Expand Up @@ -829,6 +828,7 @@ function plugin_include( $p_basename, $p_child = null ) {
}
$t_included = false;
if( is_file( $t_plugin_file ) ) {
/** @noinspection PhpIncludeInspection */
include_once( $t_plugin_file );
$t_included = true;
}
Expand All @@ -851,6 +851,7 @@ function plugin_require_api( $p_file, $p_basename = null ) {

$t_path = config_get_global( 'plugin_path' ) . $t_current . '/';

/** @noinspection PhpIncludeInspection */
require_once( $t_path . $p_file );
}

Expand Down

0 comments on commit 49719d8

Please sign in to comment.