| Total Complexity | 3 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | class RepositoryAware extends ConfigAware |
||
| 26 | { |
||
| 27 | /** |
||
| 28 | * Runtime resolver to check for PHAR or lib execution |
||
| 29 | * |
||
| 30 | * @var \CaptainHook\App\Console\Runtime\Resolver |
||
| 31 | */ |
||
| 32 | protected $resolver; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * RepositoryAware constructor |
||
| 36 | * |
||
| 37 | * @param \CaptainHook\App\Console\Runtime\Resolver $resolver |
||
| 38 | */ |
||
| 39 | public function __construct(Resolver $resolver) |
||
| 40 | { |
||
| 41 | $this->resolver = $resolver; |
||
| 42 | parent::__construct(); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Configure method to setup the git-directory command option |
||
| 47 | * |
||
| 48 | * @return void |
||
| 49 | */ |
||
| 50 | protected function configure(): void |
||
| 51 | { |
||
| 52 | parent::configure(); |
||
| 53 | |||
| 54 | $this->addOption( |
||
| 55 | 'git-directory', |
||
| 56 | 'g', |
||
| 57 | InputOption::VALUE_OPTIONAL, |
||
| 58 | 'Path to your .git directory' |
||
| 59 | ); |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Create a new git repository representation |
||
| 64 | * |
||
| 65 | * @param string $path |
||
| 66 | * @return \SebastianFeldmann\Git\Repository |
||
| 67 | */ |
||
| 68 | protected function createRepository(string $path): Repository |
||
| 71 | } |
||
| 72 | } |
||
| 73 |