Skip to content

Conversation

@DenisFlorin
Copy link
Contributor

No description provided.

@DenisFlorin
Copy link
Contributor Author

The Plugin Check https://wordpress.org/plugins/plugin-check/ reports the following messages:

Type Code Message
WARNING WordPress.PHP.DevelopmentFunctions.error_log_trigger_error trigger_error() found. Debug code should not normally be used in production.
WARNING WordPress.PHP.DevelopmentFunctions.error_log_error_log error_log() found. Debug code should not normally be used in production.

// Merges the commits with remote and pushes them back
function gitium_merge_and_push( $commits ) {
global $git;
global $git;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the indentation is inconsistent.

if ( $git->is_dirty() && $git->add() > 0 ) {
$commit = $git->commit( $commitmsg );
if ( ! $commit ) {
wp_die( 'Error: Could not commit local changes.', 'Gitium Error', [ 'response' => 500 ] );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
wp_die( 'Error: Could not commit local changes.', 'Gitium Error', [ 'response' => 500 ] );
wp_die( 'Could not commit local changes.', 'Gitium Error', [ 'response' => 500 ] );


if ( ! gitium_merge_and_push( $commits ) ) {
$error = $git->get_last_error();
wp_die( 'Error: Merge & push failed. ' . ( is_string( $error ) ? $error : '' ), 'Gitium Error', [ 'response' => 500 ] );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
wp_die( 'Error: Merge & push failed. ' . ( is_string( $error ) ? $error : '' ), 'Gitium Error', [ 'response' => 500 ] );
wp_die( 'Merge & push failed. ' . ( is_string( $error ) ? $error : '' ), 'Gitium Error', [ 'response' => 500 ] );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants