Skip to content

Commit da5a1d5

Browse files
authored
Merge branch 'master' into feature/v5.0
2 parents 9461147 + 18c83dd commit da5a1d5

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

grumphp.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ grumphp:
1515
phpcs:
1616
standard: ['phpcs.xml']
1717
triggered_by: [php]
18-
securitychecker:
19-
lockfile: ./composer.lock
20-
format: ~
21-
end_point: ~
22-
timeout: ~
23-
run_always: false
2418
composer:
2519
no_check_all: true
2620
no_check_publish: true

inc/Helpers/Accessible_Menu_Walker.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
namespace BEA\Theme\Framework\Helpers;
44

5+
use Walker_Nav_Menu;
6+
57
class Accessible_Menu_Walker extends Walker_Nav_Menu {
68

79
/**
810
* @param $output
911
* @param int $depth
1012
* @param array $args
1113
*/
12-
public function start_lvl( &$output, $depth = 0, $args = [] ) {
14+
public function start_lvl( &$output, $depth = 0, $args = null ): void {
1315
$indent = str_repeat( "\t", $depth );
1416
$output .= "\n$indent<div class='amenu__panel'><ul class='sub-menu amenu__sub-menu'>\n";
1517
}
@@ -19,7 +21,7 @@ public function start_lvl( &$output, $depth = 0, $args = [] ) {
1921
* @param int $depth
2022
* @param array $args
2123
*/
22-
public function end_lvl( &$output, $depth = 0, $args = [] ) {
24+
public function end_lvl( &$output, $depth = 0, $args = null ): void {
2325
$indent = str_repeat( "\t", $depth );
2426
$output .= "$indent</ul></div>\n";
2527
}

inc/Services/Assets.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use BEA\Theme\Framework\Service;
66
use BEA\Theme\Framework\Service_Container;
77
use BEA\Theme\Framework\Tools\Assets as Assets_Tools;
8+
use function json_last_error;
9+
use const JSON_ERROR_NONE;
810

911
/**
1012
* Class Assets
@@ -113,22 +115,22 @@ public function stylesheet_uri( string $stylesheet_uri ): string {
113115
*
114116
* @param string $type
115117
*
116-
* @return bool|null
118+
* @return string
117119
*/
118-
public function get_min_file( string $type ): ?bool {
120+
public function get_min_file( string $type ): string {
119121
if ( empty( $type ) ) {
120-
return false;
122+
return '';
121123
}
122124

123125
if ( ! file_exists( \get_theme_file_path( '/dist/assets.json' ) ) ) {
124-
return false;
126+
return '';
125127
}
126128

127129
$json = file_get_contents( \get_theme_file_path( '/dist/assets.json' ) ); //phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
128130
$assets = json_decode( $json, true );
129131

130-
if ( empty( $assets ) ) {
131-
return false;
132+
if ( empty( $assets ) || JSON_ERROR_NONE !== json_last_error() ) {
133+
return '';
132134
}
133135

134136
switch ( $type ) {
@@ -155,7 +157,7 @@ public function get_min_file( string $type ): ?bool {
155157
}
156158

157159
if ( empty( $file ) ) {
158-
return false;
160+
return '';
159161
}
160162

161163
return $file;

0 commit comments

Comments
 (0)