Notifysend report to show desktop notifications #39

merged 4 commits into from Aug 14, 2012

2 participants


A new Codesniffer report that shows a short popup message on your desktop. Very useful when phpcs is automatically executed when saving a file.

Squiz Labs member

I have no way I can currently test this and I'm not sure what conventions are used in these messages currently.

Can I trust that you have tested this thoroughly?
Are there version or OS requirements that need to be considered for notify-send (needed for the PHPCS docs)?
Should the path to notify-send actually be a PHP_CodeSniffer config setting?
Anything else I should be aware of?

Squiz Labs member

The config stuff in PHPCS is very basic. You just go ahead and use config vars in the code and handle defaults. So something like:

$path = PHP_CodeSniffer::getConfigData('notifysend_path');
if ($path === null) {
// Try default path, or maybe throw an exception telling them to set the path.

Same would go for the timeout:
$timeout = PHP_CodeSniffer::getConfigData('notifysend_timeout');
if ($timeout === null) {
$timeout = 3000;

You set those config vars like this:
phpcs --config-set notifysend_path /path/to/notify-send
phpcs --config-set notifysend_timeout 5000


I've implemented the configuration options now.

all fine

@gsherwood gsherwood merged commit 655fb64 into squizlabs:master Aug 14, 2012
Squiz Labs member

Found a linux box at work to try this one and it worked great. Thanks for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment