Helper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A result() 0 9 2
1
<?php
2
/**
3
 * @package    Fuel\Common
4
 * @version    2.0
5
 * @author     Fuel Development Team
6
 * @license    MIT License
7
 * @copyright  2010 - 2015 Fuel Development Team
8
 * @link       http://fuelphp.com
9
 */
10
11
namespace Fuel\Common;
12
13
/**
14
 * Contains misc helper functions
15
 *
16
 * @package Fuel\Common
17
 *
18
 * @since 2.0
19
 */
20
abstract class Helper
21
{
22
	/**
23
	 * Checks if a return value is a Closure without params, and if
24
	 * so executes it before returning it.
25
	 *
26
	 * @param mixed $val
27
	 *
28
	 * @return mixed
29
	 */
30
	public static function result($val)
31
	{
32
		if ( $val instanceof Closure )
0 ignored issues
show
Bug introduced by
The class Fuel\Common\Closure does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
33
		{
34
			return $val();
35
		}
36
37
		return $val;
38
	}
39
}
40