-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1748 from andrey-helldar/patch/2021-05-13/20-09
Splitting projects
- Loading branch information
Showing
661 changed files
with
120,122 additions
and
59,658 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
<?php | ||
|
||
use LaravelLang\Lang\Processors\Json; | ||
use LaravelLang\Lang\Processors\Php; | ||
use LaravelLang\Lang\Processors\Process; | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
/** @var \LaravelLang\Lang\Application $app */ | ||
$app = require_once __DIR__ . '/bootstrap/app.php'; | ||
|
||
$app->processor(Json::make()); | ||
$app->processor(Php::make()); | ||
$app->processor(Process::make()); |
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
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,8 @@ | ||
<?php | ||
|
||
namespace LaravelLang\Lang\Constants; | ||
|
||
final class Locales | ||
{ | ||
public const ENGLISH = 'en'; | ||
} |
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,32 @@ | ||
<?php | ||
|
||
namespace LaravelLang\Lang\Facades; | ||
|
||
use Helldar\Support\Facades\BaseFacade; | ||
use LaravelLang\Lang\Support\Finder; | ||
use LaravelLang\Lang\Support\Package as Support; | ||
use LaravelLang\Lang\Support\Parser; | ||
use Symfony\Component\Finder\Finder as SymfonyFinder; | ||
|
||
/** | ||
* @method static Support some() | ||
*/ | ||
class Package extends BaseFacade | ||
{ | ||
protected static function getFacadeAccessor(): Support | ||
{ | ||
return new Support(self::resolveFinder(), self::resolveParser()); | ||
} | ||
|
||
protected static function resolveFinder(): Finder | ||
{ | ||
$finder = SymfonyFinder::create(); | ||
|
||
return Finder::make($finder); | ||
} | ||
|
||
protected static function resolveParser(): Parser | ||
{ | ||
return Parser::make(); | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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,46 @@ | ||
<?php | ||
|
||
namespace LaravelLang\Lang\Processors; | ||
|
||
use Helldar\Support\Facades\Helpers\Arr; | ||
use LaravelLang\Lang\Facades\Package; | ||
|
||
final class Packages extends Processor | ||
{ | ||
protected array $packages = [ | ||
'laravel/fortify' => 'packages/fortify.json', | ||
'laravel/jetstream' => 'packages/jetstream.json', | ||
]; | ||
|
||
public function run(): void | ||
{ | ||
foreach ($this->packages as $package => $filename) { | ||
$items = $this->files($package); | ||
|
||
$path = $this->getSourcePath($filename); | ||
|
||
$content = $this->map($items); | ||
|
||
$this->sort($content); | ||
|
||
$this->store($path, $content); | ||
} | ||
} | ||
|
||
protected function map(array $items): array | ||
{ | ||
return Arr::renameKeys($items, static fn ($key, $value) => $value); | ||
} | ||
|
||
protected function files(string $package): array | ||
{ | ||
$path = $this->vendorPath($package); | ||
|
||
return Package::some()->path($path)->content(); | ||
} | ||
|
||
protected function vendorPath(string $package): string | ||
{ | ||
return $this->app->path('vendor/' . $package); | ||
} | ||
} |
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.