Source for file Annotations.php
Documentation is available at Annotations.php
- 1: <?php
- 3: /**
- 4: * Nette Framework
- 5: *
- 6: * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
- 7: *
- 8: * This source file is subject to the "Nette license" that is bundled
- 9: * with this package in the file license.txt.
- 10: *
- 11: * For more information please see https://nette.org
- 12: *
- 19: */
- 23: /**
- 24: * Annotations support for PHP.
- 25: *
- 29: */
- 31: {
- 37: /**
- 38: * Static class - cannot be instantiated.
- 39: */
- 41: {
- 43: }
- 47: /**
- 48: * Has class/method/property specified annotation?
- 52: */
- 54: {
- 57: }
- 61: /**
- 62: * Returns an annotation value.
- 66: */
- 68: {
- 71: }
- 75: /**
- 76: * Returns all annotations.
- 80: */
- 82: {
- 93: }
- 94: }
- 98: /**
- 99: * Parses and caches annotations.
- 102: */
- 104: {
- 105: $cache = & self::$cache[$r->getName()][$r instanceof ReflectionClass ? '' : $r->getDeclaringClass()->getName()];
- 108: }
- 110: preg_match_all('#@([a-zA-Z0-9_]+)(?:\(((?>[^\'")]+|\'[^\']*\'|"[^"]*")*)\))?#', $r->getDocComment(), $matches, PREG_SET_ORDER);
- 113: {
- 115: preg_match_all('#[,\s](?>([a-zA-Z0-9_]+)\s*=\s*)?([^\'",\s][^,]*|\'[^\']*\'|"[^"]*")#', ',' . $match[2], $matches, PREG_SET_ORDER);
- 132: }
- 139: }
- 140: }
- 146: }
- 149: }
- 151: }
- 153: }
