Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds parsing for some PHPDoc annotations
- Loading branch information
1 parent
31e5f19
commit 6bad124
Showing
7 changed files
with
123 additions
and
19 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace Doctrine\Common\Annotations\Annotation; | ||
|
||
final class Author | ||
{ | ||
public $name; | ||
|
||
public function __construct(array $values) | ||
{ | ||
if (isset($values['value'])) { | ||
$this->name = $values['value']; | ||
} | ||
} | ||
} |
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,15 @@ | ||
<?php | ||
|
||
namespace Doctrine\Common\Annotations\Annotation; | ||
|
||
final class Since | ||
{ | ||
public $version; | ||
|
||
public function __construct(array $values) | ||
{ | ||
if (isset($values['value'])) { | ||
$this->version = $values['value']; | ||
} | ||
} | ||
} |
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,38 @@ | ||
<?php | ||
|
||
namespace Doctrine\Common\Annotations\Annotation; | ||
|
||
final class Type | ||
{ | ||
const TYPE_INTEGER = 'integer'; | ||
const TYPE_DOUBLE = 'double'; | ||
const TYPE_BOOLEAN = 'boolean'; | ||
const TYPE_ARRAY = 'array'; | ||
const TYPE_UNKNOWN = 'unknown'; | ||
|
||
public $name; | ||
public $type; | ||
|
||
public function __construct(array $values) | ||
{ | ||
if (isset($values['value'])) { | ||
$name = $values['value']; | ||
if (false !== $pos = strpos($name, ' ')) { | ||
$name = substr($name, 0, $pos); | ||
} | ||
$this->name = $name; | ||
|
||
if ('integer' === $name || 'int' === $name) { | ||
$this->type = self::TYPE_INTEGER; | ||
} else if ('double' === $name || 'float' === $name) { | ||
$this->type = self::TYPE_FLOAT; | ||
} else if ('string' === $name) { | ||
$this->type = self::TYPE_STRING; | ||
} else if ('array' === $name) { | ||
$this->type = self::TYPE_ARRAY; | ||
} else { | ||
$this->type = self::TYPE_UNKNOWN; | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kdambekalns
|
||
} | ||
} | ||
} |
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
forgotten boolean? :-)