1 | <?php |
||
16 | class RedirectionCollection extends Collection |
||
17 | { |
||
18 | /* ----------------------------------------------------------------- |
||
19 | | Main Methods |
||
20 | | ----------------------------------------------------------------- |
||
21 | */ |
||
22 | |||
23 | /** |
||
24 | * Make a new redirection. |
||
25 | * |
||
26 | * @param string $from |
||
27 | * @param string $to |
||
28 | * @param int $status |
||
29 | * |
||
30 | * @return \Arcanedev\MissingUrlsRedirector\Entities\Redirection |
||
31 | */ |
||
32 | 72 | public function newRedirection(string $from, string $to, int $status): Redirection |
|
36 | |||
37 | /** |
||
38 | * Add multiple redirections. |
||
39 | * |
||
40 | * @param iterable $from |
||
41 | * @param string $to |
||
42 | * @param int $status |
||
43 | * |
||
44 | * @return $this |
||
45 | */ |
||
46 | 12 | public function addMany(iterable $from, string $to, int $status = RedirectResponse::HTTP_FOUND) |
|
56 | |||
57 | /** |
||
58 | * Add a new redirection. |
||
59 | * |
||
60 | * @param string $from |
||
61 | * @param string $to |
||
62 | * @param int $status |
||
63 | * |
||
64 | * @return $this |
||
65 | */ |
||
66 | 72 | public function addOne(string $from, string $to, int $status = RedirectResponse::HTTP_MOVED_PERMANENTLY): self |
|
74 | |||
75 | /** |
||
76 | * Add a redirection into the collection. |
||
77 | * |
||
78 | * @param \Arcanedev\MissingUrlsRedirector\Entities\Redirection $redirection |
||
79 | * |
||
80 | * @return $this |
||
81 | */ |
||
82 | 84 | public function addRedirection(Redirection $redirection) |
|
98 | } |
||
99 |