for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Helick\Blocks;
use Helick\Blocks\Contracts\Bootable;
use Helick\Blocks\Contracts\Composable;
/**
* Get the list of registered blocks.
*
* @param array $blocks
* @return array
*/
function blocks(array $blocks = []): array
{
* Control the list of registered blocks.
$blocks = apply_filters('helick_blocks', $blocks);
apply_filters
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
$blocks = /** @scrutinizer ignore-call */ apply_filters('helick_blocks', $blocks);
$blocks = array_filter((array)$blocks, function (string $class) {
return $class instanceof Composable;
});
$blocks = array_unique($blocks);
return $blocks;
}
* Bootstrap the given blocks.
* @return void
function bootstrap(array $blocks): void
$blocks = array_filter($blocks, function (string $class) {
return $class instanceof Bootable;
array_walk($blocks, static function (Bootable $block) {
$block::boot();