Skip to content

Commit 5bcb94e

Browse files
committed
update some for flag parse
1 parent bdc17b9 commit 5bcb94e

File tree

3 files changed

+37
-10
lines changed

3 files changed

+37
-10
lines changed

src/FlagsParser.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,16 @@ protected function parseRawArgs(array $rawArgs): array
283283
return $args;
284284
}
285285

286+
/**
287+
* @param mixed|null $default
288+
*
289+
* @return mixed|null
290+
*/
291+
public function getFirstArg($default = null)
292+
{
293+
return $this->getArg(0, $default);
294+
}
295+
286296
public function resetResults(): void
287297
{
288298
// clear match results

src/Helper/ValueCollector.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Toolkit\PFlag\Helper;
4+
5+
use Toolkit\PFlag\FlagsParser;
6+
7+
/**
8+
* class ValueCollector
9+
*/
10+
class ValueCollector
11+
{
12+
/**
13+
* @return $this
14+
*/
15+
public function new(): self
16+
{
17+
return new self();
18+
}
19+
20+
/**
21+
* @param FlagsParser $fs
22+
*/
23+
public function collect(FlagsParser $fs): void
24+
{
25+
26+
}
27+
}

src/SFlags.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -872,16 +872,6 @@ public function getArg($nameOrIndex, $default = null)
872872
return $default ?? FlagType::getDefault($define['type']);
873873
}
874874

875-
/**
876-
* @param mixed|null $default
877-
*
878-
* @return mixed|null
879-
*/
880-
public function getFirstArg($default = null)
881-
{
882-
return $this->getArg(0, $default);
883-
}
884-
885875
/**
886876
* @param string|int $nameOrIndex
887877
*

0 commit comments

Comments
 (0)