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 063ebe9 commit 0d697de
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
{

/**
* @var string
*/
Expand All @@ -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');
}
}
Expand Down Expand Up @@ -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;
}

}
12 changes: 8 additions & 4 deletions tests/ZendTest/Code/Generator/DocBlockTagGeneratorTest.php
Expand Up @@ -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()
Expand Down

0 comments on commit 0d697de

Please sign in to comment.