Issues (8)

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

1
<?php
2
/**
3
 * WP-CLI `pronamic i18n make-pot` command.
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2021 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay
9
 */
10
11
namespace Pronamic\WordPress\Pay\Fundraising;
12
13
/*
14
 * The `pronamic i18n make-pot` command requires the `i18n make-pot` command.
15
 *
16
 * @link https://make.wordpress.org/cli/2017/05/03/managing-command-dependencies/
17
 */
18
\WP_CLI::add_hook(
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...
19
	'after_add_command:i18n make-pot',
20
	function() {
21
22
		/**
23
		 * Title: Make pot command.
24
		 * Description:
25
		 * Copyright: 2005-2021 Pronamic
26
		 * Company: Pronamic
27
		 *
28
		 * @author  Remco Tolsma
29
		 * @version 5.5.5
30
		 * @since   5.5.0
31
		 */
32
		class MakePotCommand extends \WP_CLI\I18n\MakePotCommand {
0 ignored issues
show
The type WP_CLI\I18n\MakePotCommand 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...
33
			/**
34
			 * Command constructor.
35
			 */
36
			public function __construct() {
37
				parent::__construct();
38
39
				// @link https://github.com/wp-cli/i18n-command/blob/v2.0.1/src/MakePotCommand.php#L36-L44
40
				$this->exclude = array_diff(
0 ignored issues
show
Bug Best Practice introduced by
The property exclude does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
41
					$this->exclude,
42
					array(
43
						'vendor',
44
					)
45
				);
46
47
				$this->exclude = array_merge(
48
					$this->exclude,
49
					array(
50
						'vendor',
51
						'wordpress',
52
						'wp-content',
53
					)
54
				);
55
56
				$this->include = array(
0 ignored issues
show
Bug Best Practice introduced by
The property include does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
57
					'js',
58
					'src',
59
					'templates',
60
					'*.php',
61
				);
62
			}
63
		}
64
65
		// @link https://github.com/wp-cli/i18n-command/blob/v2.0.1/i18n-command.php
66
		\WP_CLI::add_command( 'pronamic i18n make-pot', '\Pronamic\WordPress\Pay\Fundraising\MakePotCommand' );
67
68
		/*
69
		 * Usage example:
70
		 *
71
		 * wp pronamic i18n make-pot . languages/pronamic-pay-fundraising.pot --slug="pronamic-pay-fundraising"
72
		 * wp i18n make-json languages/pronamic-pay-fundraising-nl_NL.po --no-purge
73
		 */
74
	}
75
);
76