PageRenderTime 40ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/src/DocBlox/Parser/DocBlock/Tag/Definition/Link.php

https://github.com/androa/Docblox
PHP | 43 lines | 12 code | 3 blank | 28 comment | 1 complexity | a7f1472a7e0e9f17d7740551bb070fac MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php
  2. /**
  3. * DocBlox
  4. *
  5. * @category DocBlox
  6. * @package Parser
  7. * @subpackage Tag_Definitions
  8. * @author Mike van Riel <mike.vanriel@naenius.com>
  9. * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
  10. * @license http://www.opensource.org/licenses/mit-license.php MIT
  11. * @link http://docblox-project.org
  12. */
  13. /**
  14. * Definition for the @link tag; adds a attribute called `link`.
  15. *
  16. * @category DocBlox
  17. * @package Parser
  18. * @subpackage Tag_Definitions
  19. * @author Mike van Riel <mike.vanriel@naenius.com>
  20. * @license http://www.opensource.org/licenses/mit-license.php MIT
  21. * @link http://docblox-project.org
  22. */
  23. class DocBlox_Parser_DocBlock_Tag_Definition_Link extends DocBlox_Parser_DocBlock_Tag_Definition
  24. {
  25. /**
  26. * Adds a new attribute `link` to the structure element for this tag.
  27. *
  28. * @throws InvalidArgumentException if the associated tag is not of type Link.
  29. *
  30. * @return void
  31. */
  32. protected function configure()
  33. {
  34. if (!$this->tag instanceof DocBlox_Reflection_DocBlock_Tag_Link)
  35. {
  36. throw new InvalidArgumentException('Expected the tag to be for an @link');
  37. }
  38. $this->xml['link'] = $this->tag->getLink();
  39. }
  40. }