File: phpdoc-method.peg

package info (click to toggle)
php-phpstan-phpdoc-parser 2.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,476 kB
  • sloc: php: 21,156; makefile: 50; xml: 42; sh: 17
file content (41 lines) | stat: -rw-r--r-- 737 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
PhpDocMethod
  = AnnotationName IsStatic? MethodReturnType? MethodName MethodParameters? Description?

AnnotationName
  = '@method'

IsStatic
  = 'static'

MethodReturnType
  = Type

MethodName
  = [a-zA-Z_\127-\255][a-zA-Z0-9_\127-\255]*

MethodParameters
  = '(' MethodParametersInner? ')'

MethodParametersInner
  = MethodParameter (',' MethodParameter)*

MethodParameter
  = MethodParameterType? IsReference? IsVariadic? MethodParameterName MethodParameterDefaultValue?

MethodParameterType
  = Type

IsReference
  = '&'

IsVariadic
  = '...'

MethodParameterName
  = '$' [a-zA-Z_\127-\255][a-zA-Z0-9_\127-\255]*

MethodParameterDefaultValue
  = '=' PhpConstantExpr

Description
  = .+ # TODO: exclude EOL or another PhpDocTag start