-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwp-cli-tools-stubs.php
1716 lines (1708 loc) · 47.8 KB
/
wp-cli-tools-stubs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* Generated stub declarations for WP-CLI
* @see https://wp-cli.org/
* @see https://github.com/php-stubs/wp-cli-stubs
*/
namespace cli;
/**
* Parses command line arguments.
*/
class Arguments implements \ArrayAccess
{
protected $_flags = array();
protected $_options = array();
protected $_strict = false;
protected $_input = array();
protected $_invalid = array();
protected $_parsed;
protected $_lexer;
/**
* Initializes the argument parser. If you wish to change the default behaviour
* you may pass an array of options as the first argument. Valid options are
* `'help'` and `'strict'`, each a boolean.
*
* `'help'` is `true` by default, `'strict'` is false by default.
*
* @param array $options An array of options for this parser.
*/
public function __construct($options = array())
{
}
/**
* Get the list of arguments found by the defined definitions.
*
* @return array
*/
public function getArguments()
{
}
public function getHelpScreen()
{
}
/**
* Encodes the parsed arguments as JSON.
*
* @return string
*/
public function asJSON()
{
}
/**
* Returns true if a given argument was parsed.
*
* @param mixed $offset An Argument object or the name of the argument.
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
}
/**
* Get the parsed argument's value.
*
* @param mixed $offset An Argument object or the name of the argument.
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
}
/**
* Sets the value of a parsed argument.
*
* @param mixed $offset An Argument object or the name of the argument.
* @param mixed $value The value to set
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
}
/**
* Unset a parsed argument.
*
* @param mixed $offset An Argument object or the name of the argument.
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
}
/**
* Adds a flag (boolean argument) to the argument list.
*
* @param mixed $flag A string representing the flag, or an array of strings.
* @param array $settings An array of settings for this flag.
* @setting string description A description to be shown in --help.
* @setting bool default The default value for this flag.
* @setting bool stackable Whether the flag is repeatable to increase the value.
* @setting array aliases Other ways to trigger this flag.
* @return $this
*/
public function addFlag($flag, $settings = array())
{
}
/**
* Add multiple flags at once. The input array should be keyed with the
* primary flag character, and the values should be the settings array
* used by {addFlag}.
*
* @param array $flags An array of flags to add
* @return $this
*/
public function addFlags($flags)
{
}
/**
* Adds an option (string argument) to the argument list.
*
* @param mixed $option A string representing the option, or an array of strings.
* @param array $settings An array of settings for this option.
* @setting string description A description to be shown in --help.
* @setting bool default The default value for this option.
* @setting array aliases Other ways to trigger this option.
* @return $this
*/
public function addOption($option, $settings = array())
{
}
/**
* Add multiple options at once. The input array should be keyed with the
* primary option string, and the values should be the settings array
* used by {addOption}.
*
* @param array $options An array of options to add
* @return $this
*/
public function addOptions($options)
{
}
/**
* Enable or disable strict mode. If strict mode is active any invalid
* arguments found by the parser will throw `cli\arguments\InvalidArguments`.
*
* Even if strict is disabled, invalid arguments are logged and can be
* retrieved with `cli\Arguments::getInvalidArguments()`.
*
* @param bool $strict True to enable, false to disable.
* @return $this
*/
public function setStrict($strict)
{
}
/**
* Get the list of invalid arguments the parser found.
*
* @return array
*/
public function getInvalidArguments()
{
}
/**
* Get a flag by primary matcher or any defined aliases.
*
* @param mixed $flag Either a string representing the flag or an
* cli\arguments\Argument object.
* @return array
*/
public function getFlag($flag)
{
}
public function getFlags()
{
}
public function hasFlags()
{
}
/**
* Returns true if the given argument is defined as a flag.
*
* @param mixed $argument Either a string representing the flag or an
* cli\arguments\Argument object.
* @return bool
*/
public function isFlag($argument)
{
}
/**
* Returns true if the given flag is stackable.
*
* @param mixed $flag Either a string representing the flag or an
* cli\arguments\Argument object.
* @return bool
*/
public function isStackable($flag)
{
}
/**
* Get an option by primary matcher or any defined aliases.
*
* @param mixed $option Either a string representing the option or an
* cli\arguments\Argument object.
* @return array
*/
public function getOption($option)
{
}
public function getOptions()
{
}
public function hasOptions()
{
}
/**
* Returns true if the given argument is defined as an option.
*
* @param mixed $argument Either a string representing the option or an
* cli\arguments\Argument object.
* @return bool
*/
public function isOption($argument)
{
}
/**
* Parses the argument list with the given options. The returned argument list
* will use either the first long name given or the first name in the list
* if a long name is not given.
*
* @return array
* @throws arguments\InvalidArguments
*/
public function parse()
{
}
/**
* This applies the default values, if any, of all of the
* flags and options, so that if there is a default value
* it will be available.
*/
private function _applyDefaults()
{
}
private function _warn($message)
{
}
private function _parseFlag($argument)
{
}
private function _parseOption($option)
{
}
}
/**
* Change the color of text.
*
* Reference: http://graphcomp.com/info/specs/ansi_col.html#colors
*/
class Colors
{
protected static $_colors = array('color' => array('black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37), 'style' => array('bright' => 1, 'dim' => 2, 'underline' => 4, 'blink' => 5, 'reverse' => 7, 'hidden' => 8), 'background' => array('black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47));
protected static $_enabled = null;
protected static $_string_cache = array();
public static function enable($force = true)
{
}
public static function disable($force = true)
{
}
/**
* Check if we should colorize output based on local flags and shell type.
*
* Only check the shell type if `Colors::$_enabled` is null and `$colored` is null.
*/
public static function shouldColorize($colored = null)
{
}
/**
* Set the color.
*
* @param string $color The name of the color or style to set.
* @return string
*/
public static function color($color)
{
}
/**
* Colorize a string using helpful string formatters. If the `Streams::$out` points to a TTY coloring will be enabled,
* otherwise disabled. You can control this check with the `$colored` parameter.
*
* @param string $string
* @param boolean $colored Force enable or disable the colorized output. If left as `null` the TTY will control coloring.
* @return string
*/
public static function colorize($string, $colored = null)
{
}
/**
* Remove color information from a string.
*
* @param string $string A string with color information.
* @param int $keep Optional. If the 1 bit is set, color tokens (eg "%n") won't be stripped. If the 2 bit is set, color encodings (ANSI escapes) won't be stripped. Default 0.
* @return string A string with color information removed.
*/
public static function decolorize($string, $keep = 0)
{
}
/**
* Cache the original, colorized, and decolorized versions of a string.
*
* @param string $passed The original string before colorization.
* @param string $colorized The string after running through self::colorize.
* @param string $deprecated Optional. Not used. Default null.
*/
public static function cacheString($passed, $colorized, $deprecated = null)
{
}
/**
* Return the length of the string without color codes.
*
* @param string $string the string to measure
* @return int
*/
public static function length($string)
{
}
/**
* Return the width (length in characters) of the string without color codes if enabled.
*
* @param string $string The string to measure.
* @param bool $pre_colorized Optional. Set if the string is pre-colorized. Default false.
* @param string|bool $encoding Optional. The encoding of the string. Default false.
* @return int
*/
public static function width($string, $pre_colorized = false, $encoding = false)
{
}
/**
* Pad the string to a certain display length.
*
* @param string $string The string to pad.
* @param int $length The display length.
* @param bool $pre_colorized Optional. Set if the string is pre-colorized. Default false.
* @param string|bool $encoding Optional. The encoding of the string. Default false.
* @param int $pad_type Optional. Can be STR_PAD_RIGHT, STR_PAD_LEFT, or STR_PAD_BOTH. If pad_type is not specified it is assumed to be STR_PAD_RIGHT.
* @return string
*/
public static function pad($string, $length, $pre_colorized = false, $encoding = false, $pad_type = STR_PAD_RIGHT)
{
}
/**
* Get the color mapping array.
*
* @return array Array of color tokens mapped to colors and styles.
*/
public static function getColors()
{
}
/**
* Get the cached string values.
*
* @return array The cached string values.
*/
public static function getStringCache()
{
}
/**
* Clear the string cache.
*/
public static function clearStringCache()
{
}
}
abstract class Memoize
{
protected $_memoCache = array();
public function __get($name)
{
}
protected function _unmemo($name)
{
}
}
/**
* The `Notify` class is the basis of all feedback classes, such as Indicators
* and Progress meters. The default behaviour is to refresh output after 100ms
* have passed. This is done to preventing the screen from flickering and keep
* slowdowns from output to a minimum.
*
* The most basic form of Notifier has no maxim, and simply displays a series
* of characters to indicate progress is being made.
*/
abstract class Notify
{
protected $_current = 0;
protected $_first = true;
protected $_interval;
protected $_message;
protected $_start;
protected $_timer;
protected $_tick;
protected $_iteration = 0;
protected $_speed = 0;
/**
* Instatiates a Notification object.
*
* @param string $msg The text to display next to the Notifier.
* @param int $interval The interval in milliseconds between updates.
*/
public function __construct($msg, $interval = 100)
{
}
/**
* This method should be used to print out the Notifier. This method is
* called from `cli\Notify::tick()` after `cli\Notify::$_interval` has passed.
*
* @abstract
* @param boolean $finish
* @see cli\Notify::tick()
*/
public abstract function display($finish = false);
/**
* Reset the notifier state so the same instance can be used in multiple loops.
*/
public function reset()
{
}
/**
* Returns the formatted tick count.
*
* @return string The formatted tick count.
*/
public function current()
{
}
/**
* Calculates the time elapsed since the Notifier was first ticked.
*
* @return int The elapsed time in seconds.
*/
public function elapsed()
{
}
/**
* Calculates the speed (number of ticks per second) at which the Notifier
* is being updated.
*
* @return int The number of ticks performed in 1 second.
*/
public function speed()
{
}
/**
* Takes a time span given in seconds and formats it for display. The
* returned string will be in MM:SS form.
*
* @param int $time The time span in seconds to format.
* @return string The formatted time span.
*/
public function formatTime($time)
{
}
/**
* Finish our Notification display. Should be called after the Notifier is
* no longer needed.
*
* @see cli\Notify::display()
*/
public function finish()
{
}
/**
* Increments are tick counter by the given amount. If no amount is provided,
* the ticker is incremented by 1.
*
* @param int $increment The amount to increment by.
*/
public function increment($increment = 1)
{
}
/**
* Determines whether the display should be updated or not according to
* our interval setting.
*
* @return boolean `true` if the display should be updated, `false` otherwise.
*/
public function shouldUpdate()
{
}
/**
* This method is the meat of all Notifiers. First we increment the ticker
* and then update the display if enough time has passed since our last tick.
*
* @param int $increment The amount to increment by.
* @see cli\Notify::increment()
* @see cli\Notify::shouldUpdate()
* @see cli\Notify::display()
*/
public function tick($increment = 1)
{
}
}
/**
* A more complex type of Notifier, `Progress` Notifiers always have a maxim
* value and generally show some form of percent complete or estimated time
* to completion along with the standard Notifier displays.
*
* @see cli\Notify
*/
abstract class Progress extends \cli\Notify
{
protected $_total = 0;
/**
* Instantiates a Progress Notifier.
*
* @param string $msg The text to display next to the Notifier.
* @param int $total The total number of ticks we will be performing.
* @param int $interval The interval in milliseconds between updates.
* @see cli\Progress::setTotal()
*/
public function __construct($msg, $total, $interval = 100)
{
}
/**
* Set the max increments for this progress notifier.
*
* @param int $total The total number of times this indicator should be `tick`ed.
* @throws \InvalidArgumentException Thrown if the `$total` is less than 0.
*/
public function setTotal($total)
{
}
/**
* Reset the progress state so the same instance can be used in multiple loops.
*/
public function reset($total = null)
{
}
/**
* Behaves in a similar manner to `cli\Notify::current()`, but the output
* is padded to match the length of `cli\Progress::total()`.
*
* @return string The formatted and padded tick count.
* @see cli\Progress::total()
*/
public function current()
{
}
/**
* Returns the formatted total expected ticks.
*
* @return string The formatted total ticks.
*/
public function total()
{
}
/**
* Calculates the estimated total time for the tick count to reach the
* total ticks given.
*
* @return int The estimated total number of seconds for all ticks to be
* completed. This is not the estimated time left, but total.
* @see cli\Notify::speed()
* @see cli\Notify::elapsed()
*/
public function estimated()
{
}
/**
* Forces the current tick count to the total ticks given at instatiation
* time before passing on to `cli\Notify::finish()`.
*/
public function finish()
{
}
/**
* Increments are tick counter by the given amount. If no amount is provided,
* the ticker is incremented by 1.
*
* @param int $increment The amount to increment by.
*/
public function increment($increment = 1)
{
}
/**
* Calculate the percentage completed.
*
* @return float The percent completed.
*/
public function percent()
{
}
}
/**
* The `Shell` class is a utility class for shell related tasks such as
* information on width.
*/
class Shell
{
/**
* Returns the number of columns the current shell has for display.
*
* @return int The number of columns.
* @todo Test on more systems.
*/
public static function columns()
{
}
/**
* Checks whether the output of the current script is a TTY or a pipe / redirect
*
* Returns true if STDOUT output is being redirected to a pipe or a file; false is
* output is being sent directly to the terminal.
*
* If an env variable SHELL_PIPE exists, returned result depends it's
* value. Strings like 1, 0, yes, no, that validate to booleans are accepted.
*
* To enable ASCII formatting even when shell is piped, use the
* ENV variable SHELL_PIPE=0
*
* @return bool
*/
public static function isPiped()
{
}
/**
* Uses `stty` to hide input/output completely.
* @param boolean $hidden Will hide/show the next data. Defaults to true.
*/
public static function hide($hidden = true)
{
}
/**
* Is this shell in Windows?
*
* @return bool
*/
private static function is_windows()
{
}
}
class Streams
{
protected static $out = STDOUT;
protected static $in = STDIN;
protected static $err = STDERR;
static function _call($func, $args)
{
}
public static function isTty()
{
}
/**
* Handles rendering strings. If extra scalar arguments are given after the `$msg`
* the string will be rendered with `sprintf`. If the second argument is an `array`
* then each key in the array will be the placeholder name. Placeholders are of the
* format {:key}.
*
* @param string $msg The message to render.
* @param mixed ... Either scalar arguments or a single array argument.
* @return string The rendered string.
*/
public static function render($msg)
{
}
/**
* Shortcut for printing to `STDOUT`. The message and parameters are passed
* through `sprintf` before output.
*
* @param string $msg The message to output in `printf` format.
* @param mixed ... Either scalar arguments or a single array argument.
* @return void
* @see \cli\render()
*/
public static function out($msg)
{
}
/**
* Pads `$msg` to the width of the shell before passing to `cli\out`.
*
* @param string $msg The message to pad and pass on.
* @param mixed ... Either scalar arguments or a single array argument.
* @return void
* @see cli\out()
*/
public static function out_padded($msg)
{
}
/**
* Prints a message to `STDOUT` with a newline appended. See `\cli\out` for
* more documentation.
*
* @see cli\out()
*/
public static function line($msg = '')
{
}
/**
* Shortcut for printing to `STDERR`. The message and parameters are passed
* through `sprintf` before output.
*
* @param string $msg The message to output in `printf` format. With no string,
* a newline is printed.
* @param mixed ... Either scalar arguments or a single array argument.
* @return void
*/
public static function err($msg = '')
{
}
/**
* Takes input from `STDIN` in the given format. If an end of transmission
* character is sent (^D), an exception is thrown.
*
* @param string $format A valid input format. See `fscanf` for documentation.
* If none is given, all input up to the first newline
* is accepted.
* @param boolean $hide If true will hide what the user types in.
* @return string The input with whitespace trimmed.
* @throws \Exception Thrown if ctrl-D (EOT) is sent as input.
*/
public static function input($format = null, $hide = false)
{
}
/**
* Displays an input prompt. If no default value is provided the prompt will
* continue displaying until input is received.
*
* @param string $question The question to ask the user.
* @param bool|string $default A default value if the user provides no input.
* @param string $marker A string to append to the question and default value
* on display.
* @param boolean $hide Optionally hides what the user types in.
* @return string The users input.
* @see cli\input()
*/
public static function prompt($question, $default = false, $marker = ': ', $hide = false)
{
}
/**
* Presents a user with a multiple choice question, useful for 'yes/no' type
* questions (which this public static function defaults too).
*
* @param string $question The question to ask the user.
* @param string $choice A string of characters allowed as a response. Case is ignored.
* @param string $default The default choice. NULL if a default is not allowed.
* @return string The users choice.
* @see cli\prompt()
*/
public static function choose($question, $choice = 'yn', $default = 'n')
{
}
/**
* Displays an array of strings as a menu where a user can enter a number to
* choose an option. The array must be a single dimension with either strings
* or objects with a `__toString()` method.
*
* @param array $items The list of items the user can choose from.
* @param string $default The index of the default item.
* @param string $title The message displayed to the user when prompted.
* @return string The index of the chosen item.
* @see cli\line()
* @see cli\input()
* @see cli\err()
*/
public static function menu($items, $default = null, $title = 'Choose an item')
{
}
/**
* Sets one of the streams (input, output, or error) to a `stream` type resource.
*
* Valid $whichStream values are:
* - 'in' (default: STDIN)
* - 'out' (default: STDOUT)
* - 'err' (default: STDERR)
*
* Any custom streams will be closed for you on shutdown, so please don't close stream
* resources used with this method.
*
* @param string $whichStream The stream property to update
* @param resource $stream The new stream resource to use
* @return void
* @throws \Exception Thrown if $stream is not a resource of the 'stream' type.
*/
public static function setStream($whichStream, $stream)
{
}
}
/**
* The `Table` class is used to display data in a tabular format.
*/
class Table
{
protected $_renderer;
protected $_headers = array();
protected $_footers = array();
protected $_width = array();
protected $_rows = array();
/**
* Initializes the `Table` class.
*
* There are 3 ways to instantiate this class:
*
* 1. Pass an array of strings as the first parameter for the column headers
* and a 2-dimensional array as the second parameter for the data rows.
* 2. Pass an array of hash tables (string indexes instead of numerical)
* where each hash table is a row and the indexes of the *first* hash
* table are used as the header values.
* 3. Pass nothing and use `setHeaders()` and `addRow()` or `setRows()`.
*
* @param array $headers Headers used in this table. Optional.
* @param array $rows The rows of data for this table. Optional.
* @param array $footers Footers used in this table. Optional.
*/
public function __construct(array $headers = null, array $rows = null, array $footers = null)
{
}
public function resetTable()
{
}
/**
* Sets the renderer used by this table.
*
* @param table\Renderer $renderer The renderer to use for output.
* @see table\Renderer
* @see table\Ascii
* @see table\Tabular
*/
public function setRenderer(\cli\table\Renderer $renderer)
{
}
/**
* Loops through the row and sets the maximum width for each column.
*
* @param array $row The table row.
* @return array $row
*/
protected function checkRow(array $row)
{
}
/**
* Output the table to `STDOUT` using `cli\line()`.
*
* If STDOUT is a pipe or redirected to a file, should output simple
* tab-separated text. Otherwise, renders table with ASCII table borders
*
* @uses cli\Shell::isPiped() Determine what format to output
*
* @see cli\Table::renderRow()
*/
public function display()
{
}
/**
* Get the table lines to output.
*
* @see cli\Table::display()
* @see cli\Table::renderRow()
*
* @return array
*/
public function getDisplayLines()
{
}
/**
* Sort the table by a column. Must be called before `cli\Table::display()`.
*
* @param int $column The index of the column to sort by.
*/
public function sort($column)
{
}
/**
* Set the headers of the table.
*
* @param array $headers An array of strings containing column header names.
*/
public function setHeaders(array $headers)
{
}
/**
* Set the footers of the table.
*
* @param array $footers An array of strings containing column footers names.
*/
public function setFooters(array $footers)
{
}
/**
* Add a row to the table.
*
* @param array $row The row data.
* @see cli\Table::checkRow()
*/
public function addRow(array $row)
{
}
/**
* Clears all previous rows and adds the given rows.
*
* @param array $rows A 2-dimensional array of row data.
* @see cli\Table::addRow()
*/
public function setRows(array $rows)
{
}
public function countRows()
{
}
/**
* Set whether items in an Ascii table are pre-colorized.
*
* @param bool|array $precolorized A boolean to set all columns in the table as pre-colorized, or an array of booleans keyed by column index (number) to set individual columns as pre-colorized.
* @see cli\Ascii::setPreColorized()
*/
public function setAsciiPreColorized($pre_colorized)
{
}
/**
* Is a column in an Ascii table pre-colorized?
*
* @param int $column Column index to check.
* @return bool True if whole Ascii table is marked as pre-colorized, or if the individual column is pre-colorized; else false.
* @see cli\Ascii::isPreColorized()
*/
private function isAsciiPreColorized($column)
{
}
}
/**
* The `Tree` class is used to display data in a tree-like format.
*/
class Tree
{
protected $_renderer;
protected $_data = array();
/**
* Sets the renderer used by this tree.
*
* @param tree\Renderer $renderer The renderer to use for output.
* @see tree\Renderer
* @see tree\Ascii
* @see tree\Markdown
*/
public function setRenderer(\cli\tree\Renderer $renderer)
{
}
/**
* Set the data.
* Format:
* [
* 'Label' => [
* 'Thing' => ['Thing'],
* ],
* 'Thing',
* ]
* @param array $data
*/
public function setData(array $data)
{
}
/**
* Render the tree and return it as a string.
*
* @return string|null
*/
public function render()
{
}
/**
* Display the rendered tree
*/
public function display()
{
}
}
namespace cli\arguments;
/**
* Represents an Argument or a value and provides several helpers related to parsing an argument list.
*/
class Argument extends \cli\Memoize
{
/**
* The canonical name of this argument, used for aliasing.
*
* @param string
*/
public $key;
private $_argument;
private $_raw;
/**
* @param string $argument The raw argument, leading dashes included.
*/
public function __construct($argument)
{
}
/**
* Returns the raw input as a string.
*
* @return string
*/