From 2912c1a70baac4731f991123b44df6c729b4a1c0 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Wed, 19 Dec 2012 10:43:40 -0600 Subject: [PATCH] [#3218] CS fixes - whitespace after operators - use identity operator when testing against null - array/argument indentation --- .../Zend/Code/Generator/DocBlock/Tag/LicenseTag.php | 8 +++----- .../Code/Generator/DocBlockTagGeneratorTest.php | 12 ++++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php b/library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php index 9eb934875fe..36500b234b2 100644 --- a/library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php +++ b/library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php @@ -19,7 +19,6 @@ */ class LicenseTag extends Tag { - /** * @var string */ @@ -36,7 +35,7 @@ public function __construct(array $options = array()) $this->setUrl($options['url']); } - if(empty($this->name)) { + if (empty($this->name)) { $this->setName('license'); } } @@ -88,9 +87,8 @@ public function getUrl() public function generate() { $output = '@' . $this->name - . (($this->url != null) ? ' ' . $this->url : '') - . (($this->description != null) ? ' ' . $this->description : ''); + . (($this->url !== null) ? ' ' . $this->url : '') + . (($this->description !== null) ? ' ' . $this->description : ''); return $output; } - } diff --git a/tests/ZendTest/Code/Generator/DocBlockTagGeneratorTest.php b/tests/ZendTest/Code/Generator/DocBlockTagGeneratorTest.php index e0ed40df0d8..9b9ddedfcc6 100644 --- a/tests/ZendTest/Code/Generator/DocBlockTagGeneratorTest.php +++ b/tests/ZendTest/Code/Generator/DocBlockTagGeneratorTest.php @@ -50,10 +50,14 @@ public function testCanPassDescriptionToConstructor() public function testCanGenerateLicenseTag() { - $tag = new LicenseTag(array('url' => 'http://test.license.com', - 'description' => 'Test License')); - $this->assertEquals('@license http://test.license.com Test License', - $tag->generate()); + $tag = new LicenseTag(array( + 'url' => 'http://test.license.com', + 'description' => 'Test License', + )); + $this->assertEquals( + '@license http://test.license.com Test License', + $tag->generate() + ); } public function testNameGetterAndSetterPersistValue()