-
Notifications
You must be signed in to change notification settings - Fork 3
/
.castor.stub.php
3182 lines (3152 loc) · 95.3 KB
/
.castor.stub.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
// castor version: v0.9.1
namespace Castor\Attribute;
#[\Attribute(\Attribute::TARGET_PARAMETER)]
class AsArgument extends AsCommandArgument
{
/**
* @param array<string> $suggestedValues
*/
public function __construct(string $name = null, public readonly string $description = '', public readonly array $suggestedValues = [])
{
}
}
namespace Castor\Attribute;
abstract class AsCommandArgument
{
public function __construct(public readonly string|null $name = null)
{
}
}
namespace Castor\Attribute;
#[\Attribute(\Attribute::TARGET_FUNCTION)]
class AsContext
{
public function __construct(public string $name = '', public bool $default = false)
{
}
}
namespace Castor\Attribute;
#[\Attribute(\Attribute::TARGET_PARAMETER)]
class AsOption extends AsCommandArgument
{
/**
* @param string|array<string>|null $shortcut
* @param array<string> $suggestedValues
*/
public function __construct(string $name = null, public readonly string|array|null $shortcut = null, public readonly int|null $mode = null, public readonly string $description = '', public readonly array $suggestedValues = [])
{
}
}
namespace Castor\Attribute;
#[\Attribute(\Attribute::TARGET_FUNCTION)]
class AsTask
{
/**
* @param array<string> $aliases
* @param array<int, callable(int): (int|false)> $onSignals
*/
public function __construct(public string $name = '', public string|null $namespace = null, public string $description = '', public array $aliases = [], public array $onSignals = [], public string|bool $enabled = true)
{
}
}
namespace Castor;
class Context implements \ArrayAccess
{
public readonly string $currentDirectory;
/**
* @phpstan-param ContextData $data The input parameter accepts an array or an Object
*
* @param array<string, string|\Stringable|int> $environment A list of environment variables to add to the command
*/
public function __construct(public readonly array $data = [], public readonly array $environment = [], string $currentDirectory = null, public readonly bool $tty = false, public readonly bool $pty = true, public readonly float|null $timeout = 60, public readonly bool $quiet = false, public readonly bool $allowFailure = false, public readonly bool $notify = false, public readonly VerbosityLevel $verbosityLevel = VerbosityLevel::NOT_CONFIGURED)
{
}
/** @param array<(int|string), mixed> $data */
public function withData(array $data, bool $keepExisting = true) : self
{
}
/** @param array<string, string|\Stringable|int> $environment */
public function withEnvironment(array $environment, bool $keepExisting = true) : self
{
}
public function withPath(string $path) : self
{
}
public function withTty(bool $tty = true) : self
{
}
public function withPty(bool $pty = true) : self
{
}
public function withTimeout(float|null $timeout) : self
{
}
public function withQuiet(bool $quiet = true) : self
{
}
public function withAllowFailure(bool $allowFailure = true) : self
{
}
public function withNotify(bool $notify = true) : self
{
}
public function withVerbosityLevel(VerbosityLevel $verbosityLevel) : self
{
}
public function offsetExists(mixed $offset) : bool
{
}
public function offsetGet(mixed $offset) : mixed
{
}
public function offsetSet(mixed $offset, mixed $value) : void
{
}
public function offsetUnset(mixed $offset) : void
{
}
}
namespace Castor\Fingerprint;
enum FileHashStrategy
{
case Content;
case MTimes;
}
namespace Castor\Fingerprint;
class FingerprintHelper
{
private const SUFFIX = '.fingerprint';
public static function verifyFingerprintFromHash(string $fingerprint) : bool
{
}
public static function postProcessFingerprintForHash(string $hash) : void
{
}
}
namespace Castor;
class GlobalHelper
{
private static \Castor\Console\Application $application;
private static \Symfony\Component\Console\Input\InputInterface $input;
private static SectionOutput $sectionOutput;
private static \Symfony\Component\Console\Style\SymfonyStyle $symfonyStyle;
private static \Monolog\Logger $logger;
private static ContextRegistry $contextRegistry;
private static \Symfony\Component\Console\Command\Command $command;
private static Context $initialContext;
private static \Symfony\Component\Filesystem\Filesystem $fs;
private static \Symfony\Contracts\HttpClient\HttpClientInterface $httpClient;
private static \Psr\Cache\CacheItemPoolInterface&\Symfony\Contracts\Cache\CacheInterface $cache;
private static \Symfony\Component\ExpressionLanguage\ExpressionLanguage $expressionLanguage;
public static function setApplication(\Castor\Console\Application $application) : void
{
}
public static function getApplication() : \Castor\Console\Application
{
}
public static function setInput(\Symfony\Component\Console\Input\InputInterface $input) : void
{
}
public static function getInput() : \Symfony\Component\Console\Input\InputInterface
{
}
public static function getOutput() : \Symfony\Component\Console\Output\OutputInterface
{
}
public static function setSectionOutput(SectionOutput $output) : void
{
}
public static function getSectionOutput() : SectionOutput
{
}
public static function getSymfonyStyle() : \Symfony\Component\Console\Style\SymfonyStyle
{
}
public static function setLogger(\Monolog\Logger $logger) : void
{
}
public static function getLogger() : \Monolog\Logger
{
}
public static function setContextRegistry(ContextRegistry $contextRegistry) : void
{
}
public static function getContextRegistry() : ContextRegistry
{
}
public static function setCommand(\Symfony\Component\Console\Command\Command $command) : void
{
}
public static function setInitialContext(Context $initialContext) : void
{
}
public static function getInitialContext() : Context
{
}
public static function getContext(string $name = null) : Context
{
}
/**
* @template TKey of key-of<ContextData>
* @template TDefault
*
* @param TKey|string $key
* @param TDefault $default
*
* @phpstan-return ($key is TKey ? ContextData[TKey] : TDefault)
*/
public static function getVariable(string $key, mixed $default = null) : mixed
{
}
public static function getCommand() : \Symfony\Component\Console\Command\Command
{
}
public static function getFilesystem() : \Symfony\Component\Filesystem\Filesystem
{
}
public static function setHttpClient(\Symfony\Contracts\HttpClient\HttpClientInterface $httpClient) : void
{
}
public static function getHttpClient() : \Symfony\Contracts\HttpClient\HttpClientInterface
{
}
public static function setCache(\Psr\Cache\CacheItemPoolInterface&\Symfony\Contracts\Cache\CacheInterface $cache) : void
{
}
public static function getCache() : \Psr\Cache\CacheItemPoolInterface&\Symfony\Contracts\Cache\CacheInterface
{
}
public static function setupDefaultCache() : void
{
}
public static function getExpressionLanguage() : \Symfony\Component\ExpressionLanguage\ExpressionLanguage
{
}
}
namespace Castor;
class HasherHelper
{
private \HashContext $hashContext;
/**
* @see https://www.php.net/manual/en/function.hash-algos.php
*/
public function __construct(string $algo = 'xxh128')
{
}
public function write(string $value) : self
{
}
public function writeFile(string $path, \Castor\Fingerprint\FileHashStrategy $strategy = \Castor\Fingerprint\FileHashStrategy::MTimes) : self
{
}
public function writeWithFinder(\Symfony\Component\Finder\Finder $finder, \Castor\Fingerprint\FileHashStrategy $strategy = \Castor\Fingerprint\FileHashStrategy::MTimes) : self
{
}
public function writeGlob(string $pattern, \Castor\Fingerprint\FileHashStrategy $strategy = \Castor\Fingerprint\FileHashStrategy::MTimes) : self
{
}
public function writeTaskName() : self
{
}
public function writeTaskArgs(string ...$args) : self
{
}
public function writeTask() : self
{
}
public function finish() : string
{
}
}
namespace Castor\Monolog\Processor;
class ProcessProcessor implements \Monolog\Processor\ProcessorInterface
{
public function __invoke(\Monolog\LogRecord $record) : \Monolog\LogRecord
{
}
/**
* @return array{cwd: ?string, env: array<string, string>, runnable: string}
*/
private function formatProcess(\Symfony\Component\Process\Process $process) : array
{
}
}
namespace Castor;
class PathHelper
{
public static function getRoot() : string
{
}
public static function realpath(string $path) : string
{
}
}
namespace Castor;
class PlatformUtil extends \Joli\JoliNotif\Util\OsHelper
{
public static function getEnv(string $name) : string|false
{
}
/**
* @throws \RuntimeException If the user home could not reliably be determined
*/
public static function getUserDirectory() : string
{
}
}
namespace Castor;
class SectionDetails
{
public function __construct(public \Symfony\Component\Console\Output\ConsoleSectionOutput $section, public \Symfony\Component\Console\Output\ConsoleSectionOutput $progressBarSection, public float $start, public string $index)
{
}
}
namespace Castor;
enum VerbosityLevel : int
{
case NOT_CONFIGURED = -1;
case QUIET = 0;
case NORMAL = 1;
case VERBOSE = 2;
case VERY_VERBOSE = 3;
case DEBUG = 4;
public static function fromSymfonyOutput(\Symfony\Component\Console\Output\OutputInterface $output) : self
{
}
public function isNotConfigured() : bool
{
}
public function isQuiet() : bool
{
}
public function isVerbose() : bool
{
}
public function isVeryVerbose() : bool
{
}
public function isDebug() : bool
{
}
}
namespace Castor;
/**
* @return array<mixed>
*/
function parallel(callable ...$callbacks) : array
{
}
/**
* @param string|array<string|\Stringable|int> $command
* @param array<string, string|\Stringable|int>|null $environment
* @param (callable(string, string, Process) :void)|null $callback
*/
function run(string|array $command, array $environment = null, string $path = null, bool $tty = null, bool $pty = null, float $timeout = null, bool $quiet = null, bool $allowFailure = null, bool $notify = null, callable $callback = null, Context $context = null) : \Symfony\Component\Process\Process
{
}
/**
* @param string|array<string|\Stringable|int> $command
* @param array<string, string|\Stringable|int>|null $environment
*/
function capture(string|array $command, array $environment = null, string $path = null, float $timeout = null, bool $allowFailure = null, string $onFailure = null, Context $context = null) : string
{
}
/**
* @param string|array<string|\Stringable|int> $command
* @param array<string, string|\Stringable|int>|null $environment
*/
function exit_code(string|array $command, array $environment = null, string $path = null, float $timeout = null, bool $quiet = null, Context $context = null) : int
{
}
function get_exit_code(...$args) : int
{
}
/**
* This function is considered experimental and may change in the future.
*
* @param array{
* 'port'?: int,
* 'path_private_key'?: string,
* 'jump_host'?: string,
* 'multiplexing_control_path'?: string,
* 'multiplexing_control_persist'?: string,
* 'enable_strict_check'?: bool,
* 'password_authentication'?: bool,
* } $sshOptions
*/
function ssh(string $command, string $host, string $user, array $sshOptions = [], string $path = null, bool $quiet = null, bool $allowFailure = null, bool $notify = null, float $timeout = null) : \Symfony\Component\Process\Process
{
}
function notify(string $message) : void
{
}
/**
* @param string|non-empty-array<string> $path
* @param (callable(string, string) : (false|void|null)) $function
*/
function watch(string|array $path, callable $function, Context $context = null) : void
{
}
/**
* @param array<string, mixed> $context
*
* @phpstan-param \Monolog\Level|\Psr\Log\LogLevel::* $level
*/
function log(string|\Stringable $message, mixed $level = 'info', array $context = []) : void
{
}
function app() : \Castor\Console\Application
{
}
function get_application() : \Castor\Console\Application
{
}
function input() : \Symfony\Component\Console\Input\InputInterface
{
}
function get_input() : \Symfony\Component\Console\Input\InputInterface
{
}
function output() : \Symfony\Component\Console\Output\OutputInterface
{
}
function get_output() : \Symfony\Component\Console\Output\OutputInterface
{
}
function io() : \Symfony\Component\Console\Style\SymfonyStyle
{
}
function add_context(string $name, \Closure $callable, bool $default = false) : void
{
}
function context(string $name = null) : Context
{
}
function get_context() : Context
{
}
/**
* @template TKey of key-of<ContextData>
* @template TDefault
*
* @param TKey|string $key
* @param TDefault $default
*
* @phpstan-return ($key is TKey ? ContextData[TKey] : TDefault)
*/
function variable(string $key, mixed $default = null) : mixed
{
}
function task() : \Symfony\Component\Console\Command\Command
{
}
function get_command() : \Symfony\Component\Console\Command\Command
{
}
function fs() : \Symfony\Component\Filesystem\Filesystem
{
}
function finder() : \Symfony\Component\Finder\Finder
{
}
/**
* @param string $key The key of the item to retrieve from the cache
* @param (callable(CacheItemInterface,bool):T)|(callable(ItemInterface,bool):T)|CallbackInterface<T> $or Use this callback to compute the value
*
* @return T
*
* @see CacheInterface::get()
*
* @template T
*/
function cache(string $key, callable $or) : mixed
{
}
function get_cache() : \Psr\Cache\CacheItemPoolInterface&\Symfony\Contracts\Cache\CacheInterface
{
}
/**
* @param array<string, mixed> $options
*
* @see HttpClientInterface::OPTIONS_DEFAULTS
*/
function request(string $method, string $url, array $options = []) : \Symfony\Contracts\HttpClient\ResponseInterface
{
}
function http_client() : \Symfony\Contracts\HttpClient\HttpClientInterface
{
}
function import(string $path) : void
{
}
function fix_exception(\Exception $exception) : \Exception
{
}
/**
* @return array<string, mixed>
*/
function load_dot_env(string $path = null) : array
{
}
/**
* @template T
*
* @param (callable(Context) :T) $callback
* @param array<string, string|\Stringable|int>|null $data
* @param array<string, string|\Stringable|int>|null $environment
*/
function with(callable $callback, array $data = null, array $environment = null, string $path = null, bool $tty = null, bool $pty = null, float $timeout = null, bool $quiet = null, bool $allowFailure = null, bool $notify = null, Context|string $context = null) : mixed
{
}
/**
* @see https://www.php.net/manual/en/function.hash-algos.php
*/
function hasher(string $algo = 'xxh128') : HasherHelper
{
}
function fingerprint_exists(string $fingerprint) : bool
{
}
function fingerprint_save(string $fingerprint) : void
{
}
function fingerprint(callable $callback, string $fingerprint) : void
{
}
namespace Symfony\Component\Console;
/**
* An Application is the container for a collection of commands.
*
* It is the main entry point of a Console application.
*
* This class is optimized for a standard CLI environment.
*
* Usage:
*
* $app = new Application('myapp', '1.0 (stable)');
* $app->add(new SimpleCommand());
* $app->run();
*
* @author Fabien Potencier <[email protected]>
*/
class Application implements \Symfony\Contracts\Service\ResetInterface
{
private array $commands = [];
private bool $wantHelps = false;
private ?\Symfony\Component\Console\Command\Command $runningCommand = null;
private string $name;
private string $version;
private ?\Symfony\Component\Console\CommandLoader\CommandLoaderInterface $commandLoader = null;
private bool $catchExceptions = true;
private bool $catchErrors = false;
private bool $autoExit = true;
private \Symfony\Component\Console\Input\InputDefinition $definition;
private \Symfony\Component\Console\Helper\HelperSet $helperSet;
private ?\Symfony\Contracts\EventDispatcher\EventDispatcherInterface $dispatcher = null;
private Terminal $terminal;
private string $defaultCommand;
private bool $singleCommand = false;
private bool $initialized = false;
private ?\Symfony\Component\Console\SignalRegistry\SignalRegistry $signalRegistry = null;
private array $signalsToDispatchEvent = [];
public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN')
{
}
/**
* @final
*/
public function setDispatcher(\Symfony\Contracts\EventDispatcher\EventDispatcherInterface $dispatcher) : void
{
}
/**
* @return void
*/
public function setCommandLoader(\Symfony\Component\Console\CommandLoader\CommandLoaderInterface $commandLoader)
{
}
public function getSignalRegistry() : \Symfony\Component\Console\SignalRegistry\SignalRegistry
{
}
/**
* @return void
*/
public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent)
{
}
/**
* Runs the current application.
*
* @return int 0 if everything went fine, or an error code
*
* @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}.
*/
public function run(\Symfony\Component\Console\Input\InputInterface $input = null, \Symfony\Component\Console\Output\OutputInterface $output = null) : int
{
}
/**
* Runs the current application.
*
* @return int 0 if everything went fine, or an error code
*/
public function doRun(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output)
{
}
/**
* @return void
*/
public function reset()
{
}
/**
* @return void
*/
public function setHelperSet(\Symfony\Component\Console\Helper\HelperSet $helperSet)
{
}
public function getHelperSet() : \Symfony\Component\Console\Helper\HelperSet
{
}
/**
* @return void
*/
public function setDefinition(\Symfony\Component\Console\Input\InputDefinition $definition)
{
}
public function getDefinition() : \Symfony\Component\Console\Input\InputDefinition
{
}
public function complete(\Symfony\Component\Console\Completion\CompletionInput $input, \Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void
{
}
public function getHelp() : string
{
}
public function areExceptionsCaught() : bool
{
}
/**
* Sets whether to catch exceptions or not during commands execution.
*
* @return void
*/
public function setCatchExceptions(bool $boolean)
{
}
public function setCatchErrors(bool $catchErrors = true) : void
{
}
public function isAutoExitEnabled() : bool
{
}
/**
* Sets whether to automatically exit after a command execution or not.
*
* @return void
*/
public function setAutoExit(bool $boolean)
{
}
public function getName() : string
{
}
/**
* Sets the application name.
*
* @return void
*/
public function setName(string $name)
{
}
public function getVersion() : string
{
}
/**
* Sets the application version.
*
* @return void
*/
public function setVersion(string $version)
{
}
/**
* Returns the long version of the application.
*
* @return string
*/
public function getLongVersion()
{
}
public function register(string $name) : \Symfony\Component\Console\Command\Command
{
}
/**
* Adds an array of command objects.
*
* If a Command is not enabled it will not be added.
*
* @param Command[] $commands An array of commands
*
* @return void
*/
public function addCommands(array $commands)
{
}
/**
* Adds a command object.
*
* If a command with the same name already exists, it will be overridden.
* If the command is not enabled it will not be added.
*
* @return Command|null
*/
public function add(\Symfony\Component\Console\Command\Command $command)
{
}
/**
* Returns a registered command by name or alias.
*
* @return Command
*
* @throws CommandNotFoundException When given command name does not exist
*/
public function get(string $name)
{
}
public function has(string $name) : bool
{
}
/**
* Returns an array of all unique namespaces used by currently registered commands.
*
* It does not return the global namespace which always exists.
*
* @return string[]
*/
public function getNamespaces() : array
{
}
/**
* Finds a registered namespace by a name or an abbreviation.
*
* @throws NamespaceNotFoundException When namespace is incorrect or ambiguous
*/
public function findNamespace(string $namespace) : string
{
}
/**
* Finds a command by name or alias.
*
* Contrary to get, this command tries to find the best
* match if you give it an abbreviation of a name or alias.
*
* @return Command
*
* @throws CommandNotFoundException When command name is incorrect or ambiguous
*/
public function find(string $name)
{
}
/**
* Gets the commands (registered in the given namespace if provided).
*
* The array keys are the full names and the values the command instances.
*
* @return Command[]
*/
public function all(string $namespace = null)
{
}
/**
* Returns an array of possible abbreviations given a set of names.
*
* @return string[][]
*/
public static function getAbbreviations(array $names) : array
{
}
public function renderThrowable(\Throwable $e, \Symfony\Component\Console\Output\OutputInterface $output) : void
{
}
protected function doRenderThrowable(\Throwable $e, \Symfony\Component\Console\Output\OutputInterface $output) : void
{
}
/**
* Configures the input and output instances based on the user arguments and options.
*
* @return void
*/
protected function configureIO(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output)
{
}
/**
* Runs the current command.
*
* If an event dispatcher has been attached to the application,
* events are also dispatched during the life-cycle of the command.
*
* @return int 0 if everything went fine, or an error code
*/
protected function doRunCommand(\Symfony\Component\Console\Command\Command $command, \Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output)
{
}
protected function getCommandName(\Symfony\Component\Console\Input\InputInterface $input) : ?string
{
}
protected function getDefaultInputDefinition() : \Symfony\Component\Console\Input\InputDefinition
{
}
/**
* Gets the default commands that should always be available.
*
* @return Command[]
*/
protected function getDefaultCommands() : array
{
}
protected function getDefaultHelperSet() : \Symfony\Component\Console\Helper\HelperSet
{
}
private function getAbbreviationSuggestions(array $abbrevs) : string
{
}
public function extractNamespace(string $name, int $limit = null) : string
{
}
/**
* Finds alternative of $name among $collection,
* if nothing is found in $collection, try in $abbrevs.
*
* @return string[]
*/
private function findAlternatives(string $name, iterable $collection) : array
{
}
/**
* Sets the default Command name.
*
* @return $this
*/
public function setDefaultCommand(string $commandName, bool $isSingleCommand = false) : static
{
}
private function splitStringByWidth(string $string, int $width) : array
{
}
/**
* Returns all namespaces of the command name.
*
* @return string[]
*/
private function extractAllNamespaces(string $name) : array
{
}
private function init() : void
{
}
}
namespace Symfony\Component\Console\Input;
/**
* Represents a command line argument.
*
* @author Fabien Potencier <[email protected]>
*/
class InputArgument
{
public const REQUIRED = 1;
public const OPTIONAL = 2;
public const IS_ARRAY = 4;
private string $name;
private int $mode;
private string|int|bool|array|null|float $default;
private array|\Closure $suggestedValues;
private string $description;
/**
* @param string $name The argument name
* @param int|null $mode The argument mode: a bit mask of self::REQUIRED, self::OPTIONAL and self::IS_ARRAY
* @param string $description A description text
* @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only)
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
*
* @throws InvalidArgumentException When argument mode is not valid
*/
public function __construct(string $name, int $mode = null, string $description = '', string|bool|int|float|array $default = null, \Closure|array $suggestedValues = [])
{
}
public function getName() : string
{
}
/**
* Returns true if the argument is required.
*
* @return bool true if parameter mode is self::REQUIRED, false otherwise
*/
public function isRequired() : bool
{
}
/**
* Returns true if the argument can take multiple values.
*
* @return bool true if mode is self::IS_ARRAY, false otherwise
*/
public function isArray() : bool
{
}
/**
* Sets the default value.
*
* @return void
*
* @throws LogicException When incorrect default value is given
*/
public function setDefault(string|bool|int|float|array $default = null)
{
}
public function getDefault() : string|bool|int|float|array|null
{
}
public function hasCompletion() : bool
{
}
/**
* Adds suggestions to $suggestions for the current completion input.
*
* @see Command::complete()
*/
public function complete(\Symfony\Component\Console\Completion\CompletionInput $input, \Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void
{
}
public function getDescription() : string
{
}
}
namespace Symfony\Component\Console\Input;
/**
* InputInterface is the interface implemented by all input classes.
*
* @author Fabien Potencier <[email protected]>
*
* @method string __toString() Returns a stringified representation of the args passed to the command.
* InputArguments MUST be escaped as well as the InputOption values passed to the command.
*/
interface InputInterface
{
public function getFirstArgument() : ?string;
/**
* Returns true if the raw parameters (not parsed) contain a value.
*
* This method is to be used to introspect the input parameters
* before they have been validated. It must be used carefully.
* Does not necessarily return the correct result for short options
* when multiple flags are combined in the same option.
*
* @param string|array $values The values to look for in the raw parameters (can be an array)
* @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
*/
public function hasParameterOption(string|array $values, bool $onlyParams = false) : bool;
/**
* Returns the value of a raw option (not parsed).
*
* This method is to be used to introspect the input parameters
* before they have been validated. It must be used carefully.
* Does not necessarily return the correct result for short options
* when multiple flags are combined in the same option.
*
* @param string|array $values The value(s) to look for in the raw parameters (can be an array)
* @param string|bool|int|float|array|null $default The default value to return if no result is found
* @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
*
* @return mixed
*/
public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false);
/**
* Binds the current Input instance with the given arguments and options.
*
* @return void
*
* @throws RuntimeException
*/
public function bind(InputDefinition $definition);
/**
* Validates the input.
*
* @return void
*
* @throws RuntimeException When not enough arguments are given
*/
public function validate();
/**
* Returns all the given arguments merged with the default values.
*