| @@ -1,48 +1,78 @@ | ||
| 1 | 1 | <?php |
| 2 | - | |
| 3 | -declare(strict_types=1); | |
| 4 | - | |
| 2 | +/** | |
| 3 | + * WordpressCli.php | |
| 4 | + * | |
| 5 | + * The WordpressCli class file. | |
| 6 | + * | |
| 7 | + * PHP versions 5 | |
| 8 | + * | |
| 9 | + * @author Alexander Schneider <[email protected]> | |
| 10 | + * @copyright 2008-2017 Alexander Schneider | |
| 11 | + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 | |
| 12 | + * @version SVN: $id$ | |
| 13 | + * @link http://wordpress.org/extend/plugins/user-access-manager/ | |
| 14 | + */ | |
| 5 | 15 | namespace UserAccessManager\Wrapper; |
| 6 | 16 | |
| 7 | -use WP_CLI; | |
| 8 | -use WP_CLI\ExitException; | |
| 9 | 17 | use WP_CLI\Formatter; |
| 10 | -use WP_Error; | |
| 11 | 18 | |
| 19 | +/** | |
| 20 | + * Class WordpressCli | |
| 21 | + * | |
| 22 | + * @package UserAccessManager\Wrapper | |
| 23 | + */ | |
| 12 | 24 | class WordpressCli |
| 13 | 25 | { |
| 14 | 26 | /** |
| 15 | - * @see WP_CLI::success | |
| 27 | + * @see \WP_CLI::success() | |
| 28 | + * | |
| 29 | + * @param string $message | |
| 30 | + * | |
| 31 | + * @return null | |
| 16 | 32 | */ |
| 17 | - public function success(string $message) | |
| 33 | + public function success($message) | |
| 18 | 34 | { |
| 19 | - return WP_CLI::success($message); | |
| 35 | + return \WP_CLI::success($message); | |
| 20 | 36 | } |
| 21 | 37 | |
| 22 | 38 | /** |
| 23 | - * @throws ExitException | |
| 39 | + * @see \WP_CLI::error() | |
| 40 | + * | |
| 41 | + * @param string|\WP_Error $message Message to write to STDERR. | |
| 42 | + * @param bool|integer $exit True defaults to exit(1). | |
| 43 | + * | |
| 44 | + * @return null | |
| 45 | + * | |
| 46 | + * @throws \WP_CLI\ExitException | |
| 24 | 47 | */ |
| 25 | - public function error(WP_Error|string $message, bool|int $exit = true) | |
| 48 | + public function error($message, $exit = true) | |
| 26 | 49 | { |
| 27 | - return WP_CLI::error($message, $exit); | |
| 50 | + return \WP_CLI::error($message, $exit); | |
| 28 | 51 | } |
| 29 | 52 | |
| 30 | 53 | /** |
| 31 | - * @see WP_CLI::line | |
| 54 | + * @see \WP_CLI::line() | |
| 55 | + * | |
| 56 | + * @param string $message | |
| 57 | + * | |
| 58 | + * @return null | |
| 32 | 59 | */ |
| 33 | - public function line(string $message = ''): void | |
| 60 | + public function line($message = '') | |
| 34 | 61 | { |
| 35 | - WP_CLI::line($message); | |
| 62 | + return \WP_CLI::line($message); | |
| 36 | 63 | } |
| 37 | 64 | |
| 38 | 65 | /** |
| 39 | 66 | * @see Formatter |
| 67 | + * | |
| 68 | + * @param array $assocArguments | |
| 69 | + * @param array $fields | |
| 70 | + * @param bool|string $prefix | |
| 71 | + * | |
| 72 | + * @return Formatter | |
| 40 | 73 | */ |
| 41 | - public function createFormatter( | |
| 42 | - array &$assocArguments, | |
| 43 | - ?array $fields = null, | |
| 44 | - bool|string $prefix = false | |
| 45 | - ): Formatter { | |
| 74 | + public function createFormatter(array &$assocArguments, array $fields = null, $prefix = false) | |
| 75 | + { | |
| 46 | 76 | return new Formatter($assocArguments, $fields, $prefix); |
| 47 | 77 | } |
| 48 | 78 | } |