Вход Регистрация
Файл: vendor/laravel/prompts/src/TextPrompt.php
Строк: 28
<?php

namespace LaravelPrompts;

use 
Closure;

class 
TextPrompt extends Prompt
{
    use 
ConcernsTypedValue;

    
/**
     * Create a new TextPrompt instance.
     */
    
public function __construct(
        public 
string $label,
        public 
string $placeholder '',
        public 
string $default '',
        public 
bool|string $required false,
        public 
mixed $validate null,
        public 
string $hint '',
        public ?
Closure $transform null,
    ) {
        
$this->trackTypedValue($default);
    }

    
/**
     * Get the entered value with a virtual cursor.
     */
    
public function valueWithCursor(int $maxWidth): string
    
{
        if (
$this->value() === '') {
            return 
$this->dim($this->addCursor($this->placeholder0$maxWidth));
        }

        return 
$this->addCursor($this->value(), $this->cursorPosition$maxWidth);
    }
}
Онлайн: 1
Реклама