Completed
Push — master ( 39734d...9bfb60 )
by Zack
05:51 queued 02:37
created

gravityview.php ➔ gravityview()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 23 and the first side effect is on line 3.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/** If this file is called directly, abort. */
3
if ( ! defined( 'GRAVITYVIEW_DIR' ) )
0 ignored issues
show
Coding Style Best Practice introduced by
It is generally a best practice to always use braces with control structures.

Adding braces to control structures avoids accidental mistakes as your code changes:

// Without braces (not recommended)
if (true)
    doSomething();

// Recommended
if (true) {
    doSomething();
}
Loading history...
4
	die();
5
6
/** The future branch of GravityView requires PHP 5.3+ namespaces and SPL. */
7
if ( version_compare( phpversion(), '5.3' , '<' ) )
0 ignored issues
show
Coding Style Best Practice introduced by
It is generally a best practice to always use braces with control structures.

Adding braces to control structures avoids accidental mistakes as your code changes:

// Without braces (not recommended)
if (true)
    doSomething();

// Recommended
if (true) {
    doSomething();
}
Loading history...
8
	return false;
9
10
/** @define "GRAVITYVIEW_DIR" "../" Require core */
11
require GRAVITYVIEW_DIR . 'future/includes/class-gv-core.php';
12
13
/**
14
 * The main GravityView wrapper function.
15
 *
16
 * Exposes classes and functionality via the \GV\Core instance.
17
 *
18
 * @api
19
 * @since 2.0
20
 *
21
 * @return \GV\Core A global Core instance.
22
 */
23
function gravityview() {
24
	return \GV\Core::get();
25
}
26
27
/** Liftoff...*/
28
gravityview();
29