| @@ -1,5 +1,18 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * WordpressCli.php | |
| 4 | + * | |
| 5 | + * The WordpressCli class file. | |
| 6 | + * | |
| 7 | + * PHP versions 5 | |
| 8 | + * | |
| 9 | + * @author Alexander Schneider <alexanderschneider85@gmail.com> | |
| 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 | + */ | |
| 2 | 15 | |
| 3 | 16 | declare(strict_types=1); |
| 4 | 17 | |
| 5 | 18 | namespace UserAccessManager\Wrapper; |
| @@ -8,12 +21,19 @@ | ||
| 8 | 21 | use WP_CLI\ExitException; |
| 9 | 22 | use WP_CLI\Formatter; |
| 10 | 23 | use WP_Error; |
| 11 | 24 | |
| 25 | +/** | |
| 26 | + * Class WordpressCli | |
| 27 | + * | |
| 28 | + * @package UserAccessManager\Wrapper | |
| 29 | + */ | |
| 12 | 30 | class WordpressCli |
| 13 | 31 | { |
| 14 | 32 | /** |
| 15 | - * @see WP_CLI::success | |
| 33 | + * @param string $message | |
| 34 | + * @return null | |
| 35 | + * @see \WP_CLI::success() | |
| 16 | 36 | */ |
| 17 | 37 | public function success(string $message) |
| 18 | 38 | { |
| 19 | 39 | return WP_CLI::success($message); |
| @@ -19,30 +39,37 @@ | ||
| 19 | 39 | return WP_CLI::success($message); |
| 20 | 40 | } |
| 21 | 41 | |
| 22 | 42 | /** |
| 43 | + * @param string|WP_Error $message Message to write to STDERR. | |
| 44 | + * @param bool|integer $exit True defaults to exit(1). | |
| 45 | + * @return null | |
| 23 | 46 | * @throws ExitException |
| 47 | + * @see \WP_CLI::error() | |
| 24 | 48 | */ |
| 25 | - public function error(WP_Error|string $message, bool|int $exit = true) | |
| 49 | + public function error($message, $exit = true) | |
| 26 | 50 | { |
| 27 | 51 | return WP_CLI::error($message, $exit); |
| 28 | 52 | } |
| 29 | 53 | |
| 30 | 54 | /** |
| 31 | - * @see WP_CLI::line | |
| 55 | + * @param string $message | |
| 56 | + * @return null | |
| 57 | + * @see \WP_CLI::line() | |
| 32 | 58 | */ |
| 33 | - public function line(string $message = ''): void | |
| 59 | + public function line($message = '') | |
| 34 | 60 | { |
| 35 | - WP_CLI::line($message); | |
| 61 | + return WP_CLI::line($message); | |
| 36 | 62 | } |
| 37 | 63 | |
| 38 | 64 | /** |
| 65 | + * @param array $assocArguments | |
| 66 | + * @param array|null $fields | |
| 67 | + * @param bool|string $prefix | |
| 68 | + * @return Formatter | |
| 39 | 69 | * @see Formatter |
| 40 | 70 | */ |
| 41 | - public function createFormatter( | |
| 42 | - array &$assocArguments, | |
| 43 | - ?array $fields = null, | |
| 44 | - bool|string $prefix = false | |
| 45 | - ): Formatter { | |
| 71 | + public function createFormatter(array &$assocArguments, array $fields = null, $prefix = false): Formatter | |
| 72 | + { | |
| 46 | 73 | return new Formatter($assocArguments, $fields, $prefix); |
| 47 | 74 | } |
| 48 | 75 | } |