1- <?php
1+ <?php declare (strict_types= 1 );
22
33namespace OpenCloud \Common \Api ;
44
@@ -21,12 +21,12 @@ abstract class AbstractParams
2121 const INT_TYPE = 'integer ' ;
2222 const INTEGER_TYPE = self ::INT_TYPE ;
2323
24- public static function isSupportedLocation ($ val )
24+ public static function isSupportedLocation (string $ val ): bool
2525 {
2626 return in_array ($ val , [self ::QUERY , self ::HEADER , self ::URL , self ::JSON , self ::RAW ]);
2727 }
2828
29- public function limit ()
29+ public function limit (): array
3030 {
3131 return [
3232 'type ' => self ::INT_TYPE ,
@@ -38,7 +38,7 @@ public function limit()
3838 ];
3939 }
4040
41- public function marker ()
41+ public function marker (): array
4242 {
4343 return [
4444 'type ' => 'string ' ,
@@ -51,7 +51,7 @@ public function marker()
5151 ];
5252 }
5353
54- public function id ($ type )
54+ public function id (string $ type ): array
5555 {
5656 return [
5757 'description ' => sprintf ("The unique ID, or identifier, for the %s " , $ type ),
@@ -60,7 +60,7 @@ public function id($type)
6060 ];
6161 }
6262
63- public function idPath ()
63+ public function idPath (): array
6464 {
6565 return [
6666 'type ' => self ::STRING_TYPE ,
@@ -69,7 +69,7 @@ public function idPath()
6969 ];
7070 }
7171
72- public function name ($ resource )
72+ public function name (string $ resource ): array
7373 {
7474 return [
7575 'description ' => sprintf ("The name of the %s " , $ resource ),
@@ -79,7 +79,7 @@ public function name($resource)
7979 }
8080
8181
82- public function sortDir ()
82+ public function sortDir (): array
8383 {
8484 return [
8585 'type ' => self ::STRING_TYPE ,
@@ -89,12 +89,12 @@ public function sortDir()
8989 ];
9090 }
9191
92- public function sortKey ()
92+ public function sortKey (): array
9393 {
9494 return [
9595 'type ' => self ::STRING_TYPE ,
9696 'location ' => self ::QUERY ,
9797 'description ' => "Sorts by one or more sets of attribute and sort direction combinations. " ,
9898 ];
9999 }
100- }
100+ }
0 commit comments