Files
php-flasher/src/Cli/Prime/Notifier/KDialogBaseNotifier.php
T
KHOUBZA Younes ac6d046c63 Prepare v1.0 release
rename template adapter to flasher, and add title to base notification class

Wip
2022-05-16 08:18:15 +01:00

49 lines
957 B
PHP

<?php
/*
* This file is part of the PHPFlasher package.
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
*/
namespace Flasher\Cli\Prime\Notifier;
use Flasher\Cli\Prime\Notification;
use Flasher\Cli\Prime\System\Command;
use Flasher\Cli\Prime\System\OS;
final class KDialogBaseNotifier extends BaseNotifier
{
/**
* {@inheritdoc}
*/
public function send($notification)
{
$notification = Notification::wrap($notification);
$cmd = new Command($this->getProgram());
$cmd
->addOption('--passivepopup', $notification->getMessage())
->addOption('--title', $notification->getTitle())
->addArgument(5);
$cmd->run();
}
/**
* {@inheritdoc}
*/
public function isSupported()
{
return OS::isUnix() && $this->getProgram();
}
/**
* {@inheritdoc}
*/
public function getBinary()
{
return 'kdialog';
}
}