for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Helick\BetterExcerpt;
use Helick\Contracts\Bootable;
final class Editor implements Bootable
{
/**
* Boot the service.
*
* @return void
*/
public static function boot(): void
$self = new static;
add_filter('teeny_mce_buttons', [$self, 'buttons'], 10, 2);
add_filter
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
/** @scrutinizer ignore-call */
}
* Remove unused buttons from the post excerpt editor.
* @param array $buttons
* @param string $editorId
* @return array
public function buttons(array $buttons, string $editorId): array
if ($editorId !== 'excerpt') {
return $buttons;
$buttons = array_values(array_diff($buttons, [
'blockquote',
'bullist',
'numlist',
'alignleft',
'alignright',
'aligncenter',
'fullscreen',
]));
* Control the editor buttons.
$buttons = apply_filters('helick_better_excerpt_editor_buttons', $buttons);
apply_filters
$buttons = /** @scrutinizer ignore-call */ apply_filters('helick_better_excerpt_editor_buttons', $buttons);
return (array)$buttons;