trulia-badges.php ➔ trulia_badges()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 98
Code Lines 83

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 83
nc 1
nop 0
dl 0
loc 98
rs 8.3352
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

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 20 and the first side effect is on line 12.

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
/**
3
 * Trulia Badges
4
 *
5
 * @package RE-PRO
6
 *
7
 * Returns an array of available Trulia Badges
8
 * All badges can be found at http://www.trulia.com/tools/badge/
9
 */
10
11
/* // Exit if accessed directly */
12
if ( ! defined( 'ABSPATH' ) ) { exit; }
13
14
/**
15
 * The trulia_badges function.
16
 *
17
 * @access public
18
 * @return Array of Trulia Badges
19
 */
20
function trulia_badges() {
21
22
	return array(
23
	/* Style 1 */
24
	 array(
25
		 'id' => 'truila-btn-1-green',
26
		 'name' => __( 'Trulia Button - Green (96x40)', 're-pro' ),
27
		 'alt' => __( 'Trulia', 're-pro' ),
28
		 'title' => __( 'Trulia', 're-pro' ),
29
		 'class' => 'trulia-badge',
30
		 'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v01_green.gif',
31
		 'width' => 96,
32
		 'height' => 40,
33
	 ),
34
	 array(
35
		 'id' => 'truila-btn-1-white',
36
		 'name' => __( 'Trulia Button - White (96x40)', 're-pro' ),
37
		 'alt' => __( 'Trulia', 're-pro' ),
38
		 'title' => __( 'Trulia', 're-pro' ),
39
		 'class' => 'trulia-badge',
40
		 'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v01_white.gif',
41
		 'width' => 96,
42
		 'height' => 40,
43
	 ),
44
	 array(
45
		 'id' => 'truila-btn-1-white-green',
46
		 'name' => __( 'Trulia Button - White/Green (96x40)', 're-pro' ),
47
		 'alt' => __( 'Trulia', 're-pro' ),
48
		 'title' => __( 'Trulia', 're-pro' ),
49
		 'class' => 'trulia-badge',
50
		 'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v01_white_green.gif',
51
		 'width' => 96,
52
		 'height' => 40,
53
	 ),
54
		/* Style 2 */
55
		array(
56
			'id' => 'truila-btn-2-green',
57
			'name' => __( 'Trulia Button 2 - Green (87x33)', 're-pro' ),
58
			'alt' => __( 'Trulia', 're-pro' ),
59
			'title' => __( 'Trulia', 're-pro' ),
60
			'class' => 'trulia-badge',
61
			'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v02_green.gif',
62
			'width' => 87,
63
			'height' => 33,
64
		),
65
		array(
66
			'id' => 'truila-btn-2-white',
67
			'name' => __( 'Trulia Button 2 - White (87x33)', 're-pro' ),
68
			'alt' => __( 'Trulia', 're-pro' ),
69
			'title' => __( 'Trulia', 're-pro' ),
70
			'class' => 'trulia-badge',
71
			'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v02_white.gif',
72
			'width' => 87,
73
			'height' => 33,
74
		),
75
		array(
76
			'id' => 'truila-btn-2-white-green',
77
			'name' => __( 'Trulia Button 2 - White/Green (87x33)', 're-pro' ),
78
			'alt' => __( 'Trulia', 're-pro' ),
79
			'title' => __( 'Trulia', 're-pro' ),
80
			'class' => 'trulia-badge',
81
			'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v02_white_green.gif',
82
			'width' => 87,
83
			'height' => 33,
84
		),
85
		/* Style 3 */
86
		array(
87
			'id' => 'truila-btn-3-green',
88
			'name' => __( 'Trulia Button 3 - Green (120x54)', 're-pro' ),
89
			'alt' => __( 'Trulia', 're-pro' ),
90
			'title' => __( 'Trulia', 're-pro' ),
91
			'class' => 'trulia-badge',
92
			'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v03_green.gif',
93
			'width' => 120,
94
			'height' => 54,
95
		),
96
		array(
97
			'id' => 'truila-btn-3-white',
98
			'name' => __( 'Trulia Button 3 - White (120x54)', 're-pro' ),
99
			'alt' => __( 'Trulia', 're-pro' ),
100
			'title' => __( 'Trulia', 're-pro' ),
101
			'class' => 'trulia-badge',
102
			'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v03_white.gif',
103
			'width' => 120,
104
			'height' => 54,
105
		),
106
		array(
107
			'id' => 'truila-btn-3-white-green',
108
			'name' => __( 'Trulia Button 3 - White/Green (120x54)', 're-pro' ),
109
			'alt' => __( 'Trulia', 're-pro' ),
110
			'title' => __( 'Trulia', 're-pro' ),
111
			'class' => 'trulia-badge',
112
			'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v03_white_green.gif',
113
			'width' => 120,
114
			'height' => 54,
115
		),
116
	);
117
}
118