From 06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 14 Nov 2023 14:47:55 +0100 Subject: Add function param/return types, fix a lot more phpstorm complaints --- tools/convert-modules.php | 2 +- tools/jedec.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/convert-modules.php b/tools/convert-modules.php index aa43d951..1b92490d 100644 --- a/tools/convert-modules.php +++ b/tools/convert-modules.php @@ -78,7 +78,7 @@ foreach ( $exFile = "modules/$module/lang/$lang/template-tags.json"; $existing = @json_decode(@file_get_contents($exFile), true); if (!is_array($existing)) $existing = array(); - $existing = $existing + $old; + $existing += $old; ksort($existing); if (file_put_contents($exFile, json_encode($existing, JSON_PRETTY_PRINT)) > 0) { unlink($path); diff --git a/tools/jedec.php b/tools/jedec.php index a4df9667..1883abb9 100644 --- a/tools/jedec.php +++ b/tools/jedec.php @@ -13,11 +13,11 @@ $last = 0; $index = 1; $line = file_get_contents('jedec'); -preg_match_all("/^\s*([1-9][0-9]?|1[01][0-9]|12[0-6])\s+([^\r\n]{2,9}(?:[a-z][^\r\n]{0,10}){1,3}[\r\n]?[^\r\n0]{0,31})(?:\s*[\r\n]\s|\s+)((?:[10]\s+){8})([0-9a-f]{2})\s*\$/sim", $line, $oout, PREG_SET_ORDER); +preg_match_all("/^\s*([1-9][0-9]?|1[01][0-9]|12[0-6])\s+([^\r\n]{2,9}(?:[a-z][^\r\n]{0,10}){1,3}[\r\n]?[^\r\n0]{0,31})(?:\s*[\r\n]\s|\s+)((?:[10]\s+){8})([0-9a-f]{2})\s*\$/im", $line, $oout, PREG_SET_ORDER); $output = []; foreach ($oout as $out) { $id = (int)$out[1]; - $name = preg_replace("/[\s\r\n]+/ms", ' ', $out[2]); + $name = preg_replace("/[\s\r\n]+/m", ' ', $out[2]); $bin = $out[3]; $hex = $out[4]; if ($id < $last) { -- cgit v1.2.3-55-g7522