Skip to content

Commit

Permalink
chore: Add Sprout facade
Browse files Browse the repository at this point in the history
  • Loading branch information
ollieread committed Dec 15, 2024
1 parent c40aa25 commit a92444d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
"laravel": {
"providers": [
"Sprout\\SproutServiceProvider"
],
"facades":[
"Sprout\\Facades\\Sprout"
]
}
},
Expand Down
49 changes: 49 additions & 0 deletions src/Facades/Sprout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
declare(strict_types=1);

namespace Sprout\Facades;

use Illuminate\Support\Facades\Facade;
use Sprout\Contracts\ServiceOverride;
use Sprout\Contracts\Tenancy;
use Sprout\Contracts\Tenant;
use Sprout\Managers\IdentityResolverManager;
use Sprout\Managers\ProviderManager;
use Sprout\Support\ResolutionHook;

/**
* Sprout Facade
*
* @method static void bootOverrides()
* @method static void cleanupOverrides(Tenancy $tenancy, Tenant $tenant)
* @method static mixed config(string $key, mixed $default = null)
* @method static array<Tenancy> getAllCurrentTenancies()
* @method static array<ServiceOverride> getCurrentOverrides(?Tenancy $tenancy = null)
* @method static Tenancy|null getCurrentTenancy()
* @method static array<string, ServiceOverride> getOverrides()
* @method static array<string> getRegisteredOverrides()
* @method static bool hasBootedOverride(string $class)
* @method static bool hasCurrentTenancy()
* @method static bool hasOverride(string $class)
* @method static bool hasRegisteredOverride(string $class)
* @method static bool hasSetupOverride(Tenancy $tenancy, string $class)
* @method static bool haveOverridesBooted()
* @method static bool isBootableOverride(string $class)
* @method static \Sprout\Sprout markAsInContext()
* @method static \Sprout\Sprout markAsOutsideContext()
* @method static ProviderManager providers()
* @method static \Sprout\Sprout registerOverride(string $class)
* @method static IdentityResolverManager resolvers()
* @method static void setCurrentTenancy(Tenancy $tenancy)
* @method static void setupOverrides(Tenancy $tenancy, Tenant $tenant)
* @method static bool supportsHook(ResolutionHook $hook)
* @method static \Sprout\Managers\TenancyManager tenancies()
* @method static bool withinContext()
*/
final class Sprout extends Facade
{
protected static function getFacadeAccessor(): string

Check warning on line 45 in src/Facades/Sprout.php

View check run for this annotation

Codecov / codecov/patch

src/Facades/Sprout.php#L45

Added line #L45 was not covered by tests
{
return \Sprout\Sprout::class;

Check warning on line 47 in src/Facades/Sprout.php

View check run for this annotation

Codecov / codecov/patch

src/Facades/Sprout.php#L47

Added line #L47 was not covered by tests
}
}

0 comments on commit a92444d

Please sign in to comment.