@@ -95,53 +95,63 @@ protected function searchRecipients(ShareAccessContext $accessContext, ?array $f
9595
9696 #[Override]
9797 protected function createShare (ShareAccessContext $ accessContext ): array {
98+ /** @var SharingShare */
9899 return $ this ->executeRequest ($ accessContext , fn (ApiV1Controller $ controller ): DataResponse => $ controller ->createShare ());
99100 }
100101
101102 #[Override]
102103 protected function updateShareState (ShareAccessContext $ accessContext , string $ id , ShareState $ state ): array {
104+ /** @var SharingShare */
103105 return $ this ->executeRequest ($ accessContext , fn (ApiV1Controller $ controller ): DataResponse => $ controller ->updateShareState ($ id , $ state ->value ));
104106 }
105107
106108 #[Override]
107109 protected function addShareSource (ShareAccessContext $ accessContext , string $ id , ShareSource $ source ): array {
110+ /** @var SharingShare */
108111 return $ this ->executeRequest ($ accessContext , fn (ApiV1Controller $ controller ): DataResponse => $ controller ->addShareSource ($ id , $ source ->class , $ source ->value ));
109112 }
110113
111114 #[Override]
112115 protected function removeShareSource (ShareAccessContext $ accessContext , string $ id , ShareSource $ source ): array {
116+ /** @var SharingShare */
113117 return $ this ->executeRequest ($ accessContext , fn (ApiV1Controller $ controller ): DataResponse => $ controller ->removeShareSource ($ id , $ source ->class , $ source ->value ));
114118 }
115119
116120 #[Override]
117121 protected function addShareRecipient (ShareAccessContext $ accessContext , string $ id , ShareRecipient $ recipient ): array {
122+ /** @var SharingShare */
118123 return $ this ->executeRequest ($ accessContext , fn (ApiV1Controller $ controller ): DataResponse => $ controller ->addShareRecipient ($ id , $ recipient ->class , $ recipient ->value , $ recipient ->instance ));
119124 }
120125
121126 #[Override]
122127 protected function removeShareRecipient (ShareAccessContext $ accessContext , string $ id , ShareRecipient $ recipient ): array {
128+ /** @var SharingShare */
123129 return $ this ->executeRequest ($ accessContext , fn (ApiV1Controller $ controller ): DataResponse => $ controller ->removeShareRecipient ($ id , $ recipient ->class , $ recipient ->value , $ recipient ->instance ));
124130 }
125131
126132 #[Override]
127133 protected function updateShareRecipientSecret (ShareAccessContext $ accessContext , string $ id , ShareRecipient $ recipient , string $ secret ): array {
128134 /** @psalm-suppress ArgumentTypeCoercion */
135+ /** @var SharingShare */
129136 return $ this ->executeRequest ($ accessContext , fn (ApiV1Controller $ controller ): DataResponse => $ controller ->updateShareRecipientSecret ($ id , $ recipient ->class , $ recipient ->value , $ recipient ->instance , $ secret ));
130137 }
131138
132139 #[Override]
133140 protected function updateShareProperty (ShareAccessContext $ accessContext , string $ id , ShareProperty $ property ): array {
141+ /** @var SharingShare */
134142 return $ this ->executeRequest ($ accessContext , fn (ApiV1Controller $ controller ): DataResponse => $ controller ->updateShareProperty ($ id , $ property ->class , $ property ->value ));
135143 }
136144
137145 #[Override]
138146 protected function updateSharePermission (ShareAccessContext $ accessContext , string $ id , SharePermission $ permission ): array {
147+ /** @var SharingShare */
139148 return $ this ->executeRequest ($ accessContext , fn (ApiV1Controller $ controller ): DataResponse => $ controller ->updateSharePermission ($ id , $ permission ->class , $ permission ->enabled ));
140149 }
141150
142151 #[Override]
143152 protected function selectSharePermissionPreset (ShareAccessContext $ accessContext , string $ id , string $ permissionPresetClass ): array {
144153 /** @psalm-suppress ArgumentTypeCoercion */
154+ /** @var SharingShare */
145155 return $ this ->executeRequest ($ accessContext , fn (ApiV1Controller $ controller ): DataResponse => $ controller ->selectSharePermissionPreset ($ id , $ permissionPresetClass ));
146156 }
147157
@@ -150,11 +160,9 @@ protected function deleteShare(ShareAccessContext $accessContext, string $id): v
150160 $ this ->executeRequest ($ accessContext , fn (ApiV1Controller $ controller ): DataResponse => $ controller ->deleteShare ($ id ));
151161 }
152162
153- /**
154- * @psalm-suppress MixedReturnTypeCoercion
155- */
156163 #[Override]
157164 protected function getShare (ShareAccessContext $ accessContext , string $ id ): array {
165+ /** @var SharingShare */
158166 return $ this ->executeRequest (new ShareAccessContext ($ accessContext ->currentUser , null , [], $ accessContext ->overrideChecks ), fn (ApiV1Controller $ controller ): DataResponse => $ controller ->getShare ($ id , $ accessContext ->secret , $ accessContext ->arguments ));
159167 }
160168
0 commit comments