mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Add isFlushed() to Kernel interface
Also add explicit return type
This commit is contained in:
parent
e962608918
commit
c82d11ef70
@ -188,7 +188,7 @@ abstract class BaseKernel implements Kernel
|
||||
$this->getIncludeTests(),
|
||||
$flush
|
||||
);
|
||||
|
||||
|
||||
// Flush config
|
||||
if ($flush) {
|
||||
$config = $this->getConfigLoader()->getManifest();
|
||||
@ -265,7 +265,7 @@ abstract class BaseKernel implements Kernel
|
||||
|
||||
abstract public function boot($flush = false);
|
||||
|
||||
abstract public function isFlushed();
|
||||
abstract public function isFlushed(): ?bool;
|
||||
|
||||
/**
|
||||
* Check if there's a legacy _ss_environment.php file
|
||||
|
@ -15,11 +15,8 @@ class CoreKernel extends BaseKernel
|
||||
|
||||
/**
|
||||
* Indicates whether the Kernel has been flushed on boot
|
||||
* Uninitialised before boot
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $flush;
|
||||
private ?bool $flush = null;
|
||||
|
||||
/**
|
||||
* @param false $flush
|
||||
@ -217,12 +214,7 @@ class CoreKernel extends BaseKernel
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the Kernel has been flushed on boot
|
||||
*
|
||||
* @return bool|null null if the kernel hasn't been booted yet
|
||||
*/
|
||||
public function isFlushed()
|
||||
public function isFlushed(): ?bool
|
||||
{
|
||||
return $this->flush;
|
||||
}
|
||||
|
@ -16,11 +16,9 @@ class DatabaselessKernel extends BaseKernel
|
||||
{
|
||||
/**
|
||||
* Indicates whether the Kernel has been flushed on boot
|
||||
* Uninitialised before boot
|
||||
*
|
||||
* @var bool
|
||||
* Null before boot
|
||||
*/
|
||||
private $flush;
|
||||
private ?bool $flush = null;
|
||||
|
||||
/**
|
||||
* Allows disabling of the configured error handling.
|
||||
@ -53,10 +51,7 @@ class DatabaselessKernel extends BaseKernel
|
||||
$this->setBooted(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isFlushed()
|
||||
public function isFlushed(): ?bool
|
||||
{
|
||||
return $this->flush;
|
||||
}
|
||||
|
@ -132,4 +132,11 @@ interface Kernel
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnvironment($environment);
|
||||
|
||||
/**
|
||||
* Returns whether the Kernel has been flushed on boot
|
||||
*
|
||||
* @return bool|null null if the kernel hasn't been booted yet
|
||||
*/
|
||||
public function isFlushed(): ?bool;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user