Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix PHPCS errors.
  • Loading branch information
juanfra committed Oct 13, 2025
commit 132eb45c7260c9027f3a46852624c66801ffc21f
8 changes: 4 additions & 4 deletions lib/block-supports/spacing.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
*
* @return string|null Spacing size value or `null` if a size is not passed in $preset.
*/
function gutenberg_get_spacing_size_value( $preset, $settings = array() ) {

Check warning on line 94 in lib/block-supports/spacing.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Unused function parameter $settings.
if ( ! isset( $preset['size'] ) ) {
return null;
}
Expand Down Expand Up @@ -124,12 +124,12 @@

// Build clamp() only when explicit min/preferred/max are provided via fluid object.
if ( is_array( $fluid_spacing_settings ) && ! empty( $fluid_spacing_settings ) ) {
$min = isset( $fluid_spacing_settings['min'] ) ? trim( (string) $fluid_spacing_settings['min'] ) : '';
$preferred = isset( $fluid_spacing_settings['preferred'] ) ? trim( (string) $fluid_spacing_settings['preferred'] ) : trim( (string) $size );
$max = isset( $fluid_spacing_settings['max'] ) ? trim( (string) $fluid_spacing_settings['max'] ) : '';
$min = isset( $fluid_spacing_settings['min'] ) ? trim( (string) $fluid_spacing_settings['min'] ) : '';
$preferred = isset( $fluid_spacing_settings['preferred'] ) ? trim( (string) $fluid_spacing_settings['preferred'] ) : trim( (string) $size );
$max = isset( $fluid_spacing_settings['max'] ) ? trim( (string) $fluid_spacing_settings['max'] ) : '';

// All three are required to form a valid clamp().
if ( $min !== '' && $preferred !== '' && $max !== '' ) {
if ( '' !== $min && '' !== $preferred && '' !== $max ) {
return sprintf( 'clamp(%s, %s, %s)', $min, $preferred, $max );
}
}
Expand Down
Loading