-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
314 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
eclipse.preferences.version=1 | ||
include_path= | ||
phpVersion=php5.4 | ||
use_asp_tags_as_php=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
namespace gossi\docblock\tags; | ||
|
||
/** | ||
* Abstract tag with a description | ||
*/ | ||
abstract class AbstractDescriptionTag extends AbstractTag { | ||
|
||
protected $description; | ||
|
||
/** | ||
* Returns the description | ||
* | ||
* @return string the description | ||
*/ | ||
public function getDescription() { | ||
return $this->description; | ||
} | ||
|
||
/** | ||
* Sets the description | ||
* | ||
* @param string $description the new description | ||
* @return $this | ||
*/ | ||
public function setDescription($description) { | ||
$this->description = $description; | ||
return $this; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php | ||
namespace gossi\docblock\tags; | ||
|
||
/** | ||
* Represents a @license tag. | ||
* | ||
* @see http://www.phpdoc.org/docs/latest/references/phpdoc/tags/license.html | ||
*/ | ||
class LicenseTag extends AbstractTag { | ||
|
||
private $url; | ||
private $license; | ||
|
||
/** | ||
* Creates a new tag | ||
* | ||
* @param string $tagName the tag name | ||
* @param string $content the tags content | ||
*/ | ||
public function __construct($content = '') { | ||
parent::__construct('license', $content); | ||
} | ||
|
||
protected function parse($content) { | ||
$parts = preg_split('/\s+/Su', $content, 2); | ||
|
||
$urlCandidate = $parts[0]; | ||
if (preg_match(LinkTag::URL_REGEX, $urlCandidate)) { | ||
$this->url = $urlCandidate; | ||
$this->license = isset($parts[1]) ? $parts[1] : ''; | ||
} else { | ||
$this->license = $content; | ||
} | ||
} | ||
|
||
/** | ||
* Returns the url | ||
* | ||
* @return string the url | ||
*/ | ||
public function getUrl() { | ||
return $this->url; | ||
} | ||
|
||
/** | ||
* Sets the url | ||
* | ||
* @param string $url | ||
* @return $this | ||
*/ | ||
public function setUrl($url) { | ||
$this->url = $url; | ||
return $this; | ||
} | ||
|
||
/** | ||
* Returns the license | ||
* | ||
* @return string | ||
*/ | ||
public function getLicense() { | ||
return $this->license; | ||
} | ||
|
||
/** | ||
* Sets the license | ||
* | ||
* @param string $license | ||
* @return $this | ||
*/ | ||
public function setLicense($license) { | ||
$this->license = $license; | ||
return $this; | ||
} | ||
|
||
public function toString() { | ||
return sprintf('@license %s', trim($this->url . ' ' . $this->license)); | ||
} | ||
|
||
} |
Oops, something went wrong.