-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
176 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
* text=auto | ||
|
||
/.art export-ignore | ||
/.github export-ignore | ||
/tests export-ignore | ||
.editorconfig export-ignore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# Minicli Framework | ||
<div align="center"> | ||
<p> | ||
<img src="https://github.com/minicli/framework/raw/main/art/minicli.png" alt="Minicli" width="150"/> | ||
<h1>Minicli Framework</h1> | ||
</p> | ||
</div> | ||
|
||
This repo contains the source code for the Minicli Framework - a great way to extend the core minicli application. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Minicli\Framework\Configuration; | ||
|
||
use Minicli\Framework\Contracts\Theme\ThemeContract; | ||
|
||
final class Config | ||
{ | ||
/** | ||
* @param string $path | ||
* @param class-string<ThemeContract>|null $theme | ||
* @param bool $debug | ||
*/ | ||
public function __construct( | ||
private readonly string $path, | ||
private readonly ?string $theme = null, | ||
private readonly bool $debug = false, | ||
) { | ||
} | ||
|
||
/** | ||
* @return array{path:string,theme:class-string<ThemeContract>|null,debug:bool} | ||
*/ | ||
public function toArray(): array | ||
{ | ||
return [ | ||
'path' => $this->path, | ||
'theme' => $this->theme, | ||
'debug' => $this->debug, | ||
]; | ||
} | ||
|
||
/** | ||
* @param array{path:string,theme:class-string<ThemeContract>|null,debug:bool|null} $data | ||
* @return Config | ||
*/ | ||
public static function make(array $data): Config | ||
{ | ||
return new Config( | ||
path: $data['path'], | ||
theme: $data['theme'], | ||
debug: $data['debug'] ?? false, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.