job-runner / symfony-notifier-adapter
Installs: 16 211
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 3
pkg:composer/job-runner/symfony-notifier-adapter
Requires
- php: ~8.3.0 || ~8.4.0 || ~8.5.0
- job-runner/job-runner: ^1.5
- symfony/notifier: ^6.0 || ^7.0 || ^8.0
Requires (Dev)
- doctrine/coding-standard: ^14.0
- phpstan/phpstan: ^2.1.32
- phpunit/phpunit: ^12.4.4
- dev-main
- 8.4.x-dev
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.0
- 0.2.0
- 0.1.0
- dev-dependabot/composer/phpstan/phpstan-tw-2.1.38
- dev-dependabot/composer/phpunit/phpunit-tw-12.5.8
- dev-dependabot/composer/phpstan/phpstan-tw-2.1.37
- dev-update-march
- dev-update-deps2025
- dev-clean
- dev-phpunit11
- dev-fezfez-patch-1
- dev-update-deps
This package is auto-updated.
Last update: 2026-02-02 07:41:04 UTC
README
This package provides a symfony/notifier adapter for JobRunner.
Installation
composer require job-runner/symfony-notifier-adapter
Usage
<?php declare(strict_types=1); use JobRunner\JobRunner\Job\CliJob; use JobRunner\JobRunner\Job\JobList; use JobRunner\JobRunner\CronJobRunner; use Symfony\Component\Notifier\Bridge\RocketChat\RocketChatTransport; use Symfony\Component\Notifier\Channel\ChatChannel; use Symfony\Component\Notifier\Notifier; use JobRunner\JobRunner\SymfonyNotifier\SymfonyNotifierEventListener; require 'vendor/autoload.php'; $rocket = new RocketChatTransport('mytoken', '#mychannel'); $rocket->setHost('chat.myhost.com'); $chat = new ChatChannel($rocket); $notifier = new Notifier(['chat' => $chat]); $jobCollection = new JobList(); $jobCollection->push(new CliJob('php ' . __DIR__ . '/tutu.php', '* * * * *')); CronJobRunner::create() ->withEventListener((new SymfonyNotifierEventListener($notifier))->withNotificationChannelFail(['chat'])) ->run($jobCollection);