2929use Symfony \Component \Routing \Generator \UrlGeneratorInterface ;
3030use Symfony \Component \Security \Http \Attribute \IsGranted ;
3131use Throwable ;
32+ use UnserializeApi ;
3233use ZipArchive ;
3334
3435use const DIRECTORY_SEPARATOR ;
@@ -947,10 +948,10 @@ public function cc13ExportExecute(int $node, Request $req): JsonResponse
947948
948949 $ fileName = basename ($ imsccPath );
949950 $ downloadUrl = $ this ->generateUrl (
950- 'cm_cc13_export_download ' ,
951- ['node ' => $ node ],
952- UrlGeneratorInterface::ABSOLUTE_URL
953- ).'?file= ' .rawurlencode ($ fileName );
951+ 'cm_cc13_export_download ' ,
952+ ['node ' => $ node ],
953+ UrlGeneratorInterface::ABSOLUTE_URL
954+ ).'?file= ' .rawurlencode ($ fileName );
954955
955956 return $ this ->json ([
956957 'ok ' => true ,
@@ -1172,7 +1173,7 @@ private function jsonError(string $message, int $status = 400, array $extra = []
11721173 private function getJsonPayload (Request $ req ): array
11731174 {
11741175 $ raw = (string ) ($ req ->getContent () ?? '' );
1175- $ data = json_decode ($ raw !== '' ? $ raw : '{} ' , true );
1176+ $ data = json_decode ('' !== $ raw ? $ raw : '{} ' , true );
11761177
11771178 return \is_array ($ data ) ? $ data : [];
11781179 }
@@ -1204,7 +1205,8 @@ private function validateBackupFilename(string $filename): string
12041205 * Ensure selection map exists; if only types were selected, build the map from types.
12051206 *
12061207 * @param array<string,array> $selectedResources
1207- * @param string[] $selectedTypes
1208+ * @param string[] $selectedTypes
1209+ *
12081210 * @return array<string,array>
12091211 */
12101212 private function ensureSelectionMap (object $ course , array $ selectedResources , array $ selectedTypes ): array
@@ -1217,6 +1219,7 @@ private function ensureSelectionMap(object $course, array $selectedResources, ar
12171219 foreach ($ selectedResources as $ ids ) {
12181220 if (\is_array ($ ids ) && !empty ($ ids )) {
12191221 $ hasAny = true ;
1222+
12201223 break ;
12211224 }
12221225 }
@@ -1309,8 +1312,8 @@ private function loadLegacyCourseForAnyBackup(string $backupId, string $force =
13091312 set_error_handler (static function (): void {});
13101313
13111314 try {
1312- if (class_exists (\ UnserializeApi::class)) {
1313- $ c = \ UnserializeApi::unserialize ('course ' , $ payload );
1315+ if (class_exists (UnserializeApi::class)) {
1316+ $ c = UnserializeApi::unserialize ('course ' , $ payload );
13141317 } else {
13151318 $ c = @unserialize ($ payload , ['allowed_classes ' => true ]);
13161319 }
@@ -1593,15 +1596,19 @@ private static function iniSizeToBytes(string $val): int
15931596 switch ($ unit ) {
15941597 case 't ' :
15951598 $ num *= 1024 ;
1596- // no break
1599+
1600+ // no break
15971601 case 'g ' :
15981602 $ num *= 1024 ;
1599- // no break
1603+
1604+ // no break
16001605 case 'm ' :
16011606 $ num *= 1024 ;
1602- // no break
1607+
1608+ // no break
16031609 case 'k ' :
16041610 $ num *= 1024 ;
1611+
16051612 break ;
16061613 }
16071614
0 commit comments