Failed Conditions
Push — develop ( 5bcd45...3b0b21 )
by Remco
04:11
created

src/i18n-make-pot.php (15 issues)

1
<?php
2
3
namespace Pronamic\WordPress\Pay;
4
5
/*
6
 * The `pronamic i18n make-pot` command requires the `i18n make-pot` command.
7
 *
8
 * @link https://make.wordpress.org/cli/2017/05/03/managing-command-dependencies/
9
 */
10
\WP_CLI::add_hook( 'after_add_command:i18n make-pot', function () {
0 ignored issues
show
The type WP_CLI was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
For multi-line function calls, each argument should be on a separate line.

For a function calls that spawns multiple lines, the coding style suggests to split arguments to separate lines like this:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
);
Loading history...
11
	class MakePotCommand extends \WP_CLI\I18n\MakePotCommand {
12
		public function __construct() {
13
			parent::__construct();
0 ignored issues
show
Closures / anonymous functions could not use "parent::" in PHP 5.3 or earlier
Loading history...
14
15
			// https://github.com/wp-cli/i18n-command/blob/v2.0.1/src/MakePotCommand.php#L36-L44
16
			$this->exclude = array_diff(
0 ignored issues
show
Closures / anonymous functions only have access to $this if used within a class or when bound to an object using bindTo(). Please verify.
Loading history...
Closures / anonymous functions did not have access to $this in PHP 5.3 or earlier
Loading history...
17
				$this->exclude,
0 ignored issues
show
Closures / anonymous functions only have access to $this if used within a class or when bound to an object using bindTo(). Please verify.
Loading history...
Closures / anonymous functions did not have access to $this in PHP 5.3 or earlier
Loading history...
18
				array(
19
					'vendor',
20
				)
21
			);
22
23
			$this->exclude = array_merge(
0 ignored issues
show
Closures / anonymous functions only have access to $this if used within a class or when bound to an object using bindTo(). Please verify.
Loading history...
Closures / anonymous functions did not have access to $this in PHP 5.3 or earlier
Loading history...
24
				$this->exclude,
0 ignored issues
show
Closures / anonymous functions only have access to $this if used within a class or when bound to an object using bindTo(). Please verify.
Loading history...
Closures / anonymous functions did not have access to $this in PHP 5.3 or earlier
Loading history...
25
				array(
26
					'build',
27
					'deploy',
28
					'documentation',
29
					'etc',
30
					'repositories',
31
					'wordpress',
32
					'wp-content',
33
				)
34
			);
35
36
			$this->include = array(
0 ignored issues
show
Closures / anonymous functions only have access to $this if used within a class or when bound to an object using bindTo(). Please verify.
Loading history...
Closures / anonymous functions did not have access to $this in PHP 5.3 or earlier
Loading history...
37
				'admin',
38
				'includes',
39
				'templates',
40
				'vendor',
41
				'views',
42
				'*.php',
43
			);
44
		}
45
	}
46
47
	// https://github.com/wp-cli/i18n-command/blob/v2.0.1/i18n-command.php
48
	\WP_CLI::add_command( 'pronamic i18n make-pot', '\Pronamic\WordPress\Pay\MakePotCommand' );
49
	// wp pronamic i18n make-pot . languages/pronamic_ideal.pot --slug="pronamic-ideal"
50
} );
0 ignored issues
show
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
51