From 3d9cb7cad9ffeacf888945816ea90a3de7bda567 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Thu, 21 Apr 2022 16:20:57 +0300 Subject: [PATCH] Bump dev dependencies --- app/main/Concerns/Contains.php | 2 +- app/main/Concerns/Excludes.php | 4 ++-- app/main/Concerns/Storable.php | 2 +- app/main/Concerns/Template.php | 5 +---- app/main/Processors/AddLocale.php | 2 +- app/main/Processors/Download.php | 4 ++-- app/main/Processors/Excludes.php | 2 +- app/main/Processors/Git.php | 2 +- app/main/Processors/Keys.php | 2 +- app/main/Processors/Processor.php | 9 ++++----- app/main/Processors/Referents.php | 2 +- app/main/Processors/Statuses/Locales.php | 2 +- app/main/Processors/Statuses/Processor.php | 4 ++-- app/main/Services/Filesystem/Base.php | 6 +++--- app/main/Services/Filesystem/Json.php | 9 +++------ app/main/Services/Filesystem/Markdown.php | 2 +- app/main/Support/Package.php | 2 +- composer.json | 14 +++++++------- tests/Development/JsonTest.php | 6 ++---- tests/Development/StatusLocalesTest.php | 2 +- tests/Development/StatusTest.php | 2 +- tests/Development/TestCase.php | 18 ++++++++---------- tests/Production/TestCase.php | 4 ++-- 23 files changed, 48 insertions(+), 59 deletions(-) diff --git a/app/main/Concerns/Contains.php b/app/main/Concerns/Contains.php index e82329df..9c67f28f 100644 --- a/app/main/Concerns/Contains.php +++ b/app/main/Concerns/Contains.php @@ -2,7 +2,7 @@ namespace LaravelLang\Development\Concerns; -use DragonCode\Support\Facades\Helpers\Filesystem\Directory; +use DragonCode\Support\Facades\Filesystem\Directory; use DragonCode\Support\Facades\Helpers\Str; use LaravelLang\Development\Constants\Locales; diff --git a/app/main/Concerns/Excludes.php b/app/main/Concerns/Excludes.php index d40a4604..c080d4c6 100644 --- a/app/main/Concerns/Excludes.php +++ b/app/main/Concerns/Excludes.php @@ -3,7 +3,7 @@ namespace LaravelLang\Development\Concerns; use DragonCode\PrettyArray\Services\File as PrettyFile; -use DragonCode\Support\Facades\Helpers\Filesystem\File; +use DragonCode\Support\Facades\Filesystem\File; /** @mixin \LaravelLang\Development\Processors\Processor */ trait Excludes @@ -13,7 +13,7 @@ trait Excludes protected function hasExclude(string $value, string $locale): bool { return $this->hasExcludeValue($locale, $value) - || $this->hasExcludeValue('_all', $value); + || $this->hasExcludeValue('_all', $value); } protected function hasExcludeValue(string $key, string $value): bool diff --git a/app/main/Concerns/Storable.php b/app/main/Concerns/Storable.php index d5d2639c..2e45640d 100644 --- a/app/main/Concerns/Storable.php +++ b/app/main/Concerns/Storable.php @@ -2,7 +2,7 @@ namespace LaravelLang\Development\Concerns; -use DragonCode\Support\Facades\Helpers\Instance; +use DragonCode\Support\Facades\Instances\Instance; use DragonCode\Support\Tools\Stub; use LaravelLang\Development\Contracts\Stringable; diff --git a/app/main/Concerns/Template.php b/app/main/Concerns/Template.php index 964172ea..814a3284 100644 --- a/app/main/Concerns/Template.php +++ b/app/main/Concerns/Template.php @@ -2,7 +2,6 @@ namespace LaravelLang\Development\Concerns; -use DragonCode\PrettyArray\Services\File; use DragonCode\Support\Facades\Helpers\Str; trait Template @@ -29,9 +28,7 @@ trait Template return static::$templates[$filename]; } - $template = File::make()->loadRaw( - $this->templatePath($filename) - ); + $template = file_get_contents($this->templatePath($filename)); return static::$templates[$filename] = $trim ? trim($template) : $template; } diff --git a/app/main/Processors/AddLocale.php b/app/main/Processors/AddLocale.php index 561c0140..6b180bba 100644 --- a/app/main/Processors/AddLocale.php +++ b/app/main/Processors/AddLocale.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace LaravelLang\Development\Processors; -use DragonCode\Support\Facades\Helpers\Filesystem\File; +use DragonCode\Support\Facades\Filesystem\File; use RuntimeException; class AddLocale extends Processor diff --git a/app/main/Processors/Download.php b/app/main/Processors/Download.php index 07103e1e..81db0eb7 100644 --- a/app/main/Processors/Download.php +++ b/app/main/Processors/Download.php @@ -2,7 +2,7 @@ namespace LaravelLang\Development\Processors; -use DragonCode\Support\Facades\Helpers\Filesystem\Directory; +use DragonCode\Support\Facades\Filesystem\Directory; use GuzzleHttp\Client; use RuntimeException; use ZipArchive; @@ -30,7 +30,7 @@ class Download extends Processor ]; public function __construct( - protected Client $client = new Client(), + protected Client $client = new Client(), protected ZipArchive $zip = new ZipArchive() ) { } diff --git a/app/main/Processors/Excludes.php b/app/main/Processors/Excludes.php index 2bc02ac0..98061bef 100644 --- a/app/main/Processors/Excludes.php +++ b/app/main/Processors/Excludes.php @@ -2,8 +2,8 @@ namespace LaravelLang\Development\Processors; +use DragonCode\Support\Facades\Filesystem\File; use DragonCode\Support\Facades\Helpers\Arr; -use DragonCode\Support\Facades\Helpers\Filesystem\File; class Excludes extends Processor { diff --git a/app/main/Processors/Git.php b/app/main/Processors/Git.php index 1b77cc49..33f393c9 100644 --- a/app/main/Processors/Git.php +++ b/app/main/Processors/Git.php @@ -2,7 +2,7 @@ namespace LaravelLang\Development\Processors; -use DragonCode\Support\Facades\Helpers\Filesystem\Directory; +use DragonCode\Support\Facades\Filesystem\Directory; class Git extends Processor { diff --git a/app/main/Processors/Keys.php b/app/main/Processors/Keys.php index 54d78de9..d181ee73 100644 --- a/app/main/Processors/Keys.php +++ b/app/main/Processors/Keys.php @@ -2,7 +2,7 @@ namespace LaravelLang\Development\Processors; -use DragonCode\Support\Facades\Helpers\Filesystem\File; +use DragonCode\Support\Facades\Filesystem\File; class Keys extends Processor { diff --git a/app/main/Processors/Processor.php b/app/main/Processors/Processor.php index bfbd0d90..9c11c12e 100644 --- a/app/main/Processors/Processor.php +++ b/app/main/Processors/Processor.php @@ -3,10 +3,9 @@ namespace LaravelLang\Development\Processors; use DragonCode\Support\Concerns\Makeable; -use DragonCode\Support\Facades\Helpers\Ables\Arrayable; +use DragonCode\Support\Facades\Filesystem\Directory; +use DragonCode\Support\Facades\Filesystem\File; use DragonCode\Support\Facades\Helpers\Arr; -use DragonCode\Support\Facades\Helpers\Filesystem\Directory; -use DragonCode\Support\Facades\Helpers\Filesystem\File; use DragonCode\Support\Tools\Stub; use JetBrains\PhpStorm\Pure; use LaravelLang\Development\Application; @@ -82,10 +81,10 @@ abstract class Processor implements Processable { $files = File::names($this->getSourcePath(), recursive: true); - $file = Arrayable::of($files) + $file = Arr::of($files) ->filter(fn ($name) => str_contains($name, $filename)) ->values() - ->get(); + ->toArray(); return $this->load($this->getSourcePath($file[0])); } diff --git a/app/main/Processors/Referents.php b/app/main/Processors/Referents.php index ed69315c..39484bca 100644 --- a/app/main/Processors/Referents.php +++ b/app/main/Processors/Referents.php @@ -2,7 +2,7 @@ namespace LaravelLang\Development\Processors; -use DragonCode\Support\Facades\Helpers\Filesystem\Directory; +use DragonCode\Support\Facades\Filesystem\Directory; use LaravelLang\Development\Concerns\Template; use LaravelLang\Development\Constants\Referents as Constants; use LaravelLang\Development\Contracts\Stringable; diff --git a/app/main/Processors/Statuses/Locales.php b/app/main/Processors/Statuses/Locales.php index dd514937..e9f3b4a6 100644 --- a/app/main/Processors/Statuses/Locales.php +++ b/app/main/Processors/Statuses/Locales.php @@ -2,7 +2,7 @@ namespace LaravelLang\Development\Processors\Statuses; -use DragonCode\Support\Facades\Helpers\Filesystem\Directory; +use DragonCode\Support\Facades\Filesystem\Directory; use DragonCode\Support\Facades\Helpers\Str; use LaravelLang\Development\Constants\Resource; use LaravelLang\Development\Contracts\Stringable; diff --git a/app/main/Processors/Statuses/Processor.php b/app/main/Processors/Statuses/Processor.php index 9252ab40..b530a2cd 100644 --- a/app/main/Processors/Statuses/Processor.php +++ b/app/main/Processors/Statuses/Processor.php @@ -3,9 +3,9 @@ namespace LaravelLang\Development\Processors\Statuses; use DragonCode\Support\Facades\Callbacks\Sorter; +use DragonCode\Support\Facades\Filesystem\Directory; +use DragonCode\Support\Facades\Filesystem\File; use DragonCode\Support\Facades\Helpers\Arr; -use DragonCode\Support\Facades\Helpers\Filesystem\Directory; -use DragonCode\Support\Facades\Helpers\Filesystem\File; use LaravelLang\Development\Concerns\Countable; use LaravelLang\Development\Concerns\Excludes; use LaravelLang\Development\Concerns\Template; diff --git a/app/main/Services/Filesystem/Base.php b/app/main/Services/Filesystem/Base.php index ce930ead..4218e759 100644 --- a/app/main/Services/Filesystem/Base.php +++ b/app/main/Services/Filesystem/Base.php @@ -3,7 +3,7 @@ namespace LaravelLang\Development\Services\Filesystem; use DragonCode\Support\Concerns\Makeable; -use DragonCode\Support\Facades\Helpers\Ables\Arrayable; +use DragonCode\Support\Facades\Helpers\Arr; use LaravelLang\Development\Application; use LaravelLang\Development\Concerns\Storable; use LaravelLang\Development\Contracts\Filesystem; @@ -31,9 +31,9 @@ abstract class Base implements Filesystem { $callback = static fn ($value) => stripslashes($value); - return Arrayable::of($items) + return Arr::of($items) ->map($callback, true) ->renameKeys($callback) - ->get(); + ->toArray(); } } diff --git a/app/main/Services/Filesystem/Json.php b/app/main/Services/Filesystem/Json.php index d83e3f78..88cf2496 100644 --- a/app/main/Services/Filesystem/Json.php +++ b/app/main/Services/Filesystem/Json.php @@ -2,8 +2,7 @@ namespace LaravelLang\Development\Services\Filesystem; -use DragonCode\PrettyArray\Services\File as Pretty; -use DragonCode\Support\Facades\Helpers\Arr; +use DragonCode\Support\Facades\Filesystem\File; use DragonCode\Support\Tools\Stub; use LaravelLang\Development\Contracts\Stringable; @@ -11,9 +10,7 @@ class Json extends Base { public function load(string $path): array { - $content = Pretty::make()->loadRaw($path); - - $items = json_decode($content, true); + $items = File::load($path); return $this->correctValues($items); } @@ -24,6 +21,6 @@ class Json extends Base $content = array_values($content); } - Arr::storeAsJson($path, $content, false, JSON_UNESCAPED_UNICODE ^ JSON_UNESCAPED_SLASHES ^ JSON_PRETTY_PRINT); + file_put_contents($path, json_encode($content, JSON_UNESCAPED_UNICODE ^ JSON_UNESCAPED_SLASHES ^ JSON_PRETTY_PRINT)); } } diff --git a/app/main/Services/Filesystem/Markdown.php b/app/main/Services/Filesystem/Markdown.php index fcd63d1a..03a208be 100644 --- a/app/main/Services/Filesystem/Markdown.php +++ b/app/main/Services/Filesystem/Markdown.php @@ -2,7 +2,7 @@ namespace LaravelLang\Development\Services\Filesystem; -use DragonCode\Support\Facades\Helpers\Filesystem\File; +use DragonCode\Support\Facades\Filesystem\File; use DragonCode\Support\Tools\Stub; use LaravelLang\Development\Contracts\Stringable; diff --git a/app/main/Support/Package.php b/app/main/Support/Package.php index dd8c5dd7..e013b00b 100644 --- a/app/main/Support/Package.php +++ b/app/main/Support/Package.php @@ -2,7 +2,7 @@ namespace LaravelLang\Development\Support; -use DragonCode\Support\Facades\Helpers\Filesystem\Directory; +use DragonCode\Support\Facades\Filesystem\Directory; use DragonCode\Support\Facades\Helpers\Str; class Package diff --git a/composer.json b/composer.json index 8718ffe5..c8a3eee6 100644 --- a/composer.json +++ b/composer.json @@ -24,19 +24,19 @@ "require-dev": { "php": "^8.1", "ext-zip": "*", - "dragon-code/pretty-array": "^3.0", - "dragon-code/simple-dto": "^2.2", - "dragon-code/support": "^5.6", + "dragon-code/pretty-array": "^4.0", + "dragon-code/simple-dto": "^2.3", + "dragon-code/support": "^6.1", "guzzlehttp/guzzle": "^7.3", - "laravel-lang/publisher": "^12.1", + "laravel-lang/publisher": "^13.0", "laravel/breeze": "^1.2", "laravel/fortify": "^1.7", "laravel/jetstream": "^2.3", "laravel/ui": "^3.4", - "orchestra/testbench": "^5.0 || ^6.0 || ^7.0", + "orchestra/testbench": "^7.0", "phpunit/phpunit": "^9.5", - "symfony/finder": "^5.2 || ^6.0", - "symfony/var-dumper": "^5.2 || ^6.0", + "symfony/finder": "^6.0", + "symfony/var-dumper": "^6.0", "vlucas/phpdotenv": "^5.4.1" }, "conflict": { diff --git a/tests/Development/JsonTest.php b/tests/Development/JsonTest.php index 9854a8f0..865e7ec4 100644 --- a/tests/Development/JsonTest.php +++ b/tests/Development/JsonTest.php @@ -2,7 +2,7 @@ namespace Tests\Development; -use DragonCode\PrettyArray\Services\File as Pretty; +use DragonCode\Support\Facades\Filesystem\File; class JsonTest extends TestCase { @@ -25,9 +25,7 @@ class JsonTest extends TestCase protected function load(string $path): array { - $content = Pretty::make()->loadRaw($path); - - $items = json_decode($content, true); + $items = File::load($path); return $this->correctValues($items); } diff --git a/tests/Development/StatusLocalesTest.php b/tests/Development/StatusLocalesTest.php index 72ffa143..8142691a 100644 --- a/tests/Development/StatusLocalesTest.php +++ b/tests/Development/StatusLocalesTest.php @@ -2,7 +2,7 @@ namespace Tests\Development; -use DragonCode\Support\Facades\Helpers\Filesystem\Directory; +use DragonCode\Support\Facades\Filesystem\Directory; use DragonCode\Support\Facades\Helpers\Str; class StatusLocalesTest extends TestCase diff --git a/tests/Development/StatusTest.php b/tests/Development/StatusTest.php index ac5e97fc..08dfb41c 100644 --- a/tests/Development/StatusTest.php +++ b/tests/Development/StatusTest.php @@ -2,7 +2,7 @@ namespace Tests\Development; -use DragonCode\Support\Facades\Helpers\Filesystem\Directory; +use DragonCode\Support\Facades\Filesystem\Directory; use DragonCode\Support\Facades\Helpers\Str; class StatusTest extends TestCase diff --git a/tests/Development/TestCase.php b/tests/Development/TestCase.php index 648086b4..104211a2 100644 --- a/tests/Development/TestCase.php +++ b/tests/Development/TestCase.php @@ -2,11 +2,9 @@ namespace Tests\Development; -use DragonCode\PrettyArray\Services\File; -use DragonCode\Support\Facades\Helpers\Ables\Arrayable; +use DragonCode\Support\Facades\Filesystem\Directory; +use DragonCode\Support\Facades\Filesystem\File as Filesystem; use DragonCode\Support\Facades\Helpers\Arr; -use DragonCode\Support\Facades\Helpers\Filesystem\Directory; -use DragonCode\Support\Facades\Helpers\Filesystem\File as Filesystem; use DragonCode\Support\Facades\Helpers\Str; use JetBrains\PhpStorm\Pure; use LaravelLang\Development\Constants\Locales; @@ -28,11 +26,11 @@ abstract class TestCase extends BaseTestCase if ($this->isValidation($filename)) { $custom = Arr::get($content, 'custom', []); - return Arrayable::of($content) + return Arr::of($content) ->except(['attributes', 'custom']) ->ksort() ->merge(compact('custom')) - ->get(); + ->toArray(); } return Arr::ksort($content); @@ -58,7 +56,7 @@ abstract class TestCase extends BaseTestCase protected function assertSee(string $path, string $content): void { - $file = File::make()->loadRaw($path); + $file = file_get_contents($path); $this->assertTrue( str_contains($file, $content), @@ -68,7 +66,7 @@ abstract class TestCase extends BaseTestCase protected function assertDoesntSee(string $path, string|array $content): void { - $file = File::make()->loadRaw($path); + $file = file_get_contents($path); $values = Arr::wrap($content); @@ -140,9 +138,9 @@ abstract class TestCase extends BaseTestCase { $callback = static fn ($value) => stripslashes($value); - return Arrayable::of($items) + return Arr::of($items) ->map($callback, true) ->renameKeys($callback) - ->get(); + ->toArray(); } } diff --git a/tests/Production/TestCase.php b/tests/Production/TestCase.php index 28e0692d..20a7ade2 100644 --- a/tests/Production/TestCase.php +++ b/tests/Production/TestCase.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace Tests\Production; -use DragonCode\Support\Facades\Helpers\Filesystem\Directory; -use DragonCode\Support\Facades\Helpers\Filesystem\File; +use DragonCode\Support\Facades\Filesystem\Directory; +use DragonCode\Support\Facades\Filesystem\File; use Illuminate\Support\Facades\Artisan; use LaravelLang\Publisher\Concerns\Has; use LaravelLang\Publisher\Concerns\Paths;