Skip to content

Commit

Permalink
Add a little boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
inxilpro committed Apr 12, 2024
1 parent 8a3ee12 commit 407d47d
Show file tree
Hide file tree
Showing 12 changed files with 150 additions and 87 deletions.
26 changes: 24 additions & 2 deletions .idea/ansipants.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/blade.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
},
"autoload": {
"psr-4": {
"Glhd\\Ansipants\\": "src/"
"Glhd\\AnsiPants\\": "src/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
],
"psr-4": {
"Glhd\\Ansipants\\Tests\\": "tests/"
"Glhd\\AnsiPants\\Tests\\": "tests/"
}
},
"scripts": {
Expand All @@ -42,7 +42,7 @@
"extra": {
"laravel": {
"providers": [
"Glhd\\Ansipants\\Support\\AnsipantsServiceProvider"
"AnsiPantsServiceProvider"
]
}
},
Expand Down
12 changes: 0 additions & 12 deletions config/ansipants.php

This file was deleted.

24 changes: 24 additions & 0 deletions src/AnsiString.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Glhd\AnsiPants;

use Glhd\AnsiPants\Support\AnsiParser;
use Stringable;

class AnsiString implements Stringable
{
protected array $chars = [];

protected array $flags = [];

public function __construct(string $input)
{
$parser = new AnsiParser($input);
[$this->chars, $this->flags] = $parser->parse();
}

public function __toString(): string
{
// TODO: Implement __toString() method.
}
}
19 changes: 19 additions & 0 deletions src/Support/AnsiPantsServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Glhd\AnsiPants\Support;

use Illuminate\Contracts\Foundation\Application;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;

class AnsiPantsServiceProvider extends ServiceProvider
{
public function boot()
{
}

public function register()
{
require_once __DIR__.'/helpers.php';
}
}
19 changes: 19 additions & 0 deletions src/Support/AnsiParser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Glhd\AnsiPants\Support;

use Glhd\AnsiPants\AnsiString;
use Illuminate\Support\ServiceProvider;

class AnsiParser
{
public function __construct(
protected string $input
) {
}

public function parse(): array
{
// FIXME
}
}
67 changes: 0 additions & 67 deletions src/Support/AnsipantsServiceProvider.php

This file was deleted.

13 changes: 13 additions & 0 deletions src/Support/Facades/Ansi.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Glhd\AnsiPants\Support\Facades;

use Illuminate\Contracts\Foundation\Application;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\ServiceProvider;

class Ansi extends Facade
{

}
6 changes: 3 additions & 3 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Glhd\Ansipants\Tests;
namespace Glhd\AnsiPants\Tests;

use Glhd\Ansipants\Support\AnsipantsServiceProvider;
use Glhd\AnsiPants\Support\AnsiPantsServiceProvider;
use Illuminate\Container\Container;
use Orchestra\Testbench\TestCase as Orchestra;

Expand All @@ -11,7 +11,7 @@ abstract class TestCase extends Orchestra
protected function getPackageProviders($app)
{
return [
AnsipantsServiceProvider::class,
AnsiPantsServiceProvider::class,
];
}

Expand Down

0 comments on commit 407d47d

Please sign in to comment.