Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
15 | public function handle( Command $command ) |
||
16 | { |
||
17 | $review = glsr( ReviewManager::class )->create( $command ); |
||
18 | if( !$review ) { |
||
19 | glsr( Session::class )->set( $command->form_id.'errors', [] ); |
||
20 | glsr( Session::class )->set( $command->form_id.'message', __( 'Your review could not be submitted and the error has been logged. Please notify the site admin.', 'site-reviews' )); |
||
21 | return; |
||
22 | } |
||
23 | glsr( Session::class )->set( $command->form_id.'message', __( 'Your review has been submitted!', 'site-reviews' )); |
||
24 | glsr( Notification::class )->send( $review ); |
||
25 | do_action( 'site-reviews/local/review/submitted', null, $command ); // @compat |
||
26 | do_action( 'site-reviews/review/submitted', $review ); |
||
27 | if( $command->ajax_request )return; |
||
28 | wp_safe_redirect( $this->getReferer( $command )); |
||
29 | exit; |
||
1 ignored issue
–
show
|
|||
30 | } |
||
48 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.