Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
darylldoyle committed Nov 29, 2024
1 parent b8b712c commit 6f76974
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
6 changes: 5 additions & 1 deletion mu-plugins/10up-plugin/includes/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ function get_enqueue_contexts() {
* @param string $script Script file name (no .js extension)
* @param string $context Context for the script ('admin', 'frontend', or 'shared')
*
* @throws \RuntimeException If an invalid $context is specified.
*
* @return string URL
*/
function script_url( $script, $context ) {
Expand All @@ -125,6 +127,8 @@ function script_url( $script, $context ) {
* @param string $stylesheet Stylesheet file name (no .css extension)
* @param string $context Context for the script ('admin', 'frontend', or 'shared')
*
* @throws \RuntimeException If an invalid $context is specified.
*
* @return string URL
*/
function style_url( $stylesheet, $context ) {
Expand Down Expand Up @@ -269,7 +273,7 @@ function script_loader_tag( $tag, $handle ) {
}

if ( 'async' !== $script_execution && 'defer' !== $script_execution ) {
return $tag; // _doing_it_wrong()?
return $tag;
}

// Abort adding async/defer for scripts that have this script as a dependency. _doing_it_wrong()?
Expand Down
5 changes: 4 additions & 1 deletion mu-plugins/10up-plugin/includes/utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ function get_asset_info( $slug, $attribute = null ) {
} elseif ( file_exists( TENUP_PLUGIN_PATH . 'dist/css/' . $slug . '.asset.php' ) ) {
$asset = require TENUP_PLUGIN_PATH . 'dist/css/' . $slug . '.asset.php';
} else {
$asset = [ 'version' => TENUP_PLUGIN_VERSION, 'dependencies' => [] ];
$asset = [
'version' => TENUP_PLUGIN_VERSION,
'dependencies' => [],
];
}

// @var <array{version: string, dependencies: array<string>}> $asset
Expand Down
4 changes: 2 additions & 2 deletions themes/10up-theme/includes/overrides.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ function disable_emojis_tinymce( $plugins ) {
*
* @link https://developer.wordpress.org/reference/hooks/emoji_svg_url/
*
* @param array<string> $urls URLs to print for resource hints.
* @param string $relation_type The relation type the URLs are printed for.
* @param array<string> $urls URLs to print for resource hints.
* @param string $relation_type The relation type the URLs are printed for.
* @return array<string> Difference betwen the two arrays.
*/
function disable_emoji_dns_prefetch( $urls, $relation_type ) {
Expand Down
7 changes: 6 additions & 1 deletion themes/10up-theme/includes/utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ function get_asset_info( $slug, $attribute = null ) {
} elseif ( file_exists( TENUP_THEME_PATH . 'dist/css/' . $slug . '.asset.php' ) ) {
$asset = require TENUP_THEME_PATH . 'dist/css/' . $slug . '.asset.php';
} else {
$asset = [ 'version' => TENUP_THEME_VERSION, 'dependencies' => [] ];
$asset = [
'version' => TENUP_THEME_VERSION,
'dependencies' => [],
];
}

if ( ! empty( $attribute ) && isset( $asset[ $attribute ] ) ) {
Expand All @@ -41,6 +44,8 @@ function get_asset_info( $slug, $attribute = null ) {
*
* @param string $path the path to your CSS variables file
*
* @throws \RuntimeException If the file is not found or could not be read
*
* @return array<string>
*/
function get_colors( $path ) {
Expand Down

0 comments on commit 6f76974

Please sign in to comment.