Skip to content

Commit

Permalink
Docs update.
Browse files Browse the repository at this point in the history
  • Loading branch information
LastDragon-ru committed Nov 15, 2024
1 parent bae8740 commit fd327ad
Show file tree
Hide file tree
Showing 10 changed files with 378 additions and 80 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ This package provides highly powerful [`@searchBy`](packages/graphql/docs/Direct

## (Laravel) Intl Formatter

This package provides a customizable wrapper around [Intl](https://www.php.net/manual/en/book.intl) formatters to use it inside Laravel application.
This package provides a customizable wrapper around [Intl](https://www.php.net/manual/en/book.intl) formatters to use it inside Laravel application. And also allows defining own.

[Read more](<packages/formatter/README.md>).

Expand Down
24 changes: 12 additions & 12 deletions packages/dev/src/App/Example.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace LastDragon_ru\LaraASP\Dev\App;

use Illuminate\Contracts\Config\Repository;
use Illuminate\Contracts\Foundation\Application;
use LastDragon_ru\LaraASP\Core\Application\ApplicationResolver;
use LastDragon_ru\LaraASP\Core\Utils\ConfigMerger;
use LastDragon_ru\LaraASP\Core\Application\Configuration\Configuration;
use LastDragon_ru\LaraASP\Core\Application\Configuration\ConfigurationResolver;
use LastDragon_ru\LaraASP\Documentator\Processor\FileSystem\File;
use LastDragon_ru\LaraASP\Documentator\Processor\Tasks\Preprocess\Instructions\IncludeExample\Contracts\Runner;
use LastDragon_ru\LaraASP\Documentator\Utils\Text;
Expand Down Expand Up @@ -83,6 +83,8 @@ public function __invoke(File $file): ?string {
$result = "<markdown>{$output}</markdown>";
}
} finally {
self::$app->forgetScopedInstances();

self::$app = null;
self::$file = null;
self::$dumper = null;
Expand Down Expand Up @@ -113,17 +115,15 @@ protected static function app(): Application {
}

/**
* @param array<string, mixed> $settings
* @template T of Configuration
*
* @param class-string<ConfigurationResolver<T>> $resolver
* @param callable(T): void|null $callback
*/
public static function config(string $root, array $settings): void {
// Update
$repository = self::app()->make(Repository::class);
$config = (array) $repository->get($root, []);
$config = (new ConfigMerger())->merge([ConfigMerger::Strict => false], $config, $settings);

$repository->set([
$root => $config,
]);
public static function config(string $resolver, ?callable $callback): void {
if ($callback !== null) {
$callback(self::app()->make($resolver)->getInstance());
}
}

private static function getExpression(string $method): ?string {
Expand Down
Loading

0 comments on commit fd327ad

Please sign in to comment.