-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
…ni config attribute; files observer is created using container now
- Loading branch information
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buggregator\Trap\Config\Server\Files; | ||
|
||
use Buggregator\Trap\Service\FilesObserver\FrameConverter; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
abstract class ObserverConfig | ||
{ | ||
/* @var non-empty-string|null $path */ | ||
public ?string $path = null; | ||
|
||
/** @var class-string<FrameConverter>|null $converter */ | ||
public ?string $converterClass = null; | ||
|
||
/** @var float Scan interval in seconds */ | ||
public float $scanInterval = 5.0; | ||
|
||
/** | ||
* @psalm-assert-if-true non-empty-string $this->path | ||
* @psalm-assert-if-true class-string<FrameConverter> $this->converterClass | ||
*/ | ||
public function isValid(): bool | ||
{ | ||
return $this->path !== null && $this->converterClass !== null && $this->path !== '' | ||
&& \is_a($this->converterClass, FrameConverter::class, true) && $this->scanInterval > 0.0; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buggregator\Trap\Config\Server\Files; | ||
|
||
use Buggregator\Trap\Service\Config\PhpIni; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class SPX extends ObserverConfig | ||
{ | ||
/** @var non-empty-string|null Path to SPX files */ | ||
#[PhpIni('spx.data_dir')] | ||
public ?string $path = null; | ||
Check failure on line 16 in src/Config/Server/Files/SPX.php GitHub Actions / static-analysis (ubuntu-latest, 8.2, locked)NonInvariantDocblockPropertyType
Check failure on line 16 in src/Config/Server/Files/SPX.php GitHub Actions / static-analysis (ubuntu-latest, 8.2, locked)NonInvariantDocblockPropertyType
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buggregator\Trap\Config\Server\Files; | ||
|
||
use Buggregator\Trap\Service\Config\PhpIni; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class XDebug extends ObserverConfig | ||
{ | ||
/** @var non-empty-string|null Path to XDebug files */ | ||
#[PhpIni('xdebug.output_dir')] | ||
public ?string $path = null; | ||
Check failure on line 16 in src/Config/Server/Files/XDebug.php GitHub Actions / static-analysis (ubuntu-latest, 8.2, locked)NonInvariantDocblockPropertyType
Check failure on line 16 in src/Config/Server/Files/XDebug.php GitHub Actions / static-analysis (ubuntu-latest, 8.2, locked)NonInvariantDocblockPropertyType
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buggregator\Trap\Config\Server\Files; | ||
|
||
use Buggregator\Trap\Service\Config\PhpIni; | ||
use Buggregator\Trap\Service\FilesObserver\Filter\XHProf as Converter; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class XHProf extends ObserverConfig | ||
{ | ||
/** @var non-empty-string|null Path to XHProf files */ | ||
#[PhpIni('xhprof.output_dir')] | ||
public ?string $path = null; | ||
Check failure on line 17 in src/Config/Server/Files/XHProf.php GitHub Actions / static-analysis (ubuntu-latest, 8.2, locked)NonInvariantDocblockPropertyType
Check failure on line 17 in src/Config/Server/Files/XHProf.php GitHub Actions / static-analysis (ubuntu-latest, 8.2, locked)NonInvariantDocblockPropertyType
|
||
|
||
public ?string $converterClass = Converter::class; | ||
Check failure on line 19 in src/Config/Server/Files/XHProf.php GitHub Actions / static-analysis (ubuntu-latest, 8.2, locked)NonInvariantDocblockPropertyType
Check failure on line 19 in src/Config/Server/Files/XHProf.php GitHub Actions / static-analysis (ubuntu-latest, 8.2, locked)NonInvariantDocblockPropertyType
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buggregator\Trap\Service\Config; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)] | ||
final class PhpIni implements ConfigAttribute | ||
{ | ||
public function __construct( | ||
public string $option, | ||
) {} | ||
} |