Skip to content

Commit e6e1812

Browse files
committed
~rearrange files
1 parent 3ef292d commit e6e1812

36 files changed

+78
-78
lines changed

Diff for: bin/console

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ require_once __DIR__ . '/../vendor/autoload.php';
44

55
$application = new Symfony\Component\Console\Application();
66

7-
$application->add(new AlecRabbit\WCWidth\Command\GenerateTablesCommand());
7+
$application->add(new AlecRabbit\WCWidth\App\Command\GenerateTablesCommand());
88

99
$application->run();

Diff for: composer.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
"prefer-stable": true,
3030
"autoload": {
3131
"psr-4": {
32-
"AlecRabbit\\WCWidth\\Builder\\": "lib\\Builder",
33-
"AlecRabbit\\WCWidth\\Command\\": "lib\\Command",
34-
"AlecRabbit\\WCWidth\\Core\\": "lib\\Core",
32+
"AlecRabbit\\WCWidth\\App\\": "lib\\App",
3533
"AlecRabbit\\WCWidth\\Kernel\\": "src\\Kernel"
3634
},
3735
"files": [

Diff for: lib/Builder/TableBuilder.php renamed to lib/App/Builder/TableBuilder.php

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
declare(strict_types=1);
44
// 27.02.23
5-
namespace AlecRabbit\WCWidth\Builder;
5+
namespace AlecRabbit\WCWidth\App\Builder;
66

7-
use AlecRabbit\WCWidth\Core\CachingClient;
8-
use AlecRabbit\WCWidth\Core\CategoryParser;
9-
use AlecRabbit\WCWidth\Core\Contract\ICachingClient;
10-
use AlecRabbit\WCWidth\Core\Contract\ICategoryParser;
11-
use AlecRabbit\WCWidth\Core\Contract\IFileSaver;
12-
use AlecRabbit\WCWidth\Core\Contract\ITableHeaderExtractor;
13-
use AlecRabbit\WCWidth\Core\Contract\ITableProcessor;
14-
use AlecRabbit\WCWidth\Core\Contract\ITemplateRenderer;
15-
use AlecRabbit\WCWidth\Core\FileSaver;
16-
use AlecRabbit\WCWidth\Core\Logger;
17-
use AlecRabbit\WCWidth\Core\TableHeaderExtractor;
18-
use AlecRabbit\WCWidth\Core\TableProcessor;
19-
use AlecRabbit\WCWidth\Core\TemplateRenderer;
7+
use AlecRabbit\WCWidth\App\Core\CachingClient;
8+
use AlecRabbit\WCWidth\App\Core\CategoryParser;
9+
use AlecRabbit\WCWidth\App\Core\Contract\ICachingClient;
10+
use AlecRabbit\WCWidth\App\Core\Contract\ICategoryParser;
11+
use AlecRabbit\WCWidth\App\Core\Contract\IFileSaver;
12+
use AlecRabbit\WCWidth\App\Core\Contract\ITableHeaderExtractor;
13+
use AlecRabbit\WCWidth\App\Core\Contract\ITableProcessor;
14+
use AlecRabbit\WCWidth\App\Core\Contract\ITemplateRenderer;
15+
use AlecRabbit\WCWidth\App\Core\FileSaver;
16+
use AlecRabbit\WCWidth\App\Core\Logger;
17+
use AlecRabbit\WCWidth\App\Core\TableHeaderExtractor;
18+
use AlecRabbit\WCWidth\App\Core\TableProcessor;
19+
use AlecRabbit\WCWidth\App\Core\TemplateRenderer;
2020

2121
final class TableBuilder
2222
{

Diff for: lib/Command/GenerateTablesCommand.php renamed to lib/App/Command/GenerateTablesCommand.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
declare(strict_types=1);
44

5-
namespace AlecRabbit\WCWidth\Command;
5+
namespace AlecRabbit\WCWidth\App\Command;
66

7-
use AlecRabbit\WCWidth\Builder\TableBuilder;
8-
use AlecRabbit\WCWidth\Core\Logger;
9-
use AlecRabbit\WCWidth\Core\Output\OutputAdapter;
10-
use AlecRabbit\WCWidth\Core\TemplateRenderer;
7+
use AlecRabbit\WCWidth\App\Builder\TableBuilder;
8+
use AlecRabbit\WCWidth\App\Core\Logger;
9+
use AlecRabbit\WCWidth\App\Core\Output\OutputAdapter;
10+
use AlecRabbit\WCWidth\App\Core\TemplateRenderer;
1111
use Symfony\Component\Console\Command\Command;
1212
use Symfony\Component\Console\Input\InputInterface;
1313
use Symfony\Component\Console\Input\InputOption;

Diff for: lib/Core/CachingClient.php renamed to lib/App/Core/CachingClient.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44
// 27.02.23
5-
namespace AlecRabbit\WCWidth\Core;
5+
namespace AlecRabbit\WCWidth\App\Core;
66

7-
use AlecRabbit\WCWidth\Core\Contract\ICachingClient;
7+
use AlecRabbit\WCWidth\App\Core\Contract\ICachingClient;
88
use Exception;
99
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
1010
use Symfony\Component\HttpClient\HttpClient;

Diff for: lib/Core/CategoryParser.php renamed to lib/App/Core/CategoryParser.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44
// 28.02.23
5-
namespace AlecRabbit\WCWidth\Core;
5+
namespace AlecRabbit\WCWidth\App\Core;
66

7-
use AlecRabbit\WCWidth\Core\Contract\ICategoryParser;
7+
use AlecRabbit\WCWidth\App\Core\Contract\ICategoryParser;
88

99
use function trim;
1010

Diff for: lib/Core/Contract/ICachingClient.php renamed to lib/App/Core/Contract/ICachingClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44
// 27.02.23
5-
namespace AlecRabbit\WCWidth\Core\Contract;
5+
namespace AlecRabbit\WCWidth\App\Core\Contract;
66

77
interface ICachingClient
88
{

Diff for: lib/Core/Contract/ICategoryParser.php renamed to lib/App/Core/Contract/ICategoryParser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44
// 27.02.23
5-
namespace AlecRabbit\WCWidth\Core\Contract;
5+
namespace AlecRabbit\WCWidth\App\Core\Contract;
66

77
interface ICategoryParser
88
{

Diff for: lib/Core/Contract/IFileDefinition.php renamed to lib/App/Core/Contract/IFileDefinition.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44
// 28.02.23
5-
namespace AlecRabbit\WCWidth\Core\Contract;
5+
namespace AlecRabbit\WCWidth\App\Core\Contract;
66

77
interface IFileDefinition
88
{
@@ -12,4 +12,4 @@ public function getTemplate(): string;
1212

1313
public function getData(): mixed;
1414

15-
}
15+
}

Diff for: lib/Core/Contract/IFileSaver.php renamed to lib/App/Core/Contract/IFileSaver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44
// 28.02.23
5-
namespace AlecRabbit\WCWidth\Core\Contract;
5+
namespace AlecRabbit\WCWidth\App\Core\Contract;
66

77
interface IFileSaver
88
{

Diff for: lib/Core/Contract/ILogger.php renamed to lib/App/Core/Contract/ILogger.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44
// 01.03.23
5-
namespace AlecRabbit\WCWidth\Core\Contract;
5+
namespace AlecRabbit\WCWidth\App\Core\Contract;
66

77
interface ILogger
88
{

Diff for: lib/Core/Contract/IOutput.php renamed to lib/App/Core/Contract/IOutput.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44
// 01.03.23
5-
namespace AlecRabbit\WCWidth\Core\Contract;
5+
namespace AlecRabbit\WCWidth\App\Core\Contract;
66

77
interface IOutput
88
{

Diff for: lib/Core/Contract/ITableEntry.php renamed to lib/App/Core/Contract/ITableEntry.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44
// 01.03.23
5-
namespace AlecRabbit\WCWidth\Core\Contract;
5+
namespace AlecRabbit\WCWidth\App\Core\Contract;
66

77
interface ITableEntry
88
{

Diff for: lib/Core/Contract/ITableHeaderExtractor.php renamed to lib/App/Core/Contract/ITableHeaderExtractor.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44
// 27.02.23
5-
namespace AlecRabbit\WCWidth\Core\Contract;
5+
namespace AlecRabbit\WCWidth\App\Core\Contract;
66

77
interface ITableHeaderExtractor
88
{
99
public function extractHeader(string $url): TableHeader;
10-
}
10+
}

Diff for: lib/Core/Contract/ITableProcessor.php renamed to lib/App/Core/Contract/ITableProcessor.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44
// 27.02.23
5-
namespace AlecRabbit\WCWidth\Core\Contract;
5+
namespace AlecRabbit\WCWidth\App\Core\Contract;
66

77
interface ITableProcessor
88
{
99
public function process(iterable $data): iterable;
10-
}
10+
}

Diff for: lib/Core/Contract/ITemplateRenderer.php renamed to lib/App/Core/Contract/ITemplateRenderer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44
// 28.02.23
5-
namespace AlecRabbit\WCWidth\Core\Contract;
5+
namespace AlecRabbit\WCWidth\App\Core\Contract;
66

77
interface ITemplateRenderer
88
{

Diff for: lib/Core/Contract/TableHeader.php renamed to lib/App/Core/Contract/TableHeader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44
// 02.03.23
5-
namespace AlecRabbit\WCWidth\Core\Contract;
5+
namespace AlecRabbit\WCWidth\App\Core\Contract;
66

77
final readonly class TableHeader
88
{

Diff for: lib/Core/FileDefinition.php renamed to lib/App/Core/FileDefinition.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44
// 28.02.23
5-
namespace AlecRabbit\WCWidth\Core;
5+
namespace AlecRabbit\WCWidth\App\Core;
66

7-
use AlecRabbit\WCWidth\Core\Contract\IFileDefinition;
7+
use AlecRabbit\WCWidth\App\Core\Contract\IFileDefinition;
88

99
final class FileDefinition implements IFileDefinition
1010
{

Diff for: lib/Core/FileSaver.php renamed to lib/App/Core/FileSaver.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22

33
declare(strict_types=1);
44
// 01.03.23
5-
namespace AlecRabbit\WCWidth\Core;
5+
namespace AlecRabbit\WCWidth\App\Core;
66

7-
use AlecRabbit\WCWidth\Core\Contract\IFileSaver;
7+
use AlecRabbit\WCWidth\App\Core\Contract\IFileSaver;
88

99
final class FileSaver implements IFileSaver
1010
{
11+
public function __construct(
12+
protected string $directory = __DIR__ . '/../../.rendered/',
13+
) {
14+
}
15+
1116

1217
public function save(string $filename, string $content): void
1318
{
14-
$file = $this->getDir() . $filename;
19+
$file = $this->directory . $filename;
1520
Logger::debug(sprintf('Saving file: %s', $file));
1621
file_put_contents(
1722
$file,
1823
$content
1924
);
2025
}
21-
22-
private function getDir(): string
23-
{
24-
return __DIR__ . '/../.rendered/';
25-
}
26-
}
26+
}

Diff for: lib/Core/Logger.php renamed to lib/App/Core/Logger.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44
// 01.03.23
5-
namespace AlecRabbit\WCWidth\Core;
5+
namespace AlecRabbit\WCWidth\App\Core;
66

7-
use AlecRabbit\WCWidth\Core\Contract\ILogger;
8-
use AlecRabbit\WCWidth\Core\Contract\IOutput;
7+
use AlecRabbit\WCWidth\App\Core\Contract\ILogger;
8+
use AlecRabbit\WCWidth\App\Core\Contract\IOutput;
99
use LogicException;
1010

1111
final class Logger implements ILogger

Diff for: lib/Core/Output/NullOutput.php renamed to lib/App/Core/Output/NullOutput.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44
// 01.03.23
5-
namespace AlecRabbit\WCWidth\Core\Output;
5+
namespace AlecRabbit\WCWidth\App\Core\Output;
66

7-
use AlecRabbit\WCWidth\Core\Contract\IOutput;
7+
use AlecRabbit\WCWidth\App\Core\Contract\IOutput;
88

99
final class NullOutput implements IOutput
1010
{
@@ -17,4 +17,4 @@ public function writeln(iterable|string $messages, int $options = 0): void
1717
{
1818
// do nothing
1919
}
20-
}
20+
}

Diff for: lib/Core/Output/OutputAdapter.php renamed to lib/App/Core/Output/OutputAdapter.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44
// 01.03.23
5-
namespace AlecRabbit\WCWidth\Core\Output;
5+
namespace AlecRabbit\WCWidth\App\Core\Output;
66

7-
use AlecRabbit\WCWidth\Core\Contract\IOutput;
7+
use AlecRabbit\WCWidth\App\Core\Contract\IOutput;
88
use Symfony\Component\Console\Output\OutputInterface;
99

1010
final class OutputAdapter implements IOutput
@@ -28,4 +28,4 @@ public function writeln(iterable|string $messages, ?int $options = null): void
2828
{
2929
$this->output->writeln($messages, self::refineOptions($options));
3030
}
31-
}
31+
}

Diff for: lib/Core/TableEntry.php renamed to lib/App/Core/TableEntry.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44
// 28.02.23
5-
namespace AlecRabbit\WCWidth\Core;
5+
namespace AlecRabbit\WCWidth\App\Core;
66

7-
use AlecRabbit\WCWidth\Core\Contract\ITableEntry;
7+
use AlecRabbit\WCWidth\App\Core\Contract\ITableEntry;
88

99
final readonly class TableEntry implements ITableEntry
1010
{

Diff for: lib/Core/TableHeaderExtractor.php renamed to lib/App/Core/TableHeaderExtractor.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
declare(strict_types=1);
44
// 01.03.23
55

6-
namespace AlecRabbit\WCWidth\Core;
6+
namespace AlecRabbit\WCWidth\App\Core;
77

8-
use AlecRabbit\WCWidth\Core\Contract\ICachingClient;
9-
use AlecRabbit\WCWidth\Core\Contract\TableHeader;
8+
use AlecRabbit\WCWidth\App\Core\Contract\ICachingClient;
9+
use AlecRabbit\WCWidth\App\Core\Contract\TableHeader;
1010
use RuntimeException;
1111

1212
final class TableHeaderExtractor implements Contract\ITableHeaderExtractor

Diff for: lib/Core/TableProcessor.php renamed to lib/App/Core/TableProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44
// 01.03.23
55

6-
namespace AlecRabbit\WCWidth\Core;
6+
namespace AlecRabbit\WCWidth\App\Core;
77

88
final class TableProcessor implements Contract\ITableProcessor
99
{

Diff for: lib/Core/TableRow.php renamed to lib/App/Core/TableRow.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44
// 28.02.23
5-
namespace AlecRabbit\WCWidth\Core;
5+
namespace AlecRabbit\WCWidth\App\Core;
66

77
final class TableRow
88
{

Diff for: lib/Core/TemplateRenderer.php renamed to lib/App/Core/TemplateRenderer.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44
// 28.02.23
5-
namespace AlecRabbit\WCWidth\Core;
5+
namespace AlecRabbit\WCWidth\App\Core;
66

7-
use AlecRabbit\WCWidth\Core\Contract\ITemplateRenderer;
7+
use AlecRabbit\WCWidth\App\Core\Contract\ITemplateRenderer;
88
use InvalidArgumentException;
99
use Twig\Environment;
1010
use Twig\Extension\DebugExtension;
@@ -21,8 +21,8 @@ final class TemplateRenderer implements ITemplateRenderer
2121

2222
public function __construct(
2323
protected array $options = self::DEFAULT_OPTIONS,
24+
protected string $dir = __DIR__ . '/../template',
2425
) {
25-
$dir = __DIR__ . '/../template';
2626
$loader = new FilesystemLoader($dir);
2727

2828
$debug = $options['debug'] ?? false;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: src/Kernel/version.php

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use function getenv;
1111
use function is_string;
1212

13+
// @codeCoverageIgnoreStart
1314
$version = getenv('UNICODE_VERSION');
1415

1516
if (is_string($version)) {
@@ -19,3 +20,4 @@
1920
// silently ignore
2021
}
2122
}
23+
// @codeCoverageIgnoreEnd

0 commit comments

Comments
 (0)