initial commit
This commit is contained in:
		
							
								
								
									
										100
									
								
								src/Entity/Route.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										100
									
								
								src/Entity/Route.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,100 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace App\Entity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use Closure;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Route
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public function __construct(
 | 
				
			||||||
 | 
					        private string $name,
 | 
				
			||||||
 | 
					        private string $route,
 | 
				
			||||||
 | 
					        private string $regEx,
 | 
				
			||||||
 | 
					        private array $parameters,
 | 
				
			||||||
 | 
					        private Closure $callback
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        // empty body
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @return string
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function getName(): string
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return $this->name;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @param string $name
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function setName(string $name): void
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->name = $name;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @return string
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function getRoute(): string
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return $this->route;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @param string $route
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function setRoute(string $route): void
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->route = $route;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @return string
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function getRegEx(): string
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return $this->regEx;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @param string $regEx
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function setRegEx(string $regEx): void
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->regEx = $regEx;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @return array
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function getParameters(): array
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return $this->parameters;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @param array $parameters
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function setParameters(array $parameters): void
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->parameters = $parameters;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @return Closure
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function getCallback(): Closure
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return $this->callback;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @param Closure $callback
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function setCallback(Closure $callback): void
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->callback = $callback;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user