Вход Регистрация
Файл: vendor/laravel/framework/src/Illuminate/Validation/Rules/DoesntContain.php
Строк: 54
<?php

namespace IlluminateValidationRules;

use 
IlluminateContractsSupportArrayable;
use 
Stringable;

use function 
IlluminateSupportenum_value;

class 
DoesntContain implements Stringable
{
    
/**
     * The values that should not be contained in the attribute.
     *
     * @var array
     */
    
protected $values;

    
/**
     * Create a new doesntContain rule instance.
     *
     * @param  IlluminateContractsSupportArrayable|UnitEnum|array|string  $values
     */
    
public function __construct($values)
    {
        if (
$values instanceof Arrayable) {
            
$values $values->toArray();
        }

        
$this->values is_array($values) ? $values func_get_args();
    }

    
/**
     * Convert the rule to a validation string.
     *
     * @return string
     */
    
public function __toString()
    {
        
$values array_map(function ($value) {
            
$value enum_value($value);

            return 
'"'.str_replace('"''""', (string) $value).'"';
        }, 
$this->values);

        return 
'doesnt_contain:'.implode(','$values);
    }
}
Онлайн: 1
Реклама