Вход Регистрация
Файл: vendor/laravel/framework/src/Illuminate/Console/View/Components/Factory.php
Строк: 138
<?php

namespace IlluminateConsoleViewComponents;

use 
InvalidArgumentException;

/**
 * @method void alert(string $string, int $verbosity = SymfonyComponentConsoleOutputOutputInterface::VERBOSITY_NORMAL)
 * @method void bulletList(array $elements, int $verbosity = SymfonyComponentConsoleOutputOutputInterface::VERBOSITY_NORMAL)
 * @method mixed choice(string $question, array $choices, $default = null)
 * @method bool confirm(string $question, bool $default = false)
 * @method void error(string $string, int $verbosity = SymfonyComponentConsoleOutputOutputInterface::VERBOSITY_NORMAL)
 * @method void info(string $string, int $verbosity = SymfonyComponentConsoleOutputOutputInterface::VERBOSITY_NORMAL)
 * @method void line(string $style, string $string, int $verbosity = SymfonyComponentConsoleOutputOutputInterface::VERBOSITY_NORMAL)
 * @method void task(string $description, ?callable $task = null, int $verbosity = SymfonyComponentConsoleOutputOutputInterface::VERBOSITY_NORMAL)
 * @method void twoColumnDetail(string $first, ?string $second = null, int $verbosity = SymfonyComponentConsoleOutputOutputInterface::VERBOSITY_NORMAL)
 * @method void warn(string $string, int $verbosity = SymfonyComponentConsoleOutputOutputInterface::VERBOSITY_NORMAL)
 */
class Factory
{
    
/**
     * The output interface implementation.
     *
     * @var IlluminateConsoleOutputStyle
     */
    
protected $output;

    
/**
     * Creates a new factory instance.
     *
     * @param  IlluminateConsoleOutputStyle  $output
     * @return void
     */
    
public function __construct($output)
    {
        
$this->output $output;
    }

    
/**
     * Dynamically handle calls into the component instance.
     *
     * @param  string  $method
     * @param  array  $parameters
     * @return mixed
     *
     * @throws InvalidArgumentException
     */
    
public function __call($method$parameters)
    {
        
$component 'IlluminateConsoleViewComponents\'.ucfirst($method);

        throw_unless(class_exists($component), new InvalidArgumentException(sprintf(
            '
Console component [%snot found.', $method
        )));

        return with(new $component($this->output))->render(...$parameters);
    }
}
Онлайн: 1
Реклама