Skip to content

Commit

Permalink
Testing ideas
Browse files Browse the repository at this point in the history
  • Loading branch information
JustSteveKing committed May 16, 2023
1 parent fc36ba7 commit 218b42c
Show file tree
Hide file tree
Showing 17 changed files with 523 additions and 109 deletions.
10 changes: 10 additions & 0 deletions src/Commands/DefaultCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace Minicli\Framework\Commands;

final class DefaultCommand
{
public string $signature = 'default';
}
52 changes: 52 additions & 0 deletions src/Commands/PendingCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

declare(strict_types=1);

namespace Minicli\Framework\Commands;

use Minicli\Framework\Exceptions\MinicliNamingException;
use Minicli\Framework\Minicli;

final class PendingCommand
{
public function __construct(
protected string $command,
protected array $arguments = [],
protected array $flags = [],
) {}

public static function build(array $arguments = []): PendingCommand
{
if (count($arguments) < 2) {
var_dump('Run Default Command.');
die();
}

unset($arguments[0]);

$args = array_filter(
array: $arguments,
callback: fn (string $argument): bool => ! str_contains(
haystack: $argument,
needle: '--',
),
);

$flags = array_filter(
array: $arguments,
callback: fn (string $argument): bool => str_contains(
haystack: $argument,
needle: '--',
),
);

// $reflection = new Re

$command = $args[1];
unset($args[1]);
// do we have any flags?
// wh
var_dump($args, $flags, $command);
die();
}
}
40 changes: 0 additions & 40 deletions src/Configuration/Config.php

This file was deleted.

10 changes: 10 additions & 0 deletions src/Contracts/Output/PrinterContract.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace Minicli\Framework\Contracts\Output;

interface PrinterContract
{
public function print(string $message): string;
}
10 changes: 10 additions & 0 deletions src/Contracts/Theme/MiniEnum.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace Minicli\Framework\Contracts\Theme;

interface MiniEnum
{
//
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,55 @@

declare(strict_types=1);

namespace Minicli\Framework\Theme;

use StringBackedEnum;
namespace Minicli\Framework\Contracts\Theme;

interface ThemeContract
{
/**
* Default style
* @return array<int,StringBackedEnum>
* @return array<int,MiniEnum>
*/
public function default(): array;

/**
* Alternative style for Default
* @return array<int,StringBackedEnum>
* @return array<int,MiniEnum>
*/
public function alt(): array;

/**
* Error style
* @return array<int,StringBackedEnum>
* @return array<int,MiniEnum>
*/
public function error(): array;

/**
* Alternative style for Error
* @return array<int,StringBackedEnum>
* @return array<int,MiniEnum>
*/
public function errorAlt(): array;

/**
* Success style
* @return array<int,StringBackedEnum>
* @return array<int,MiniEnum>
*/
public function success(): array;

/**
* Alternative style for Success
* @return array<int,StringBackedEnum>
* @return array<int,MiniEnum>
*/
public function successAlt(): array;

/**
* Info style
* @return array<int,StringBackedEnum>
* @return array<int,MiniEnum>
*/
public function info(): array;

/**
* Alternative style for Info
* @return array<int,StringBackedEnum>
* @return array<int,MiniEnum>
*/
public function infoAlt(): array;
}
Loading

0 comments on commit 218b42c

Please sign in to comment.