44
55namespace jblond ;
66
7+ use InvalidArgumentException ;
8+ use jblond \Diff \Renderer \Html \Inline ;
9+ use jblond \Diff \Renderer \Html \SideBySide ;
10+ use jblond \Diff \Renderer \Html \Unified as UnifiedHtml ;
11+ use jblond \Diff \Renderer \Text \Context ;
12+ use jblond \Diff \Renderer \Text \Unified ;
713use jblond \Diff \SequenceMatcher ;
14+ use OutOfRangeException ;
815
916/**
1017 * Diff
@@ -126,7 +133,8 @@ public function getNew(): array
126133 /**
127134 * Render a diff-view using a rendering class and get its results.
128135 *
129- * @param object $renderer An instance of the rendering object, used for generating the diff-view.
136+ * @param object|Context|Unified|UnifiedHtml|Inline|SideBySide $renderer An instance of the rendering object,
137+ * used for generating the diff-view.
130138 *
131139 * @return mixed The generated diff-view. The type of the return value depends on the applied rendereder.
132140 */
@@ -152,14 +160,14 @@ public function render(object $renderer)
152160 * @param int|null $end The last element of the range to get.
153161 * If not supplied, only the element at start will be returned.
154162 *
155- * @throws \ OutOfRangeException When the value of start or end are invalid to define a range.
163+ * @throws OutOfRangeException When the value of start or end are invalid to define a range.
156164 *
157165 * @return array Array containing all of the elements of the specified range.
158166 */
159167 public function getArrayRange (array $ array , int $ start = 0 , $ end = null ): array
160168 {
161169 if ($ start < 0 || $ end < 0 || $ end < $ start ) {
162- throw new \ OutOfRangeException ('Start parameter must be lower than End parameter while both are positive! ' );
170+ throw new OutOfRangeException ('Start parameter must be lower than End parameter while both are positive! ' );
163171 }
164172
165173 if ($ start == 0 && $ end === null ) {
@@ -187,7 +195,7 @@ public function getArrayRange(array $array, int $start = 0, $end = null): array
187195 *
188196 * @param mixed $var Variable to get type from.
189197 *
190- * @throws \ InvalidArgumentException When the type isn't 'array' or 'string'.
198+ * @throws InvalidArgumentException When the type isn't 'array' or 'string'.
191199 *
192200 * @return int Number indicating the type of the variable. 0 for array type and 1 for string type.
193201 */
@@ -199,7 +207,7 @@ public function getArgumentType($var): int
199207 case (is_string ($ var )):
200208 return 1 ;
201209 default :
202- throw new \ InvalidArgumentException ('Invalid argument type! Argument must be of type array or string. ' );
210+ throw new InvalidArgumentException ('Invalid argument type! Argument must be of type array or string. ' );
203211 }
204212 }
205213
0 commit comments