@@ -185,8 +185,7 @@ |
||
| 185 | 185 | { |
| 186 | 186 | try { |
| 187 | 187 | return $this->make( $parameter->getClass()->name ); |
| 188 | - } |
|
| 189 | - catch( BindingResolutionException $e ) { |
|
| 188 | + } catch( BindingResolutionException $e ) { |
|
| 190 | 189 | if( $parameter->isOptional() ) { |
| 191 | 190 | return $parameter->getDefaultValue(); |
| 192 | 191 | } |
@@ -72,7 +72,9 @@ |
||
| 72 | 72 | public function pageTitle() |
| 73 | 73 | { |
| 74 | 74 | foreach( ['is_404', 'is_archive', 'is_home', 'is_page', 'is_search'] as $bool ) { |
| 75 | - if( !$bool() )continue; |
|
| 75 | + if( !$bool() ) { |
|
| 76 | + continue; |
|
| 77 | + } |
|
| 76 | 78 | $method = sprintf( 'get%sTitle', ucfirst( str_replace( 'is_', '', $bool ))); |
| 77 | 79 | return $this->$method(); |
| 78 | 80 | } |
@@ -43,8 +43,7 @@ discard block |
||
| 43 | 43 | printf( '<div class="print__r"><pre>%s</pre></div>', |
| 44 | 44 | htmlspecialchars( print_r( func_get_arg(0), true ), ENT_QUOTES, 'UTF-8' ) |
| 45 | 45 | ); |
| 46 | - } |
|
| 47 | - else if( $args > 1 ) { |
|
| 46 | + } else if( $args > 1 ) { |
|
| 48 | 47 | echo '<div class="print__r_group">'; |
| 49 | 48 | foreach( func_get_args() as $value ) { |
| 50 | 49 | $this->print( $value ); |
@@ -56,7 +55,9 @@ discard block |
||
| 56 | 55 | public function printFiltersFor( $hook = '' ) |
| 57 | 56 | { |
| 58 | 57 | global $wp_filter; |
| 59 | - if( empty( $hook ) || !isset( $wp_filter[$hook] ))return; |
|
| 58 | + if( empty( $hook ) || !isset( $wp_filter[$hook] )) { |
|
| 59 | + return; |
|
| 60 | + } |
|
| 60 | 61 | $this->print( $wp_filter[ $hook ] ); |
| 61 | 62 | } |
| 62 | 63 | |
@@ -33,7 +33,9 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $post = get_post( $postId ); |
| 35 | 35 | |
| 36 | - if( !$postId || !$post )return; |
|
| 36 | + if( !$postId || !$post ) { |
|
| 37 | + return; |
|
| 38 | + } |
|
| 37 | 39 | if( !$title ) { |
| 38 | 40 | $title = $post->post_title; |
| 39 | 41 | } |
@@ -71,7 +73,9 @@ discard block |
||
| 71 | 73 | ? $this->postmeta->get( $metaKey ) |
| 72 | 74 | : $this->theme->pageTitle(); |
| 73 | 75 | |
| 74 | - if( !$value )return; |
|
| 76 | + if( !$value ) { |
|
| 77 | + return; |
|
| 78 | + } |
|
| 75 | 79 | |
| 76 | 80 | $this->utility->printTag( $tag, wp_strip_all_tags( $value ), $attributes ); |
| 77 | 81 | } |
@@ -37,7 +37,9 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | public function render() |
| 39 | 39 | { |
| 40 | - if( !isset( $this->video->html ))return; |
|
| 40 | + if( !isset( $this->video->html )) { |
|
| 41 | + return; |
|
| 42 | + } |
|
| 41 | 43 | return sprintf( |
| 42 | 44 | '<div class="video embed">%s%s</div>', |
| 43 | 45 | $this->renderScreenshot(), |
@@ -61,7 +63,9 @@ discard block |
||
| 61 | 63 | |
| 62 | 64 | public function renderScreenshot() |
| 63 | 65 | { |
| 64 | - if( !$this->args['image'] )return; |
|
| 66 | + if( !$this->args['image'] ) { |
|
| 67 | + return; |
|
| 68 | + } |
|
| 65 | 69 | return sprintf( '<div class="video-screenshot" style="background-image: url(%s)">%s</div>', |
| 66 | 70 | $this->args['image'], |
| 67 | 71 | $this->renderPlayButton() |
@@ -99,7 +103,9 @@ discard block |
||
| 99 | 103 | |
| 100 | 104 | foreach( $this->args as $key => $value ) { |
| 101 | 105 | $method = $this->utility->buildMethodName( $key, 'set' ); |
| 102 | - if( !method_exists( $this, $method ))continue; |
|
| 106 | + if( !method_exists( $this, $method )) { |
|
| 107 | + continue; |
|
| 108 | + } |
|
| 103 | 109 | call_user_func([ $this, $method ], $value ); |
| 104 | 110 | } |
| 105 | 111 | return $this->args; |
@@ -65,7 +65,9 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | $image = $this->image->get( $attachment->ID )->image; |
| 67 | 67 | |
| 68 | - if( !$image )return; |
|
| 68 | + if( !$image ) { |
|
| 69 | + return; |
|
| 70 | + } |
|
| 69 | 71 | return sprintf( |
| 70 | 72 | '<figure class="gallery-image" data-w="%s" data-h="%s" data-ps=\'%s\' itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">' . |
| 71 | 73 | '%s<figcaption itemprop="caption description">' . |
@@ -86,7 +88,9 @@ discard block |
||
| 86 | 88 | */ |
| 87 | 89 | public function renderPagination() |
| 88 | 90 | { |
| 89 | - if( !$this->args['pagination'] )return; |
|
| 91 | + if( !$this->args['pagination'] ) { |
|
| 92 | + return; |
|
| 93 | + } |
|
| 90 | 94 | return paginate_links([ |
| 91 | 95 | 'before_page_number' => '<span class="screen-reader-text">' . __( 'Page', 'castor' ) . ' </span>', |
| 92 | 96 | 'current' => $this->gallery->query['paged'], |
@@ -25,7 +25,9 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function get( $attachment ) |
| 27 | 27 | { |
| 28 | - if( !( $attachment = $this->normalize( $attachment )))return; |
|
| 28 | + if( !( $attachment = $this->normalize( $attachment ))) { |
|
| 29 | + return; |
|
| 30 | + } |
|
| 29 | 31 | if( $thumbnail = wp_get_attachment_image_src( $attachment, 'thumbnail' )) { |
| 30 | 32 | $medium = $this->normalizeSrc( wp_get_attachment_image_src( $attachment, 'medium' ), $thumbnail ); |
| 31 | 33 | $large = $this->normalizeSrc( wp_get_attachment_image_src( $attachment, 'large' ), $medium ); |
@@ -59,7 +61,9 @@ discard block |
||
| 59 | 61 | |
| 60 | 62 | $attachment = get_post( $attachmentId ); |
| 61 | 63 | |
| 62 | - if( is_null( $attachment ) || $attachment->post_type != 'attachment' )return; |
|
| 64 | + if( is_null( $attachment ) || $attachment->post_type != 'attachment' ) { |
|
| 65 | + return; |
|
| 66 | + } |
|
| 63 | 67 | |
| 64 | 68 | return $attachment->ID; |
| 65 | 69 | } |