Skip to content

Commit 1258777

Browse files
committed
[skip ci] Add type hints to JsUtils methods
Added return type hint to the inline method and array type hints to the options parameter in diSemantic and diBootstrap methods for improved type safety and code clarity.
1 parent 1a14cbd commit 1258777

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Ajax/php/ubiquity/JsUtils.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected function _open_script($src = '') {
2626
return $str;
2727
}
2828

29-
public function inline(string $script, bool $cdata = true) {
29+
public function inline(string $script, bool $cdata = true): string{
3030
if (($this->params['csp'] ?? false) === 'hash' && ContentSecurityManager::isStarted()) {
3131
$script = ($cdata) ? "\n// <![CDATA[\n{$script}\n// ]]>\n" : "\n{$script}\n";
3232
ContentSecurityManager::getHash('jsUtils', $script);
@@ -135,7 +135,7 @@ public function execJSFromFile($jsFile, $parameters = [], $immediatly = true) {
135135
* @param array $options
136136
* @return \Ajax\php\ubiquity\JsUtils
137137
*/
138-
public static function diSemantic($controller, $options = [
138+
public static function diSemantic($controller, array $options = [
139139
'defer' => true,
140140
'gc' => true
141141
]) {
@@ -152,7 +152,7 @@ public static function diSemantic($controller, $options = [
152152
* @param array $options
153153
* @return \Ajax\php\ubiquity\JsUtils
154154
*/
155-
public static function diBootstrap($controller, $options = [
155+
public static function diBootstrap($controller, array $options = [
156156
'defer' => true,
157157
'gc' => true
158158
]) {

0 commit comments

Comments
 (0)