aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/ExtensionManager.php
diff options
context:
space:
mode:
authorGravatar Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> 2024-11-28 17:11:04 +0100
committerGravatar GitHub <noreply@github.com> 2024-11-28 17:11:04 +0100
commit15745d42b779ad14efde2932ab116f45eee39246 (patch)
tree2528a36184d8152d4f2d90dc73df680f84bbe1d1 /lib/Minz/ExtensionManager.php
parent604b186638276203c8495a3ee86da0cc240ab4d0 (diff)
Upgrade code to php 8.1 (#6748)
* revert Fix code indentation Fix code Upgrade code to php 8.1 * fix remarques * code review * code review * code review * Apply suggestions from code review * code review * Fixes * Many remainging updates of array syntax * Lost case 'reading-list' * Uneeded PHPDoc --------- Co-authored-by: Luc Sanchez <l.sanchez-prestataire@alptis.fr> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'lib/Minz/ExtensionManager.php')
-rw-r--r--lib/Minz/ExtensionManager.php98
1 files changed, 49 insertions, 49 deletions
diff --git a/lib/Minz/ExtensionManager.php b/lib/Minz/ExtensionManager.php
index 976dddb82..90f005d29 100644
--- a/lib/Minz/ExtensionManager.php
+++ b/lib/Minz/ExtensionManager.php
@@ -22,74 +22,74 @@ final class Minz_ExtensionManager {
* @var array<string,array{'list':array<callable>,'signature':'NoneToNone'|'NoneToString'|'OneToOne'|'PassArguments'}>
*/
private static array $hook_list = [
- 'check_url_before_add' => array( // function($url) -> Url | null
- 'list' => array(),
+ 'check_url_before_add' => [ // function($url) -> Url | null
+ 'list' => [],
'signature' => 'OneToOne',
- ),
+ ],
'entries_favorite' => [ // function(array $ids, bool $is_favorite): void
'list' => [],
'signature' => 'PassArguments',
],
- 'entry_auto_read' => array( // function(FreshRSS_Entry $entry, string $why): void
- 'list' => array(),
+ 'entry_auto_read' => [ // function(FreshRSS_Entry $entry, string $why): void
+ 'list' => [],
'signature' => 'PassArguments',
- ),
- 'entry_auto_unread' => array( // function(FreshRSS_Entry $entry, string $why): void
- 'list' => array(),
+ ],
+ 'entry_auto_unread' => [ // function(FreshRSS_Entry $entry, string $why): void
+ 'list' => [],
'signature' => 'PassArguments',
- ),
- 'entry_before_display' => array( // function($entry) -> Entry | null
- 'list' => array(),
+ ],
+ 'entry_before_display' => [ // function($entry) -> Entry | null
+ 'list' => [],
'signature' => 'OneToOne',
- ),
- 'entry_before_insert' => array( // function($entry) -> Entry | null
- 'list' => array(),
+ ],
+ 'entry_before_insert' => [ // function($entry) -> Entry | null
+ 'list' => [],
'signature' => 'OneToOne',
- ),
- 'feed_before_actualize' => array( // function($feed) -> Feed | null
- 'list' => array(),
+ ],
+ 'feed_before_actualize' => [ // function($feed) -> Feed | null
+ 'list' => [],
'signature' => 'OneToOne',
- ),
- 'feed_before_insert' => array( // function($feed) -> Feed | null
- 'list' => array(),
+ ],
+ 'feed_before_insert' => [ // function($feed) -> Feed | null
+ 'list' => [],
'signature' => 'OneToOne',
- ),
- 'freshrss_init' => array( // function() -> none
- 'list' => array(),
+ ],
+ 'freshrss_init' => [ // function() -> none
+ 'list' => [],
'signature' => 'NoneToNone',
- ),
- 'freshrss_user_maintenance' => array( // function() -> none
- 'list' => array(),
+ ],
+ 'freshrss_user_maintenance' => [ // function() -> none
+ 'list' => [],
'signature' => 'NoneToNone',
- ),
- 'js_vars' => array( // function($vars = array) -> array | null
- 'list' => array(),
+ ],
+ 'js_vars' => [ // function($vars = array) -> array | null
+ 'list' => [],
'signature' => 'OneToOne',
- ),
- 'menu_admin_entry' => array( // function() -> string
- 'list' => array(),
+ ],
+ 'menu_admin_entry' => [ // function() -> string
+ 'list' => [],
'signature' => 'NoneToString',
- ),
- 'menu_configuration_entry' => array( // function() -> string
- 'list' => array(),
+ ],
+ 'menu_configuration_entry' => [ // function() -> string
+ 'list' => [],
'signature' => 'NoneToString',
- ),
- 'menu_other_entry' => array( // function() -> string
- 'list' => array(),
+ ],
+ 'menu_other_entry' => [ // function() -> string
+ 'list' => [],
'signature' => 'NoneToString',
- ),
- 'nav_menu' => array( // function() -> string
- 'list' => array(),
+ ],
+ 'nav_menu' => [ // function() -> string
+ 'list' => [],
'signature' => 'NoneToString',
- ),
- 'nav_reading_modes' => array( // function($readingModes = array) -> array | null
- 'list' => array(),
+ ],
+ 'nav_reading_modes' => [ // function($readingModes = array) -> array | null
+ 'list' => [],
'signature' => 'OneToOne',
- ),
- 'post_update' => array( // function(none) -> none
- 'list' => array(),
+ ],
+ 'post_update' => [ // function(none) -> none
+ 'list' => [],
'signature' => 'NoneToNone',
- ),
+ ],
'simplepie_after_init' => [ // function(\SimplePie\SimplePie $simplePie, FreshRSS_Feed $feed, bool $result): void
'list' => [],
'signature' => 'PassArguments',
@@ -187,7 +187,7 @@ final class Minz_ExtensionManager {
* @return bool true if the array is valid, false else.
*/
private static function isValidMetadata(array $meta): bool {
- $valid_chars = array('_');
+ $valid_chars = ['_'];
return !(empty($meta['name']) || empty($meta['entrypoint']) || !ctype_alnum(str_replace($valid_chars, '', $meta['entrypoint'])));
}