GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( b073e5...cb660e )
by Calima
9s
created

CFSolicitud::setControlador()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
 *
16
 * This software consists of voluntary contributions made by many individuals
17
 * and is licensed under the MIT license. For more information, see
18
 * @category   
19
 * @package    sistema/nucleo
20
 * @copyright  Copyright (c) 2006 - 2014 webcol.net (http://www.webcol.net/calima)
21
 * @license	https://github.com/webcol/Calima/blob/master/LICENSE	MIT
22
 * @version	##BETA 1.0##, ##2014 - 2015##
23
 * <http://www.calimaframework.com>.
24
 */
25
26
namespace Sistema\Nucleo;
27
28
class CFSolicitud
29
{
30
    private $_controlador;
31
    private $_metodo;
32
    private $_argumentos;
33
    
34
    public function __construct() {
0 ignored issues
show
Coding Style introduced by
__construct uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
35
        if(isset($_GET['url'])){
36
            $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL);
37
            $url = explode('/', $url);
38
            $url = array_filter($url);
39
            
40
            //$this->_controlador = strtolower(array_shift($url));
41
            //$this->_metodo = strtolower(array_shift($url));
42
            //$this->_argumentos = $url;
43
            
44
            $this->setControlador(strtolower(array_shift($url)));
45
            $this->setMetodo(strtolower(array_shift($url)));
46
            $this->setArgumentos($url);
47
        }       
48
        
49
        if(!$this->getControlador()){
50
            $this->setControlador(CONTROLADOR_INICIAL);
51
        }
52
        
53
        if(!$this->getMetodo()){
54
            $this->setMetodo('index');
55
        }
56
        
57
        if(!isset($this->getArgumentos())){
58
            $this->setArgumentos(array());
59
        }
60
    }
61
    
62
    public function getControlador()
63
    {
64
        return $this->_controlador;
65
    }
66
    
67
    public function getMetodo()
68
    {
69
        return $this->_metodo;
70
    }
71
    
72
    public function getArgumentos()
73
    {
74
        return $this->_argumentos;
75
    }
76
    
77
    public function setControlador($controlador)
78
    {
79
        return $this->_controlador=$controlador;
80
    }
81
    
82
    public function setMetodo($metodo)
83
    {
84
        return $this->_metodo=$metodo;
85
    }
86
    
87
    public function setArgumentos($argumento)
88
    {
89
        return $this->_argumentos=$argumento;
90
    }
91
}
92