Vite
extends Facade
in package
Table of Contents
Properties
- $container : Container
- $instance : mixed
Methods
- __callStatic() : mixed
- clearInstance() : void
- テスト用: ファサードがキャッシュしている解決済みインスタンスを破棄する。
- generateHtml() : string
- generateReactRefreshHtml() : string
- getDevServerUrl() : string
- getEnvironment() : "development"|"production"
- getInstance() : mixed
- get service instance
- setContainer() : void
- swap() : void
- テスト用: サービスインスタンスをスタブ等へ差し替える。
- getServiceAlias() : string
- getServiceInstance() : mixed
- isCache() : bool
Properties
$container
protected
static Container
$container
$instance
protected
static mixed
$instance
Methods
__callStatic()
public
static __callStatic(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
- $method : string
- $arguments : array<string|int, mixed>
clearInstance()
テスト用: ファサードがキャッシュしている解決済みインスタンスを破棄する。
public
static clearInstance() : void
isCache() が true のファサードは解決済みインスタンスを静的プロパティ $instance に 保持するため、コンテナ側だけを差し替えても反映されない。本メソッドでキャッシュを 無効化し、次回アクセスでコンテナから再解決させる。
generateHtml()
public
static generateHtml(string|array<string|int, string> $entrypoints[, array<string|int, mixed> $options = = '[]' ]) : string
ViteのHTMLを生成
Parameters
- $entrypoints : string|array<string|int, string>
- $options : array<string|int, mixed> = = '[]'
Return values
stringgenerateReactRefreshHtml()
public
static generateReactRefreshHtml() : string
React RefreshのHTMLを生成
Return values
stringgetDevServerUrl()
public
static getDevServerUrl() : string
開発サーバーのURLを取得
Return values
stringgetEnvironment()
public
static getEnvironment() : "development"|"production"
現在の Vite の動作モードの値を出力します(development または production)
Return values
"development"|"production"getInstance()
get service instance
public
static getInstance() : mixed
setContainer()
public
static setContainer(Container $container) : void
Parameters
- $container : Container
swap()
テスト用: サービスインスタンスをスタブ等へ差し替える。
public
static swap(object $instance) : void
DI コンテナのエイリアスを差し替えたうえで、ファサードがキャッシュしている解決済み インスタンス(isCache() が true の場合)を破棄し、次回アクセス時に差し替え後の インスタンスを再解決させる。テスト後は元のインスタンスを渡して再度呼び出し復元する。
Parameters
- $instance : object
getServiceAlias()
protected
static getServiceAlias() : string
Return values
stringgetServiceInstance()
protected
static getServiceInstance(string $alias) : mixed
Parameters
- $alias : string
isCache()
protected
static isCache() : bool