Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
[#3218] CS fixes
Browse files Browse the repository at this point in the history
- whitespace after operators
- use identity operator when testing against null
- array/argument indentation
  • Loading branch information
weierophinney committed Dec 19, 2012
1 parent d411daa commit 2912c1a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 3 additions & 5 deletions library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
Expand Up @@ -19,7 +19,6 @@
*/ */
class LicenseTag extends Tag class LicenseTag extends Tag
{ {

/** /**
* @var string * @var string
*/ */
Expand All @@ -36,7 +35,7 @@ public function __construct(array $options = array())
$this->setUrl($options['url']); $this->setUrl($options['url']);
} }


if(empty($this->name)) { if (empty($this->name)) {
$this->setName('license'); $this->setName('license');
} }
} }
Expand Down Expand Up @@ -88,9 +87,8 @@ public function getUrl()
public function generate() public function generate()
{ {
$output = '@' . $this->name $output = '@' . $this->name
. (($this->url != null) ? ' ' . $this->url : '') . (($this->url !== null) ? ' ' . $this->url : '')
. (($this->description != null) ? ' ' . $this->description : ''); . (($this->description !== null) ? ' ' . $this->description : '');
return $output; return $output;
} }

} }
12 changes: 8 additions & 4 deletions tests/ZendTest/Code/Generator/DocBlockTagGeneratorTest.php
Expand Up @@ -50,10 +50,14 @@ public function testCanPassDescriptionToConstructor()


public function testCanGenerateLicenseTag() public function testCanGenerateLicenseTag()
{ {
$tag = new LicenseTag(array('url' => 'http://test.license.com', $tag = new LicenseTag(array(
'description' => 'Test License')); 'url' => 'http://test.license.com',
$this->assertEquals('@license http://test.license.com Test License', 'description' => 'Test License',
$tag->generate()); ));
$this->assertEquals(
'@license http://test.license.com Test License',
$tag->generate()
);
} }


public function testNameGetterAndSetterPersistValue() public function testNameGetterAndSetterPersistValue()
Expand Down

0 comments on commit 2912c1a

Please sign in to comment.