Skip to content

Commit

Permalink
Remove update_data function from BaseBlock.php
Browse files Browse the repository at this point in the history
This was not used
  • Loading branch information
mleray committed Jan 20, 2025
1 parent d921ebd commit c798b57
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/Blocks/BaseBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,6 @@ public static function is_rest_request(): bool
return defined('REST_REQUEST') && REST_REQUEST;
}

/**
* Update the attributes of a block to the latest version.
* It returns an array with the new version of the block attributes.
* PHPCS does not allow me to add the return type if there is no return statement, but here we always throw an
* exception, so adding a return after triggers another CS rule. Disabling the violated rule,
* Squiz.Commenting.FunctionComment.InvalidNoReturn, is not working in the doc comment.
*
* @param array $attributes The old version of the block attributes.
* @throws NotImplemented If no implementation is given by the subclass.
* @phpcs:disable SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
*/
public static function update_data(array $attributes): array
{
throw new NotImplemented('Method update_data is not implemented for ' . static::class);
}
//phpcs:enable SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter

/**
* Returns the block name with its namespace prefix, e.g.: planet4-blocks/accordion.
*/
Expand Down

0 comments on commit c798b57

Please sign in to comment.