You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							36 lines
						
					
					
						
							769 B
						
					
					
				
			
		
		
	
	
							36 lines
						
					
					
						
							769 B
						
					
					
				<?php
 | 
						|
 | 
						|
namespace App\Models\Validation\Messages\Factories;
 | 
						|
 | 
						|
use App\Models\Validation\Messages\Factories\MessageFactory;
 | 
						|
 | 
						|
class MessageByNameFactory extends MessageFactory
 | 
						|
{
 | 
						|
    private string $name;
 | 
						|
 | 
						|
    public function __construct(string $name)
 | 
						|
    {
 | 
						|
        $this->setName($name);
 | 
						|
    }
 | 
						|
 | 
						|
    public function setName(string $name): void
 | 
						|
    {
 | 
						|
        $this->name = $name;
 | 
						|
    }
 | 
						|
 | 
						|
    public function getName(): string
 | 
						|
    {
 | 
						|
        return $this->name;
 | 
						|
    }
 | 
						|
 | 
						|
    public function create(): array
 | 
						|
    {
 | 
						|
        return [
 | 
						|
            'found' => "A $this->name with the name is valid.",
 | 
						|
            'not_found' => "A $this->name with the name does not exist!!!",
 | 
						|
            'invalid_name' => "The $this->name name is empty, please, write the name!!!",
 | 
						|
        ];
 | 
						|
    }
 | 
						|
}
 | 
						|
 |