fix namespacing

This commit is contained in:
myrmidex 2026-08-22 20:00:35 +02:00
parent 699279888a
commit bdf707c296
5 changed files with 10 additions and 25 deletions

View file

@ -3,8 +3,8 @@
require __DIR__ . '/../autoload.php';
use Lvl0\AnagramFinder\Core\Matcher;
use Myrmidex\AnagramFinder\ArgHandler;
use Myrmidex\AnagramFinder\Output;
use Lvl0\AnagramFinder\TUI\ArgHandler;
use Lvl0\AnagramFinder\TUI\Output;
const DICTIONARY = __DIR__ . '/../assets/words.txt';

View file

@ -1,16 +0,0 @@
<?php
require __DIR__ . '/../autoload.php';
use Myrmidex\AnagramFinder\Matcher;
// are letters in word?
$anagram = "eamstexil";
$word = "steam";
assert(Matcher::check(anagram: $anagram, word: $word) === true);
$anagram = "eamstexil";
$word = "xxx";
assert(Matcher::check(anagram: $anagram, word: $word) === false);

View file

@ -9,8 +9,8 @@
"license": "AGPL-3.0-only",
"autoload": {
"psr-4": {
"Myrmidex\\AnagramFinder\\": "src/",
"Myrmidex\\AnagramFinder\\Tests\\": "tests/"
"Lvl0\\AnagramFinder\\TUI\\": "src/",
"Lvl0\\AnagramFinder\\TUI\\Tests\\": "tests/"
}
},
"authors": [

View file

@ -1,6 +1,6 @@
<?php
namespace Myrmidex\AnagramFinder;
namespace Lvl0\AnagramFinder\TUI;
use Illuminate\Support\Collection;
@ -21,13 +21,14 @@ class ArgHandler
public function get(int $index)
{
return $this->args
->reject(fn ($word) => substr($word, 0, 2) === '--')
->reject(fn($word) => substr($word, 0, 2) === '--')
->get($index);
}
public function hasOption(string $option) {
public function hasOption(string $option)
{
return $this->args
->filter(fn ($word) => $word === '--' . $option)
->filter(fn($word) => $word === '--' . $option)
->isNotEmpty();
}
}

View file

@ -1,6 +1,6 @@
<?php
namespace Myrmidex\AnagramFinder;
namespace Lvl0\AnagramFinder\TUI;
class Output
{