mirror of
https://github.com/pestphp/pest.git
synced 2026-06-11 21:48:26 +02:00
fix: duplicated team city output
This commit is contained in:
@ -15,15 +15,20 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
final readonly class EnsureTeamCityEnabled implements ConfiguredSubscriber
|
final class EnsureTeamCityEnabled implements ConfiguredSubscriber
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Indicates if the TeamCity logger has already been registered.
|
||||||
|
*/
|
||||||
|
private static bool $registered = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new Configured Subscriber instance.
|
* Creates a new Configured Subscriber instance.
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private InputInterface $input,
|
private readonly InputInterface $input,
|
||||||
private OutputInterface $output,
|
private readonly OutputInterface $output,
|
||||||
private TestSuite $testSuite,
|
private readonly TestSuite $testSuite,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -31,10 +36,16 @@ final readonly class EnsureTeamCityEnabled implements ConfiguredSubscriber
|
|||||||
*/
|
*/
|
||||||
public function notify(Configured $event): void
|
public function notify(Configured $event): void
|
||||||
{
|
{
|
||||||
|
if (self::$registered) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (! $this->input->hasParameterOption('--teamcity')) {
|
if (! $this->input->hasParameterOption('--teamcity')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self::$registered = true;
|
||||||
|
|
||||||
$flowId = getenv('FLOW_ID');
|
$flowId = getenv('FLOW_ID');
|
||||||
$flowId = is_string($flowId) ? (int) $flowId : getmypid();
|
$flowId = is_string($flowId) ? (int) $flowId : getmypid();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user