Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayadav09 committed Aug 22, 2024
1 parent 904999f commit bc5a99b
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions includes/Patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ public static function get_fallbacks() {
'contact-4' => 'yith-wonder/contact-us',
'testimonials-template-2' => 'yith-wonder/testimonials-page',
'header-1' => 'yith-wonder/site-header-left-logo-navigation-inline',
'header-3' => 'yith-wonder/site-header-centered',
'header-8' => 'yith-wonder/site-header-left-logo-navigation-below',
'header-10' => 'yith-wonder/site-header-splitted-menu',
'footer-15' => 'yith-wonder/site-footer',
'header-3' => 'yith-wonder/site-header-centered',
'header-8' => 'yith-wonder/site-header-left-logo-navigation-below',
'header-10' => 'yith-wonder/site-header-splitted-menu',
'footer-15' => 'yith-wonder/site-footer',
),
);
}
Expand Down Expand Up @@ -235,19 +235,19 @@ public static function get_theme_patterns_meta() {
/**
* Sanitize the content by cleaning wp_grammar.
*
* @param string $content Data to clean
* @param string $content Data to clean.
*
* @return string
*/
private static function cleanup_wp_grammar( $content ) {

// Remove template-part if that exists
// Remove template-part if that exists.
$content = preg_replace( '/^<!-- wp:template-part .* \/-->$/m', '', $content );

// Create an array with the values you want to replace
// Create an array with the values you want to replace.
$searches = array( "\n", "\t" );

// Replace the line breaks and tabs with a empty string
// Replace the line breaks and tabs with a empty string.
$content = str_replace( $searches, '', $content );

return $content;
Expand Down Expand Up @@ -312,7 +312,7 @@ public static function get_pattern_from_block_patterns_registry( $pattern_slug )
/**
* Retrieve pattern from slug.
*
* @param string $pattern_slug Pattern Slug Data
* @param string $pattern_slug Pattern Slug Data.
*
* @return array|boolean
*/
Expand Down Expand Up @@ -340,7 +340,7 @@ public static function get_pattern_from_slug( $pattern_slug ) {
* @return string|boolean
*/
private static function get_selected_header_from_flow_data() {
// fetch the selected header menu slug from DB
// fetch the selected header menu slug from DB.
$flow_data = \get_option( Options::get_option_name( 'flow' ), false );
if ( ! $flow_data ) {
return false;
Expand Down Expand Up @@ -369,7 +369,7 @@ private static function get_selected_header_from_flow_data() {
/**
* Replace the header menu slug in the patterns array
*
* @param array $pattern_content pattern grammar that is to be modified
* @param array $pattern_content pattern grammar that is to be modified.
*
* @return array
*/
Expand All @@ -392,8 +392,8 @@ private static function replace_split_menu_items( $pattern_content ) {
/**
* Retrieve Theme Step Patterns from chosen Theme in Previous Step
*
* @param string $step Step from which Theme Step Pattern is required
* @param boolean $squash Flag set to retrieve the block pattern
* @param string $step Step from which Theme Step Pattern is required.
* @param boolean $squash Flag set to retrieve the block pattern.
*
* @return array|string
*/
Expand All @@ -419,8 +419,8 @@ public static function get_theme_step_patterns_from_step( $step, $squash = false
if ( 'wonder-blocks' === $header_menu_data['type'] ) {
$pattern_slug_data['wonder_blocks'] = $slug;
} else {
// to update the chosen header from the fallback in the homelayouts page(wp-setup/step/design/homepage-menu)
$pattern_slug_data['wonder_blocks'] = array_search($active_theme . '/' . $slug, self::get_fallbacks()['wonder-blocks']);
// to update the chosen header from the fallback in the homelayouts page(wp-setup/step/design/homepage-menu).
$pattern_slug_data['wonder_blocks'] = array_search( $active_theme . '/' . $slug, self::get_fallbacks()['wonder-blocks'], true );
}
}
$pattern_slugs[ $pattern_slug ] = $pattern_slug_data;
Expand Down Expand Up @@ -465,7 +465,7 @@ public static function get_theme_step_patterns_from_step( $step, $squash = false
/**
* Retrieve Homepage Menu Step Patterns
*
* @param array $patterns Step Patterns Data
* @param array $patterns Step Patterns Data.
* @return array
*/
private static function filter_yith_wonder_homepage_patterns( $patterns ) {
Expand Down Expand Up @@ -497,7 +497,7 @@ private static function filter_yith_wonder_homepage_patterns( $patterns ) {
/**
* Retrieve Header Menu Step Patterns
*
* @param array $patterns Step Patterns Data
* @param array $patterns Step Patterns Data.
* @return array
*/
private static function filter_yith_wonder_headermenu_patterns( $patterns ) {
Expand Down

0 comments on commit bc5a99b

Please sign in to comment.