@@ -640,7 +640,7 @@ public function getByUidLowerThan(int $uid): MessageCollection {
640
640
*
641
641
* @return $this
642
642
*/
643
- public function leaveUnread (): Query {
643
+ public function leaveUnread (): static {
644
644
$ this ->setFetchOptions (IMAP ::FT_PEEK );
645
645
646
646
return $ this ;
@@ -651,7 +651,7 @@ public function leaveUnread(): Query {
651
651
*
652
652
* @return $this
653
653
*/
654
- public function markAsRead (): Query {
654
+ public function markAsRead (): static {
655
655
$ this ->setFetchOptions (IMAP ::FT_UID );
656
656
657
657
return $ this ;
@@ -663,7 +663,7 @@ public function markAsRead(): Query {
663
663
*
664
664
* @return $this
665
665
*/
666
- public function setSequence (int $ sequence ): Query {
666
+ public function setSequence (int $ sequence ): static {
667
667
$ this ->sequence = $ sequence ;
668
668
669
669
return $ this ;
@@ -699,7 +699,7 @@ public function getClient(): Client {
699
699
*
700
700
* @return $this
701
701
*/
702
- public function limit (int $ limit , int $ page = 1 ): Query {
702
+ public function limit (int $ limit , int $ page = 1 ): static {
703
703
if ($ page >= 1 ) $ this ->page = $ page ;
704
704
$ this ->limit = $ limit ;
705
705
@@ -719,9 +719,9 @@ public function getQuery(): Collection {
719
719
* Set all query parameters
720
720
* @param array $query
721
721
*
722
- * @return Query
722
+ * @return $this
723
723
*/
724
- public function setQuery (array $ query ): Query {
724
+ public function setQuery (array $ query ): static {
725
725
$ this ->query = new Collection ($ query );
726
726
return $ this ;
727
727
}
@@ -739,9 +739,9 @@ public function getRawQuery(): string {
739
739
* Set the raw query
740
740
* @param string $raw_query
741
741
*
742
- * @return Query
742
+ * @return $this
743
743
*/
744
- public function setRawQuery (string $ raw_query ): Query {
744
+ public function setRawQuery (string $ raw_query ): static {
745
745
$ this ->raw_query = $ raw_query ;
746
746
return $ this ;
747
747
}
@@ -759,9 +759,9 @@ public function getExtensions(): array {
759
759
* Set all extensions that should be used
760
760
* @param string[] $extensions
761
761
*
762
- * @return Query
762
+ * @return $this
763
763
*/
764
- public function setExtensions (array $ extensions ): Query {
764
+ public function setExtensions (array $ extensions ): static {
765
765
$ this ->extensions = $ extensions ;
766
766
if (count ($ this ->extensions ) > 0 ) {
767
767
if (in_array ("UID " , $ this ->extensions ) === false ) {
@@ -775,9 +775,9 @@ public function setExtensions(array $extensions): Query {
775
775
* Set the client instance
776
776
* @param Client $client
777
777
*
778
- * @return Query
778
+ * @return $this
779
779
*/
780
- public function setClient (Client $ client ): Query {
780
+ public function setClient (Client $ client ): static {
781
781
$ this ->client = $ client ;
782
782
return $ this ;
783
783
}
@@ -795,9 +795,9 @@ public function getLimit(): ?int {
795
795
* Set the fetch limit
796
796
* @param int $limit
797
797
*
798
- * @return Query
798
+ * @return $this
799
799
*/
800
- public function setLimit (int $ limit ): Query {
800
+ public function setLimit (int $ limit ): static {
801
801
$ this ->limit = $ limit <= 0 ? null : $ limit ;
802
802
return $ this ;
803
803
}
@@ -815,9 +815,9 @@ public function getPage(): int {
815
815
* Set the page
816
816
* @param int $page
817
817
*
818
- * @return Query
818
+ * @return $this
819
819
*/
820
- public function setPage (int $ page ): Query {
820
+ public function setPage (int $ page ): static {
821
821
$ this ->page = $ page ;
822
822
return $ this ;
823
823
}
@@ -826,9 +826,9 @@ public function setPage(int $page): Query {
826
826
* Set the fetch option flag
827
827
* @param int $fetch_options
828
828
*
829
- * @return Query
829
+ * @return $this
830
830
*/
831
- public function setFetchOptions (int $ fetch_options ): Query {
831
+ public function setFetchOptions (int $ fetch_options ): static {
832
832
$ this ->fetch_options = $ fetch_options ;
833
833
return $ this ;
834
834
}
@@ -837,9 +837,9 @@ public function setFetchOptions(int $fetch_options): Query {
837
837
* Set the fetch option flag
838
838
* @param int $fetch_options
839
839
*
840
- * @return Query
840
+ * @return $this
841
841
*/
842
- public function fetchOptions (int $ fetch_options ): Query {
842
+ public function fetchOptions (int $ fetch_options ): static {
843
843
return $ this ->setFetchOptions ($ fetch_options );
844
844
}
845
845
@@ -865,9 +865,9 @@ public function getFetchBody(): bool {
865
865
* Set the fetch body flag
866
866
* @param boolean $fetch_body
867
867
*
868
- * @return Query
868
+ * @return $this
869
869
*/
870
- public function setFetchBody (bool $ fetch_body ): Query {
870
+ public function setFetchBody (bool $ fetch_body ): static {
871
871
$ this ->fetch_body = $ fetch_body ;
872
872
return $ this ;
873
873
}
@@ -876,9 +876,9 @@ public function setFetchBody(bool $fetch_body): Query {
876
876
* Set the fetch body flag
877
877
* @param boolean $fetch_body
878
878
*
879
- * @return Query
879
+ * @return $this
880
880
*/
881
- public function fetchBody (bool $ fetch_body ): Query {
881
+ public function fetchBody (bool $ fetch_body ): static {
882
882
return $ this ->setFetchBody ($ fetch_body );
883
883
}
884
884
@@ -895,9 +895,9 @@ public function getFetchFlags(): bool {
895
895
* Set the fetch flag
896
896
* @param bool $fetch_flags
897
897
*
898
- * @return Query
898
+ * @return $this
899
899
*/
900
- public function setFetchFlags (bool $ fetch_flags ): Query {
900
+ public function setFetchFlags (bool $ fetch_flags ): static {
901
901
$ this ->fetch_flags = $ fetch_flags ;
902
902
return $ this ;
903
903
}
@@ -906,9 +906,9 @@ public function setFetchFlags(bool $fetch_flags): Query {
906
906
* Set the fetch order
907
907
* @param string $fetch_order
908
908
*
909
- * @return Query
909
+ * @return $this
910
910
*/
911
- public function setFetchOrder (string $ fetch_order ): Query {
911
+ public function setFetchOrder (string $ fetch_order ): static {
912
912
$ fetch_order = strtolower ($ fetch_order );
913
913
914
914
if (in_array ($ fetch_order , ['asc ' , 'desc ' ])) {
@@ -922,9 +922,9 @@ public function setFetchOrder(string $fetch_order): Query {
922
922
* Set the fetch order
923
923
* @param string $fetch_order
924
924
*
925
- * @return Query
925
+ * @return $this
926
926
*/
927
- public function fetchOrder (string $ fetch_order ): Query {
927
+ public function fetchOrder (string $ fetch_order ): static {
928
928
return $ this ->setFetchOrder ($ fetch_order );
929
929
}
930
930
@@ -940,56 +940,56 @@ public function getFetchOrder(): string {
940
940
/**
941
941
* Set the fetch order to ascending
942
942
*
943
- * @return Query
943
+ * @return $this
944
944
*/
945
- public function setFetchOrderAsc (): Query {
945
+ public function setFetchOrderAsc (): static {
946
946
return $ this ->setFetchOrder ('asc ' );
947
947
}
948
948
949
949
/**
950
950
* Set the fetch order to ascending
951
951
*
952
- * @return Query
952
+ * @return $this
953
953
*/
954
- public function fetchOrderAsc (): Query {
954
+ public function fetchOrderAsc (): static {
955
955
return $ this ->setFetchOrderAsc ();
956
956
}
957
957
958
958
/**
959
959
* Set the fetch order to descending
960
960
*
961
- * @return Query
961
+ * @return $this
962
962
*/
963
- public function setFetchOrderDesc (): Query {
963
+ public function setFetchOrderDesc (): static {
964
964
return $ this ->setFetchOrder ('desc ' );
965
965
}
966
966
967
967
/**
968
968
* Set the fetch order to descending
969
969
*
970
- * @return Query
970
+ * @return $this
971
971
*/
972
- public function fetchOrderDesc (): Query {
972
+ public function fetchOrderDesc (): static {
973
973
return $ this ->setFetchOrderDesc ();
974
974
}
975
975
976
976
/**
977
977
* Set soft fail mode
978
978
* @var boolean $state
979
979
*
980
- * @return Query
980
+ * @return $this
981
981
*/
982
- public function softFail (bool $ state = true ): Query {
982
+ public function softFail (bool $ state = true ): static {
983
983
return $ this ->setSoftFail ($ state );
984
984
}
985
985
986
986
/**
987
987
* Set soft fail mode
988
988
*
989
989
* @var boolean $state
990
- * @return Query
990
+ * @return $this
991
991
*/
992
- public function setSoftFail (bool $ state = true ): Query {
992
+ public function setSoftFail (bool $ state = true ): static {
993
993
$ this ->soft_fail = $ state ;
994
994
995
995
return $ this ;
0 commit comments