From e284ede9d2a27329978c7e0ad21564c1cba02aee Mon Sep 17 00:00:00 2001 From: Noel Light-Hilary Date: Thu, 5 Apr 2018 09:36:46 +0100 Subject: [PATCH] #167 - minor tweaks for readability and code style consistency --- .../Compiler/AddHandlerPass.php | 2 -- Service/EventListener.php | 1 - Service/EventListenerInterface.php | 8 +++--- Service/iOSFeedback.php | 1 - .../DependencyInjection/ConfigurationTest.php | 25 ++++++++++--------- Tests/Message/AndroidMessageTest.php | 3 +-- Tests/Message/BlackberryMessageTest.php | 3 +-- Tests/Message/MacMessageTest.php | 3 +-- Tests/Message/WindowsphoneMessageTest.php | 3 +-- Tests/Message/iOSMessageTest.php | 4 +-- 10 files changed, 22 insertions(+), 31 deletions(-) diff --git a/DependencyInjection/Compiler/AddHandlerPass.php b/DependencyInjection/Compiler/AddHandlerPass.php index 3151328..a8861c1 100644 --- a/DependencyInjection/Compiler/AddHandlerPass.php +++ b/DependencyInjection/Compiler/AddHandlerPass.php @@ -4,9 +4,7 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface, Symfony\Component\DependencyInjection\ContainerBuilder, - Symfony\Component\DependencyInjection\Definition, Symfony\Component\DependencyInjection\Reference, - RMS\PushNotificationsBundle\Device\Types, Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; class AddHandlerPass implements CompilerPassInterface diff --git a/Service/EventListener.php b/Service/EventListener.php index bfe8ba2..d761812 100644 --- a/Service/EventListener.php +++ b/Service/EventListener.php @@ -2,7 +2,6 @@ namespace RMS\PushNotificationsBundle\Service; - class EventListener { /** diff --git a/Service/EventListenerInterface.php b/Service/EventListenerInterface.php index 22d107d..b90f28f 100644 --- a/Service/EventListenerInterface.php +++ b/Service/EventListenerInterface.php @@ -1,8 +1,8 @@ process(array()); + $this->process(array()); + $this->addToAssertionCount(1); // Implicitly 'asserting' no exceptions at this point } /** @@ -20,7 +21,7 @@ public function testAddingAndroidKeyRequiresValues() $arr = array( array("android" => "~"), ); - $config = $this->process($arr); + $this->process($arr); } /** @@ -33,7 +34,7 @@ public function testAndroidRequiresUsername() "android" => array("c2dm" => array("password" => "foo")) ), ); - $config = $this->process($arr); + $this->process($arr); } /** @@ -46,7 +47,7 @@ public function testAndroidRequiresPassword() "android" => array("c2dm" => array("username" => "foo")) ), ); - $config = $this->process($arr); + $this->process($arr); } public function testOldFullAndroid() @@ -100,7 +101,7 @@ public function testGCMRequiresAPIKey() ) ), ); - $config = $this->process($arr); + $this->process($arr); } public function testGCMIsOK() @@ -133,7 +134,7 @@ public function testAddingiOsKeyRequiresValues() $arr = array( array("ios" => "~"), ); - $config = $this->process($arr); + $this->process($arr); } /** @@ -146,7 +147,7 @@ public function testiOSRequiresPEM() "ios" => array("pem" => "") ), ); - $config = $this->process($arr); + $this->process($arr); } public function testFulliOS() @@ -172,7 +173,7 @@ public function testAddingMacKeyRequiresValues() $arr = array( array("mac" => "~"), ); - $config = $this->process($arr); + $this->process($arr); } /** @@ -185,7 +186,7 @@ public function testMacRequiresPEM() "mac" => array("pem" => "") ), ); - $config = $this->process($arr); + $this->process($arr); } public function testFullMac() @@ -213,7 +214,7 @@ public function testBlackberryRequiresAppID() "blackberry" => array("password" => "foo") ), ); - $config = $this->process($arr); + $this->process($arr); } /** @@ -226,7 +227,7 @@ public function testBlackberryRequiresPassword() "blackberry" => array("app_id" => "foo") ), ); - $config = $this->process($arr); + $this->process($arr); } public function testFullBlackberry() @@ -254,7 +255,7 @@ public function testAddingWindowsKeyRequiresValues() "windowsphone" => "~" ), ); - $config = $this->process($arr); + $this->process($arr); } public function testFullWindows() diff --git a/Tests/Message/AndroidMessageTest.php b/Tests/Message/AndroidMessageTest.php index 62d8c76..bbdf295 100644 --- a/Tests/Message/AndroidMessageTest.php +++ b/Tests/Message/AndroidMessageTest.php @@ -3,8 +3,7 @@ namespace RMS\PushNotificationsBundle\Tests\Message; use RMS\PushNotificationsBundle\Device\Types, - RMS\PushNotificationsBundle\Message\AndroidMessage, - RMS\PushNotificationsBundle\Message\MessageInterface; + RMS\PushNotificationsBundle\Message\AndroidMessage; class AndroidMessageTest extends \PHPUnit_Framework_TestCase { diff --git a/Tests/Message/BlackberryMessageTest.php b/Tests/Message/BlackberryMessageTest.php index aacd5be..17b9c34 100644 --- a/Tests/Message/BlackberryMessageTest.php +++ b/Tests/Message/BlackberryMessageTest.php @@ -3,8 +3,7 @@ namespace RMS\PushNotificationsBundle\Tests\Message; use RMS\PushNotificationsBundle\Device\Types, - RMS\PushNotificationsBundle\Message\BlackberryMessage, - RMS\PushNotificationsBundle\Message\MessageInterface; + RMS\PushNotificationsBundle\Message\BlackberryMessage; class BlackberryMessageTest extends \PHPUnit_Framework_TestCase { diff --git a/Tests/Message/MacMessageTest.php b/Tests/Message/MacMessageTest.php index a5ffaa2..ff05ffc 100644 --- a/Tests/Message/MacMessageTest.php +++ b/Tests/Message/MacMessageTest.php @@ -3,8 +3,7 @@ namespace RMS\PushNotificationsBundle\Tests\Message; use RMS\PushNotificationsBundle\Device\Types, - RMS\PushNotificationsBundle\Message\MacMessage, - RMS\PushNotificationsBundle\Message\MessageInterface; + RMS\PushNotificationsBundle\Message\MacMessage; class MacMessageTest extends \PHPUnit_Framework_TestCase { diff --git a/Tests/Message/WindowsphoneMessageTest.php b/Tests/Message/WindowsphoneMessageTest.php index ed36ba5..b8a4026 100644 --- a/Tests/Message/WindowsphoneMessageTest.php +++ b/Tests/Message/WindowsphoneMessageTest.php @@ -3,8 +3,7 @@ namespace RMS\PushNotificationsBundle\Tests\Message; use RMS\PushNotificationsBundle\Device\Types, - RMS\PushNotificationsBundle\Message\WindowsphoneMessage, - RMS\PushNotificationsBundle\Message\MessageInterface; + RMS\PushNotificationsBundle\Message\WindowsphoneMessage; class WindowsphoneMessageTest extends \PHPUnit_Framework_TestCase { diff --git a/Tests/Message/iOSMessageTest.php b/Tests/Message/iOSMessageTest.php index 49226d3..74e855b 100644 --- a/Tests/Message/iOSMessageTest.php +++ b/Tests/Message/iOSMessageTest.php @@ -3,8 +3,7 @@ namespace RMS\PushNotificationsBundle\Tests\Message; use RMS\PushNotificationsBundle\Device\Types, - RMS\PushNotificationsBundle\Message\iOSMessage, - RMS\PushNotificationsBundle\Message\MessageInterface; + RMS\PushNotificationsBundle\Message\iOSMessage; class iOSMessageTest extends \PHPUnit_Framework_TestCase { @@ -82,5 +81,4 @@ public function testMutableContentAddOk() $msg->setMutableContent(true); $this->assertEquals($expected, $msg->getMessageBody()); } - }