Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Dec 15, 2022
1 parent 0ae5b88 commit 986ec3d
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions lib/compat/wordpress-6.2/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -1562,10 +1562,12 @@ protected static function replace_slug_in_string( $input, $slug ) {
* for the presets and adds them to the $declarations array
* following the format:
*
* array(
* 'name' => 'property_name',
* 'value' => 'property_value,
* )
* ```php
* array(
* 'name' => 'property_name',
* 'value' => 'property_value,
* )
* ```
*
* @since 5.8.0
* @since 5.9.0 Added the `$origins` parameter.
Expand Down Expand Up @@ -1594,10 +1596,12 @@ protected static function compute_preset_vars( $settings, $origins ) {
* for the custom values and adds them to the $declarations
* array following the format:
*
* array(
* 'name' => 'property_name',
* 'value' => 'property_value,
* )
* ```php
* array(
* 'name' => 'property_name',
* 'value' => 'property_value,
* )
* ```
*
* @since 5.8.0
*
Expand Down Expand Up @@ -1681,10 +1685,12 @@ protected static function flatten_tree( $tree, $prefix = '', $token = '--' ) {
* Given a styles array, it extracts the style properties
* and adds them to the $declarations array following the format:
*
* array(
* 'name' => 'property_name',
* 'value' => 'property_value,
* )
* ```php
* array(
* 'name' => 'property_name',
* 'value' => 'property_value,
* )
* ```
*
* @since 5.8.0
* @since 5.9.0 Added the `$settings` and `$properties` parameters.
Expand Down Expand Up @@ -1824,7 +1830,7 @@ protected static function get_property_value( $styles, $path, $theme_json = null
'get_property_value',
sprintf(
/* translators: 1: theme.json, 2: Value name, 3: Value path, 4: Another value name. */
__( 'Your %1$s file uses a dynamic value (%2$s) for the path at %3$s. However, the value at %3$s is also a dynamic value (pointing to %4$s) and pointing to another dynamic value is not supported. Please update %3$s to point directly to %4$s.' ),
__( 'Your %1$s file uses a dynamic value (%2$s) for the path at %3$s. However, the value at %3$s is also a dynamic value (pointing to %4$s) and pointing to another dynamic value is not supported. Please update %3$s to point directly to %4$s.', 'gutenberg' ),
'theme.json',
$ref_value_string,
$path_string,
Expand Down Expand Up @@ -2015,7 +2021,7 @@ public function get_styles_block_nodes() {
*/
private static function update_separator_declarations( $declarations ) {
// Gutenberg and core implementation differed.
// https://github.com/WordPress/gutenberg/pull/44943
// https://github.com/WordPress/gutenberg/pull/44943.
$background_color = '';
$border_color_matches = false;
$text_color_matches = false;
Expand Down Expand Up @@ -3110,7 +3116,7 @@ public function set_spacing_sizes() {
|| ! is_numeric( $spacing_scale['mediumStep'] )
|| ( '+' !== $spacing_scale['operator'] && '*' !== $spacing_scale['operator'] ) ) {
if ( ! empty( $spacing_scale ) ) {
trigger_error( __( 'Some of the theme.json settings.spacing.spacingScale values are invalid' ), E_USER_NOTICE );
trigger_error( __( 'Some of the theme.json settings.spacing.spacingScale values are invalid', 'gutenberg' ), E_USER_NOTICE );
}
return null;
}
Expand Down Expand Up @@ -3144,7 +3150,7 @@ public function set_spacing_sizes() {

$below_sizes[] = array(
/* translators: %s: Digit to indicate multiple of sizing, eg. 2X-Small. */
'name' => $below_midpoint_count === $steps_mid_point - 1 ? __( 'Small' ) : sprintf( __( '%sX-Small' ), (string) $x_small_count ),
'name' => $below_midpoint_count === $steps_mid_point - 1 ? __( 'Small', 'gutenberg' ) : sprintf( __( '%sX-Small', 'gutenberg' ), (string) $x_small_count ),
'slug' => (string) $slug,
'size' => round( $current_step, 2 ) . $unit,
);
Expand All @@ -3163,7 +3169,7 @@ public function set_spacing_sizes() {
$below_sizes = array_reverse( $below_sizes );

$below_sizes[] = array(
'name' => __( 'Medium' ),
'name' => __( 'Medium', 'gutenberg' ),
'slug' => '50',
'size' => $spacing_scale['mediumStep'] . $unit,
);
Expand All @@ -3181,7 +3187,7 @@ public function set_spacing_sizes() {

$above_sizes[] = array(
/* translators: %s: Digit to indicate multiple of sizing, eg. 2X-Large. */
'name' => 0 === $above_midpoint_count ? __( 'Large' ) : sprintf( __( '%sX-Large' ), (string) $x_large_count ),
'name' => 0 === $above_midpoint_count ? __( 'Large', 'gutenberg' ) : sprintf( __( '%sX-Large', 'gutenberg' ), (string) $x_large_count ),
'slug' => (string) $slug,
'size' => round( $current_step, 2 ) . $unit,
);
Expand Down

0 comments on commit 986ec3d

Please sign in to comment.