master

laravel/framework

Last updated at: 29/12/2023 09:21

BulletList.php

TLDR

This file, located at src/Illuminate/Console/View/Components/BulletList.php, contains a class named BulletList that extends the Component class. It includes a method named render that renders the component using the given arguments.

Methods

render

This method renders the component using the given arguments. It takes an array of elements and an optional verbosity level as parameters. The method then mutates the elements array using three mutators: EnsureDynamicContentIsHighlighted, EnsureNoPunctuation, and EnsureRelativePaths. After the mutation, the method calls renderView and passes the mutated elements array as well as the verbosity level to it.

Classes

BulletList

This class extends the Component class and represents a bullet list component. It includes a render method which is used to render the component.

<?php

namespace Illuminate\Console\View\Components;

use Symfony\Component\Console\Output\OutputInterface;

class BulletList extends Component
{
    /**
     * Renders the component using the given arguments.
     *
     * @param  array<int, string>  $elements
     * @param  int  $verbosity
     * @return void
     */
    public function render($elements, $verbosity = OutputInterface::VERBOSITY_NORMAL)
    {
        $elements = $this->mutate($elements, [
            Mutators\EnsureDynamicContentIsHighlighted::class,
            Mutators\EnsureNoPunctuation::class,
            Mutators\EnsureRelativePaths::class,
        ]);

        $this->renderView('bullet-list', [
            'elements' => $elements,
        ], $verbosity);
    }
}