@@ -37,7 +37,7 @@ function osi_get_cache_key( $unique = '' ) {
3737function osi_get_cached_posts ( $ args ) {
3838
3939 if ( empty ( $ args ) || ! is_array ( $ args ) ) {
40- return [] ;
40+ return array () ;
4141 }
4242
4343 $ args ['suppress_filters ' ] = false ;
@@ -47,9 +47,9 @@ function osi_get_cached_posts( $args ) {
4747 $ cache_key = osi_get_cache_key ( $ args );
4848
4949 $ cache = new \Osi \Features \Inc \Cache ( $ cache_key );
50- $ result = $ cache ->expires_in ( $ expires_in )->updates_with ( 'get_posts ' , [ $ args ] )->get ();
50+ $ result = $ cache ->expires_in ( $ expires_in )->updates_with ( 'get_posts ' , array ( $ args ) )->get ();
5151
52- return ( ! empty ( $ result ) && is_array ( $ result ) ) ? $ result : [] ;
52+ return ( ! empty ( $ result ) && is_array ( $ result ) ) ? $ result : array () ;
5353}
5454
5555/**
@@ -60,7 +60,7 @@ function osi_get_cached_posts( $args ) {
6060 *
6161 * @return string Template markup.
6262 */
63- function osi_get_template_content ( $ slug , $ vars = [] ) {
63+ function osi_get_template_content ( $ slug , $ vars = array () ) {
6464
6565 ob_start ();
6666
@@ -69,19 +69,18 @@ function osi_get_template_content( $slug, $vars = [] ) {
6969 $ markup = ob_get_clean ();
7070
7171 return $ markup ;
72-
7372}
7473
7574/**
7675 * Get plugin template.
7776 *
78- * @param string $template Name or path of the template within /templates folder without php extension.
79- * @param array $variables pass an array of variables you want to use in template.
80- * @param bool $echo Whether to echo out the template content or not.
77+ * @param string $template Name or path of the template within /templates folder without php extension.
78+ * @param array $variables pass an array of variables you want to use in template.
79+ * @param boolean $echo Whether to echo out the template content or not.
8180 *
8281 * @return string|void Template markup.
8382 */
84- function osi_template ( $ template , $ variables = [] , $ echo = false ) {
83+ function osi_template ( $ template , $ variables = array () , $ echo = false ) {
8584
8685 $ template_file = sprintf ( '%1$s/templates/%2$s.php ' , OSI_PATH , $ template );
8786
@@ -104,31 +103,27 @@ function osi_template( $template, $variables = [], $echo = false ) {
104103 }
105104
106105 echo $ markup ; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped already in template.
107-
108106}
109107
110108/**
111109 * Get data file content from '/data' directory.
112110 *
113- * @param string $slug file Data file name without '.php' extention.
114- * @param array $default Default value to return if file not found.
111+ * @param string $slug file Data file name without '.php' extention.
112+ * @param array $default Default value to return if file not found.
115113 *
116114 * @return mixed Data file content.
117115 */
118- function osi_get_data ( $ slug , $ default = [] ) {
116+ function osi_get_data ( $ slug , $ default = array () ) {
119117
120118 $ data_file = sprintf ( OSI_PATH . '/inc/data/%s.php ' , $ slug );
121119
122120 if ( file_exists ( $ data_file ) ) {
123-
124121 $ file_content = require $ data_file ; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable
125122
126123 return $ file_content ;
127-
128124 }
129125
130126 return $ default ;
131-
132127}
133128
134129/**
@@ -139,7 +134,7 @@ function osi_get_data( $slug, $default = [] ) {
139134 * @see https://make.wordpress.org/core/2020/07/24/new-wp_get_environment_type-function-in-wordpress-5-5/
140135 * @see https://lobby.vip.wordpress.com/2020/08/20/environment-type-support/
141136 *
142- * @return bool Return true if it's production else return false.
137+ * @return boolean Return true if it's production else return false.
143138 */
144139function osi_is_production () {
145140
@@ -148,17 +143,16 @@ function osi_is_production() {
148143 }
149144
150145 return false ;
151-
152146}
153147
154148/**
155149 * Determine if the current User Agent matches the passed $kind
156150 *
157- * @param string $kind Category of mobile device to check for.
158- * Either: any, dumb, smart.
159- * @param bool $return_matched_agent Boolean indicating if the UA should be returned.
151+ * @param string $kind Category of mobile device to check for.
152+ * Either: any, dumb, smart.
153+ * @param boolean $return_matched_agent Boolean indicating if the UA should be returned.
160154 *
161- * @return bool |string Boolean indicating if current UA matches $kind. If
155+ * @return boolean |string Boolean indicating if current UA matches $kind. If
162156 * $return_matched_agent is true, returns the UA string
163157 */
164158function osi_is_mobile ( $ kind = 'any ' , $ return_matched_agent = false ) {
0 commit comments