Captcha_Controller   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 9
rs 10
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __call() 0 6 1
1
<?php defined('SYSPATH') or die('No direct access allowed.');
2
/**
3
 * Outputs the dynamic Captcha resource.
4
 * Usage: Call the Captcha controller from a view, e.g.
5
 *        <img src="<?php echo url::site('captcha') ?>" />
6
 *
7
 * $Id: captcha.php 3769 2008-12-15 00:48:56Z zombor $
8
 *
9
 * @package    Captcha
10
 * @author     Kohana Team
11
 * @copyright  (c) 2007-2008 Kohana Team
12
 * @license    http://kohanaphp.com/license.html
13
 */
14
class Captcha_Controller extends Controller
15
{
16
    public function __call($method, $args)
17
    {
18
        // Output the Captcha challenge resource (no html)
19
        // Pull the config group name from the URL
20
        Captcha::factory($this->uri->segment(2))->render(false);
0 ignored issues
show
Bug introduced by
The property uri does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
21
    }
22
} // End Captcha_Controller
23