Skip to content

Commit fcc4104

Browse files
committed
Using exit as a function
1 parent f9c36b9 commit fcc4104

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

phpcs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
<exclude name="SlevomatCodingStandard.Arrays.DisallowPartiallyKeyed.DisallowedPartiallyKeyed"/>
7171
<exclude name="SlevomatCodingStandard.Classes.RequireSingleLineMethodSignature.RequiredSingleLineSignature"/>
7272
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming.SuperfluousSuffix"/>
73+
<exclude name="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses.UsedWithParentheses"/>
7374
<exclude name="SlevomatCodingStandard.ControlStructures.NewWithoutParentheses.UselessParentheses"/>
7475
<exclude name="SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse.MissingTrailingComma"/>
7576
<exclude name="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration.MissingTrailingComma"/>

src/php/frontend/class-video-proxy.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static function ajax_handler_body() {
5757

5858
if ( false === $transient ) {
5959
http_response_code( 404 );
60-
die;
60+
exit();
6161
}
6262

6363
header( 'Accept-Ranges: bytes' );
@@ -87,7 +87,7 @@ public static function ajax_handler_body() {
8787

8888
if ( is_null( $stream ) ) {
8989
http_response_code( 500 );
90-
die;
90+
exit();
9191
}
9292

9393
ob_end_clean();
@@ -116,7 +116,7 @@ private static function resolve_range( $size ) {
116116

117117
if ( 2 !== count( $limits ) ) {
118118
http_response_code( 416 );
119-
die;
119+
exit();
120120
}
121121

122122
$raw_start = $limits[0];
@@ -134,7 +134,7 @@ private static function resolve_range( $size ) {
134134

135135
if ( $start > $end ) {
136136
http_response_code( 416 );
137-
die;
137+
exit();
138138
}
139139

140140
return array( $start, $end );
@@ -152,15 +152,15 @@ private static function resolve_range( $size ) {
152152
private static function check_range_header( $header ) {
153153
if ( ! str_starts_with( $header, 'bytes=' ) ) {
154154
http_response_code( 416 );
155-
die;
155+
exit();
156156
}
157157

158158
$header = substr( $header, 6 );
159159

160160
// Multipart range requests are not supported.
161161
if ( str_contains( $header, ',' ) ) {
162162
http_response_code( 416 );
163-
die;
163+
exit();
164164
}
165165

166166
return $header;

0 commit comments

Comments
 (0)