11<?php
2- /**
3- * MslsOutput
4- * @author Dennis Ploetner <[email protected] > 5- * @since 0.9.8
6- */
72
83namespace lloc \Msls ;
94
105use lloc \Msls \Map \HrefLang ;
116
127/**
138 * Output in the frontend
9+ *
1410 * @package Msls
1511 */
1612class MslsOutput extends MslsMain {
1713
1814 /**
1915 * Holds the format for the output
16+ *
2017 * @var array $tags
2118 */
2219 protected $ tags ;
2320
2421 /**
2522 * Creates and gets the output as an array
2623 *
27- * @param int $display
24+ * @param int $display
2825 * @param bool $filter
2926 * @param bool $exists
3027 *
@@ -33,7 +30,7 @@ class MslsOutput extends MslsMain {
3330 * @uses MslsOptions
3431 */
3532 public function get ( $ display , $ filter = false , $ exists = false ) {
36- $ arr = [] ;
33+ $ arr = array () ;
3734
3835 $ blogs = $ this ->collection ->get_filtered ( $ filter );
3936 if ( $ blogs ) {
@@ -73,9 +70,8 @@ public function get( $display, $filter = false, $exists = false ) {
7370 * @param bool $is_current_blog
7471 *
7572 * @since 0.9.8
76- *
7773 */
78- $ arr [] = ( string ) apply_filters ( 'msls_output_get ' , $ url , $ link , $ is_current_blog );
74+ $ arr [] = (string ) apply_filters ( 'msls_output_get ' , $ url , $ link , $ is_current_blog );
7975 } else {
8076 $ arr [] = sprintf (
8177 '<a href="%s" title="%s"%s>%s</a> ' ,
@@ -101,7 +97,7 @@ public function get_alternate_links() {
10197 $ hreflang = new HrefLang ( $ blogs );
10298 $ options = MslsOptions::create ();
10399
104- $ arr = [] ;
100+ $ arr = array () ;
105101 $ default = '' ;
106102
107103 foreach ( $ blogs ->get_objects () as $ blog ) {
@@ -132,6 +128,7 @@ public function get_alternate_links() {
132128
133129 /**
134130 * Returns a string when the object will be treated like a string
131+ *
135132 * @return string
136133 */
137134 public function __toString () {
@@ -147,32 +144,32 @@ public function __toString() {
147144 $ tags = $ this ->get_tags ();
148145
149146 return $ tags ['before_output ' ] . $ tags ['before_item ' ] .
150- implode ( $ tags ['after_item ' ] . $ tags ['before_item ' ], $ arr ) .
151- $ tags ['after_item ' ] . $ tags ['after_output ' ];
147+ implode ( $ tags ['after_item ' ] . $ tags ['before_item ' ], $ arr ) .
148+ $ tags ['after_item ' ] . $ tags ['after_output ' ];
152149 }
153150
154151 /**
155152 * Gets tags for the output
153+ *
156154 * @return array
157155 */
158156 public function get_tags () {
159157 if ( empty ( $ this ->tags ) ) {
160- $ this ->tags = [
158+ $ this ->tags = array (
161159 'before_item ' => $ this ->options ->before_item ,
162160 'after_item ' => $ this ->options ->after_item ,
163161 'before_output ' => $ this ->options ->before_output ,
164162 'after_output ' => $ this ->options ->after_output ,
165- ] ;
163+ ) ;
166164
167165 /**
168166 * Returns tags array for the output
169167 *
170168 * @param array $tags
171169 *
172170 * @since 1.0
173- *
174171 */
175- $ this ->tags = ( array ) apply_filters ( 'msls_output_get_tags ' , $ this ->tags );
172+ $ this ->tags = (array ) apply_filters ( 'msls_output_get_tags ' , $ this ->tags );
176173 }
177174
178175 return $ this ->tags ;
@@ -185,7 +182,7 @@ public function get_tags() {
185182 *
186183 * @return MslsOutput
187184 */
188- public function set_tags ( array $ arr = [] ) {
185+ public function set_tags ( array $ arr = array () ) {
189186 $ this ->tags = wp_parse_args ( $ this ->get_tags (), $ arr );
190187
191188 return $ this ;
@@ -195,8 +192,8 @@ public function set_tags( array $arr = [] ) {
195192 * Returns true if the requirements not fulfilled
196193 *
197194 * @param MslsOptions|null $thing
198- * @param boolean $exists
199- * @param string $language
195+ * @param boolean $exists
196+ * @param string $language
200197 *
201198 * @return boolean
202199 */
@@ -207,5 +204,4 @@ public function is_requirements_not_fulfilled( $thing, $exists, $language ) {
207204
208205 return MslsOptions::class != get_class ( $ thing ) && ! $ thing ->has_value ( $ language ) && $ exists ;
209206 }
210-
211207}
0 commit comments