33namespace SRL ;
44
55use Closure ;
6- use SRL \Builder \EitherOf ;
76use SRL \Builder \Capture ;
7+ use SRL \Builder \EitherOf ;
88use SRL \Builder \NegativeLookahead ;
99use SRL \Builder \NegativeLookbehind ;
1010use SRL \Builder \NonCapture ;
@@ -184,7 +184,6 @@ public function literally(string $chars) : self
184184 return $ this ->add ('(?: ' . implode ('' , array_map ([$ this , 'escape ' ], str_split ($ chars ))) . ') ' );
185185 }
186186
187-
188187 /**
189188 * Match any digit (in given span). Default will be a digit between 0 and 9.
190189 *
@@ -288,11 +287,11 @@ public function group($conditions) : self
288287 * @param Closure|Builder|string $conditions Anonymous function with its Builder as a first parameter.
289288 * @return Builder
290289 */
291- public function and ($ conditions ) : self
290+ public function and ($ conditions ) : self
292291 {
293292 $ this ->validateAndAddMethodType (self ::METHOD_TYPE_GROUP , self ::METHOD_TYPES_ALLOWED_FOR_CHARACTERS );
294293
295- return $ this ->addClosure (new Builder , $ conditions );
294+ return $ this ->addClosure (new self , $ conditions );
296295 }
297296
298297 /**
@@ -469,8 +468,8 @@ public function lazy() : self
469468 /**
470469 * Apply laziness to last match.
471470 *
472- * @return Builder
473471 * @throws ImplementationException
472+ * @return Builder
474473 */
475474 public function firstMatch () : self
476475 {
@@ -599,8 +598,8 @@ protected function validateAndAddMethodType(int $type, int $allowed, string $met
599598 * Add the value from the simple mapper array to the regular expression.
600599 *
601600 * @param string $name
602- * @return Builder
603601 * @throws BuilderException
602+ * @return Builder
604603 */
605604 protected function addFromMapper (string $ name ) : self
606605 {
@@ -644,7 +643,7 @@ protected function addClosure(Builder $builder, $conditions) : self
644643 if (is_string ($ conditions )) {
645644 // Assuming literal characters if conditions are of type string
646645 $ builder ->literally ($ conditions );
647- } elseif ($ conditions instanceof Builder ) {
646+ } elseif ($ conditions instanceof self ) {
648647 $ builder ->raw ($ conditions ->get ('' ));
649648 } else {
650649 $ conditions ($ builder );
@@ -664,7 +663,7 @@ protected function revertLast()
664663 }
665664
666665 /**
667- * @inheritdoc
666+ * { @inheritdoc}
668667 */
669668 public function get (string $ delimiter = '/ ' , bool $ ignoreInvalid = false ) : string
670669 {
@@ -687,8 +686,6 @@ public function get(string $delimiter = '/', bool $ignoreInvalid = false) : stri
687686 return $ regEx ;
688687 }
689688
690-
691-
692689 /**********************************************************/
693690 /* MAGIC METHODS */
694691 /**********************************************************/
@@ -698,8 +695,8 @@ public function get(string $delimiter = '/', bool $ignoreInvalid = false) : stri
698695 *
699696 * @param $name
700697 * @param $arguments
701- * @return Builder
702698 * @throws ImplementationException
699+ * @return Builder
703700 */
704701 public function __call ($ name , $ arguments ) : self
705702 {
@@ -730,4 +727,4 @@ public function __toString() : string
730727 {
731728 return $ this ->get ();
732729 }
733- }
730+ }
0 commit comments