Skip to content

Commit

Permalink
Update the CS to PHP 7.4+
Browse files Browse the repository at this point in the history
  • Loading branch information
lyrixx committed Dec 1, 2021
1 parent 535d9ed commit 8b812a6
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 95 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -6,6 +6,5 @@

# Tools
/build/
/.php_cs.cache
/.php-cs-fixer.cache
/.phpunit.result.cache
12 changes: 6 additions & 6 deletions .php-cs-fixer.php
Expand Up @@ -10,13 +10,13 @@
*/

$fileHeaderComment = <<<'EOF'
This file is part of the JoliNotif project.
This file is part of the JoliNotif project.
(c) Loïck Piera <pyrech@gmail.com>
(c) Loïck Piera <pyrech@gmail.com>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
Expand All @@ -30,7 +30,7 @@
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP71Migration' => true,
'@PHP74Migration' => true,
'@PhpCsFixer' => true,
'php_unit_internal_class' => false, // From @PhpCsFixer but we don't want it
'php_unit_test_class_requires_covers' => false, // From @PhpCsFixer but we don't want it
Expand Down
14 changes: 7 additions & 7 deletions tests/NotificationTest.php
Expand Up @@ -32,15 +32,15 @@ public function testItExtractsIconFromPhar()
}

$bootstrap = <<<'PHAR_BOOTSTRAP'
<?php
<?php
require __DIR__.'/vendor/autoload.php';
require __DIR__.'/vendor/autoload.php';
$iconPath = '/{{ THE_ICON }}';
$notification = new \Joli\JoliNotif\Notification();
$notification->setBody('My notification');
$notification->setIcon(__DIR__.$iconPath);
PHAR_BOOTSTRAP;
$iconPath = '/{{ THE_ICON }}';
$notification = new \Joli\JoliNotif\Notification();
$notification->setBody('My notification');
$notification->setIcon(__DIR__.$iconPath);
PHAR_BOOTSTRAP;

$files = (new Finder())
->in("{$rootPackage}/src")
Expand Down
24 changes: 12 additions & 12 deletions tests/Notifier/AppleScriptNotifierTest.php
Expand Up @@ -57,8 +57,8 @@ protected function getNotifier(): Notifier
protected function getExpectedCommandLineForNotification(): string
{
return <<<'CLI'
'osascript' '-e' 'display notification "I'\''m the notification body"'
CLI;
'osascript' '-e' 'display notification "I'\''m the notification body"'
CLI;
}

/**
Expand All @@ -67,8 +67,8 @@ protected function getExpectedCommandLineForNotification(): string
protected function getExpectedCommandLineForNotificationWithATitle(): string
{
return <<<'CLI'
'osascript' '-e' 'display notification "I'\''m the notification body" with title "I'\''m the notification title"'
CLI;
'osascript' '-e' 'display notification "I'\''m the notification body" with title "I'\''m the notification title"'
CLI;
}

/**
Expand All @@ -77,8 +77,8 @@ protected function getExpectedCommandLineForNotificationWithATitle(): string
protected function getExpectedCommandLineForNotificationWithASubtitle(): string
{
return <<<'CLI'
'osascript' '-e' 'display notification "I'\''m the notification body" subtitle "I'\''m the notification subtitle"'
CLI;
'osascript' '-e' 'display notification "I'\''m the notification body" subtitle "I'\''m the notification subtitle"'
CLI;
}

/**
Expand All @@ -87,8 +87,8 @@ protected function getExpectedCommandLineForNotificationWithASubtitle(): string
protected function getExpectedCommandLineForNotificationWithASound(): string
{
return <<<'CLI'
'osascript' '-e' 'display notification "I'\''m the notification body" sound name "Frog"'
CLI;
'osascript' '-e' 'display notification "I'\''m the notification body" sound name "Frog"'
CLI;
}

/**
Expand All @@ -97,8 +97,8 @@ protected function getExpectedCommandLineForNotificationWithASound(): string
protected function getExpectedCommandLineForNotificationWithAnIcon(): string
{
return <<<'CLI'
'osascript' '-e' 'display notification "I'\''m the notification body"'
CLI;
'osascript' '-e' 'display notification "I'\''m the notification body"'
CLI;
}

/**
Expand All @@ -107,7 +107,7 @@ protected function getExpectedCommandLineForNotificationWithAnIcon(): string
protected function getExpectedCommandLineForNotificationWithAllOptions(): string
{
return <<<'CLI'
'osascript' '-e' 'display notification "I'\''m the notification body" with title "I'\''m the notification title" subtitle "I'\''m the notification subtitle" sound name "Frog"'
CLI;
'osascript' '-e' 'display notification "I'\''m the notification body" with title "I'\''m the notification title" subtitle "I'\''m the notification subtitle" sound name "Frog"'
CLI;
}
}
16 changes: 8 additions & 8 deletions tests/Notifier/GrowlNotifyNotifierTest.php
Expand Up @@ -45,8 +45,8 @@ protected function getNotifier(): Notifier
protected function getExpectedCommandLineForNotification(): string
{
return <<<'CLI'
'growlnotify' '--message' 'I'\''m the notification body'
CLI;
'growlnotify' '--message' 'I'\''m the notification body'
CLI;
}

/**
Expand All @@ -55,8 +55,8 @@ protected function getExpectedCommandLineForNotification(): string
protected function getExpectedCommandLineForNotificationWithATitle(): string
{
return <<<'CLI'
'growlnotify' '--message' 'I'\''m the notification body' '--title' 'I'\''m the notification title'
CLI;
'growlnotify' '--message' 'I'\''m the notification body' '--title' 'I'\''m the notification title'
CLI;
}

/**
Expand All @@ -67,8 +67,8 @@ protected function getExpectedCommandLineForNotificationWithAnIcon(): string
$iconDir = $this->getIconDir();

return <<<CLI
'growlnotify' '--message' 'I'\\''m the notification body' '--image' '{$iconDir}/image.gif'
CLI;
'growlnotify' '--message' 'I'\\''m the notification body' '--image' '{$iconDir}/image.gif'
CLI;
}

/**
Expand All @@ -79,7 +79,7 @@ protected function getExpectedCommandLineForNotificationWithAllOptions(): string
$iconDir = $this->getIconDir();

return <<<CLI
'growlnotify' '--message' 'I'\\''m the notification body' '--title' 'I'\\''m the notification title' '--image' '{$iconDir}/image.gif'
CLI;
'growlnotify' '--message' 'I'\\''m the notification body' '--title' 'I'\\''m the notification title' '--image' '{$iconDir}/image.gif'
CLI;
}
}
16 changes: 8 additions & 8 deletions tests/Notifier/KDialogNotifierTest.php
Expand Up @@ -44,8 +44,8 @@ protected function getNotifier(): Notifier
protected function getExpectedCommandLineForNotification(): string
{
return <<<'CLI'
'kdialog' '--passivepopup' 'I'\''m the notification body' '5'
CLI;
'kdialog' '--passivepopup' 'I'\''m the notification body' '5'
CLI;
}

/**
Expand All @@ -54,8 +54,8 @@ protected function getExpectedCommandLineForNotification(): string
protected function getExpectedCommandLineForNotificationWithATitle(): string
{
return <<<'CLI'
'kdialog' '--title' 'I'\''m the notification title' '--passivepopup' 'I'\''m the notification body' '5'
CLI;
'kdialog' '--title' 'I'\''m the notification title' '--passivepopup' 'I'\''m the notification body' '5'
CLI;
}

/**
Expand All @@ -64,8 +64,8 @@ protected function getExpectedCommandLineForNotificationWithATitle(): string
protected function getExpectedCommandLineForNotificationWithAnIcon(): string
{
return <<<'CLI'
'kdialog' '--passivepopup' 'I'\''m the notification body' '5'
CLI;
'kdialog' '--passivepopup' 'I'\''m the notification body' '5'
CLI;
}

/**
Expand All @@ -74,7 +74,7 @@ protected function getExpectedCommandLineForNotificationWithAnIcon(): string
protected function getExpectedCommandLineForNotificationWithAllOptions(): string
{
return <<<'CLI'
'kdialog' '--title' 'I'\''m the notification title' '--passivepopup' 'I'\''m the notification body' '5'
CLI;
'kdialog' '--title' 'I'\''m the notification title' '--passivepopup' 'I'\''m the notification body' '5'
CLI;
}
}
16 changes: 8 additions & 8 deletions tests/Notifier/NotifuNotifierTest.php
Expand Up @@ -46,8 +46,8 @@ protected function getNotifier(): Notifier
protected function getExpectedCommandLineForNotification(): string
{
return <<<'CLI'
'notifu' '/m' 'I'\''m the notification body'
CLI;
'notifu' '/m' 'I'\''m the notification body'
CLI;
}

/**
Expand All @@ -56,8 +56,8 @@ protected function getExpectedCommandLineForNotification(): string
protected function getExpectedCommandLineForNotificationWithATitle(): string
{
return <<<'CLI'
'notifu' '/m' 'I'\''m the notification body' '/p' 'I'\''m the notification title'
CLI;
'notifu' '/m' 'I'\''m the notification body' '/p' 'I'\''m the notification title'
CLI;
}

/**
Expand All @@ -68,8 +68,8 @@ protected function getExpectedCommandLineForNotificationWithAnIcon(): string
$iconDir = $this->getIconDir();

return <<<CLI
'notifu' '/m' 'I'\\''m the notification body' '/i' '{$iconDir}/image.gif'
CLI;
'notifu' '/m' 'I'\\''m the notification body' '/i' '{$iconDir}/image.gif'
CLI;
}

/**
Expand All @@ -80,7 +80,7 @@ protected function getExpectedCommandLineForNotificationWithAllOptions(): string
$iconDir = $this->getIconDir();

return <<<CLI
'notifu' '/m' 'I'\\''m the notification body' '/p' 'I'\\''m the notification title' '/i' '{$iconDir}/image.gif'
CLI;
'notifu' '/m' 'I'\\''m the notification body' '/p' 'I'\\''m the notification title' '/i' '{$iconDir}/image.gif'
CLI;
}
}
16 changes: 8 additions & 8 deletions tests/Notifier/NotifySendNotifierTest.php
Expand Up @@ -45,8 +45,8 @@ protected function getNotifier(): Notifier
protected function getExpectedCommandLineForNotification(): string
{
return <<<'CLI'
'notify-send' 'I'\''m the notification body'
CLI;
'notify-send' 'I'\''m the notification body'
CLI;
}

/**
Expand All @@ -55,8 +55,8 @@ protected function getExpectedCommandLineForNotification(): string
protected function getExpectedCommandLineForNotificationWithATitle(): string
{
return <<<'CLI'
'notify-send' 'I'\''m the notification title' 'I'\''m the notification body'
CLI;
'notify-send' 'I'\''m the notification title' 'I'\''m the notification body'
CLI;
}

/**
Expand All @@ -67,8 +67,8 @@ protected function getExpectedCommandLineForNotificationWithAnIcon(): string
$iconDir = $this->getIconDir();

return <<<CLI
'notify-send' '--icon' '{$iconDir}/image.gif' 'I'\\''m the notification body'
CLI;
'notify-send' '--icon' '{$iconDir}/image.gif' 'I'\\''m the notification body'
CLI;
}

/**
Expand All @@ -79,7 +79,7 @@ protected function getExpectedCommandLineForNotificationWithAllOptions(): string
$iconDir = $this->getIconDir();

return <<<CLI
'notify-send' '--icon' '{$iconDir}/image.gif' 'I'\\''m the notification title' 'I'\\''m the notification body'
CLI;
'notify-send' '--icon' '{$iconDir}/image.gif' 'I'\\''m the notification title' 'I'\\''m the notification body'
CLI;
}
}
16 changes: 8 additions & 8 deletions tests/Notifier/SnoreToastNotifierTest.php
Expand Up @@ -46,8 +46,8 @@ protected function getNotifier(): Notifier
protected function getExpectedCommandLineForNotification(): string
{
return <<<'CLI'
'snoretoast' '-m' 'I'\''m the notification body'
CLI;
'snoretoast' '-m' 'I'\''m the notification body'
CLI;
}

/**
Expand All @@ -56,8 +56,8 @@ protected function getExpectedCommandLineForNotification(): string
protected function getExpectedCommandLineForNotificationWithATitle(): string
{
return <<<'CLI'
'snoretoast' '-m' 'I'\''m the notification body' '-t' 'I'\''m the notification title'
CLI;
'snoretoast' '-m' 'I'\''m the notification body' '-t' 'I'\''m the notification title'
CLI;
}

/**
Expand All @@ -68,8 +68,8 @@ protected function getExpectedCommandLineForNotificationWithAnIcon(): string
$iconDir = $this->getIconDir();

return <<<CLI
'snoretoast' '-m' 'I'\\''m the notification body' '-p' '{$iconDir}/image.gif'
CLI;
'snoretoast' '-m' 'I'\\''m the notification body' '-p' '{$iconDir}/image.gif'
CLI;
}

/**
Expand All @@ -80,7 +80,7 @@ protected function getExpectedCommandLineForNotificationWithAllOptions(): string
$iconDir = $this->getIconDir();

return <<<CLI
'snoretoast' '-m' 'I'\\''m the notification body' '-t' 'I'\\''m the notification title' '-p' '{$iconDir}/image.gif'
CLI;
'snoretoast' '-m' 'I'\\''m the notification body' '-t' 'I'\\''m the notification title' '-p' '{$iconDir}/image.gif'
CLI;
}
}

0 comments on commit 8b812a6

Please sign in to comment.