Issues (24)

src/Chips/Controller/Commands.php (1 issue)

1
<?php
2
/**
3
 * Controller commands
4
 * User: moyo
5
 * Date: 2018/6/11
6
 * Time: 10:14 AM
7
 */
8
9
namespace Carno\Web\Chips\Controller;
10
11
use Carno\HTTP\Standard\Response;
12
13
trait Commands
14
{
15
    /**
16
     * @param string $target
17
     * @param bool $permanently
18
     * @return Response
19
     */
20
    final public function redirect(string $target, bool $permanently = false) : Response
21
    {
22
        return $this->response = new Response($permanently ? 301 : 302, ['Location' => $target]);
0 ignored issues
show
Bug Best Practice introduced by
The property response does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
23
    }
24
}
25