99use InvalidArgumentException ;
1010use Pagerfanta \Pagerfanta ;
1111use RuntimeException ;
12- use Somnambulist \Collection \Contracts \Arrayable ;
13- use Somnambulist \Collection \Contracts \Collection ;
14- use Somnambulist \Collection \MutableCollection ;
12+ use Somnambulist \Components \ Collection \Contracts \Arrayable ;
13+ use Somnambulist \Components \ Collection \Contracts \Collection ;
14+ use Somnambulist \Components \ Collection \MutableCollection ;
1515use Somnambulist \Components \ReadModels \Contracts \Queryable ;
1616use Somnambulist \Components \ReadModels \Exceptions \EntityNotFoundException ;
1717use Somnambulist \Components \ReadModels \Exceptions \NoResultsException ;
2828use function is_callable ;
2929use function method_exists ;
3030use function sprintf ;
31+ use function str_contains ;
3132use function str_replace ;
3233use function strlen ;
33- use function strpos ;
3434use function substr ;
3535use function ucfirst ;
3636
@@ -277,7 +277,7 @@ public function with(...$relations): self
277277 private function eagerLoadRelationships (Collection $ models ): void
278278 {
279279 foreach ($ this ->eagerLoad as $ name => $ constraints ) {
280- if (false === strpos ($ name , '. ' )) {
280+ if (false === str_contains ($ name , '. ' )) {
281281 /** @var AbstractRelationship $load */
282282 $ rel = $ this ->model ->new ()->getRelationship ($ name );
283283 $ rel
@@ -546,7 +546,7 @@ public function orWhereNotIn(string $column, $values): self
546546 *
547547 * @return ModelBuilder
548548 */
549- public function whereColumn (string $ column , string $ operator , $ value , string $ andOr = 'and ' ): self
549+ public function whereColumn (string $ column , string $ operator , mixed $ value , string $ andOr = 'and ' ): self
550550 {
551551 $ key = $ this ->createParameterPlaceholderKey ($ column );
552552 $ method = $ this ->getAndOrWhereMethodName ($ andOr );
@@ -568,7 +568,7 @@ public function whereColumn(string $column, string $operator, $value, string $an
568568 *
569569 * @return ModelBuilder
570570 */
571- public function orWhereColumn (string $ column , string $ operator , $ value ): self
571+ public function orWhereColumn (string $ column , string $ operator , mixed $ value ): self
572572 {
573573 return $ this ->whereColumn ($ column , $ operator , $ value , 'or ' );
574574 }
@@ -621,7 +621,7 @@ public function orWhereNotNull(string $column): self
621621 *
622622 * @return ModelBuilder
623623 */
624- public function whereBetween (string $ column , $ start , $ end , string $ andOr = 'and ' , bool $ not = false ): self
624+ public function whereBetween (string $ column , mixed $ start , mixed $ end , string $ andOr = 'and ' , bool $ not = false ): self
625625 {
626626 $ method = $ this ->getAndOrWhereMethodName ($ andOr );
627627 $ expr = ($ not ? 'NOT ' : '' ) . ' BETWEEN ' ;
@@ -635,17 +635,17 @@ public function whereBetween(string $column, $start, $end, string $andOr = 'and'
635635 return $ this ;
636636 }
637637
638- public function whereNotBetween (string $ column , $ start , $ end ): self
638+ public function whereNotBetween (string $ column , mixed $ start , mixed $ end ): self
639639 {
640640 return $ this ->whereBetween ($ column , $ start , $ end , 'and ' , true );
641641 }
642642
643- public function orWhereBetween (string $ column , $ start , $ end ): self
643+ public function orWhereBetween (string $ column , mixed $ start , mixed $ end ): self
644644 {
645645 return $ this ->whereBetween ($ column , $ start , $ end , 'or ' );
646646 }
647647
648- public function orWhereNotBetween (string $ column , $ start , $ end ): self
648+ public function orWhereNotBetween (string $ column , mixed $ start , mixed $ end ): self
649649 {
650650 return $ this ->whereBetween ($ column , $ start , $ end , 'or ' , true );
651651 }
0 commit comments