$arguments, 'lastParam' => $lastParam, 'cdnLinks' => array_change_key_case(Config::get('CDNLinks', $cdn) ?: []) ]; } /** * Protected Gettype */ public static function gettype($function, $scripts) { $str = ''; $eol = EOL; $args = self::_parameters($scripts, $function . 's'); $lastParam = $args->lastParam; $arguments = $args->arguments; $links = $args->cdnLinks; $scriptFix = $function . '_'; foreach( $arguments as $script ) { if( is_array($script) ) { $script = ''; // @codeCoverageIgnore } if( IS::url($script) ) { $str .= static::tag($script); // @codeCoverageIgnore } else { $projectFontDirectory = THEMES_DIR . Theme::$active; $externalFontDirectory = EXTERNAL_THEMES_DIR . Theme::$active; $scriptFile = $projectFontDirectory . ($suffix = Base::suffix($script, $function === 'script' ? '.js' : '.css')); if( ! is_file($scriptFile) ) { $scriptFile = $externalFontDirectory . $suffix; } if( ! in_array($scriptFix . $script, Properties::$isImport) ) { if( is_file($scriptFile) ) { $str .= static::tag(Request::getBaseURL($scriptFile)); // @codeCoverageIgnore } elseif( $lowerLinkName = ($links[strtolower($script)] ?? NULL) ) { $str .= static::tag($lowerLinkName); } Properties::$isImport[] = $scriptFix . $script; } } } if( ! empty($str) ) { if( $lastParam === true ) { return $str; // @codeCoverageIgnore } else { echo $str; } } else { return false; // @codeCoverageIgnore } } }