Skip to content

Commit 861df65

Browse files
author
alexrohleder96@outlook.com
committed
improve phpdoc blocks
1 parent 38649ae commit 861df65

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/Annotation.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Annotation
3030
/**
3131
* Formmated arguments, but not casted.
3232
*
33-
* @var array
33+
* @var string[]
3434
*/
3535

3636
protected $arguments;
@@ -70,16 +70,18 @@ public function getArguments()
7070
}
7171

7272
/**
73+
* @param string $name
74+
* @param string $default = null
7375
* @return string
7476
*/
7577

76-
public function getArgument($name)
78+
public function getArgument($name, $default = null)
7779
{
78-
return isset($this->arguments[$name]) ? $this->arguments[$name] : null;
80+
return isset($this->arguments[$name]) ? $this->arguments[$name] : $default;
7981
}
8082

8183
/**
82-
* @return string
84+
* @return int
8385
*/
8486

8587
public function getArgumentCount()
@@ -88,6 +90,7 @@ public function getArgumentCount()
8890
}
8991

9092
/**
93+
* @param string $name
9194
* @return boolean
9295
*/
9396

src/Reflection/AnnotationTrait.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function getAnnotation($name)
6868
* Get all annotations, or several of then. Note that here annotations can
6969
* have regex on they name.
7070
*
71-
* @param array $names if empty will return all annotations. Can have regex.
71+
* @param string[] $names if empty will return all annotations. Can have regex.
7272
* @return array ["AnnotationName" => Annotation]
7373
*/
7474

@@ -90,6 +90,7 @@ public function getAnnotations(array $names = array())
9090
/**
9191
* Check if an annotation exists
9292
*
93+
* @param string $name
9394
* @return bool
9495
*/
9596

@@ -101,7 +102,8 @@ public function hasAnnotation($name)
101102
/**
102103
* Find all annotations that the name match the $pattern
103104
*
104-
* @return array
105+
* @param string $pattern
106+
* @return string[]
105107
*/
106108

107109
protected function getMatchedAnnotations($pattern)
@@ -114,7 +116,7 @@ protected function getMatchedAnnotations($pattern)
114116
* Instantiate a new Annotation object, if the annotation has a specific object
115117
* then resolve the name and create it.
116118
*
117-
* @param array $annotation The getMatchedAnnotation annotation return.
119+
* @param string[] $annotation The getMatchedAnnotation annotation return.
118120
* @return Annotation
119121
*/
120122

@@ -139,7 +141,7 @@ protected function getAnnotationObject($annotation)
139141
/**
140142
* Get all use statements from the annotated reflection file.
141143
*
142-
* @return array
144+
* @return string[] [ALIAS_NAME => FULL_CLASS_NAME];
143145
*/
144146

145147
protected function getUseStatements()
@@ -187,6 +189,7 @@ private function getClassFileHeader()
187189
/**
188190
* Resolve annotation name.
189191
*
192+
* @param string $name
190193
* @return string
191194
*/
192195

0 commit comments

Comments
 (0)