Completed
Push — develop ( ca0510...8f65a5 )
by David
05:11 queued 02:03
created

Wordlift_NewRelic_Adapter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A ignore_apdex() 0 8 3
1
<?php
2
/**
3
 * Adapters: NewRelic Adapter.
4
 *
5
 * The NewRelic Adapter tunes the Apdex index for Wordlift.
6
 *
7
 * @since   3.11.3
8
 * @package Wordlift
9
 */
10
11
/**
12
 * Define the {@link Wordlift_NewRelic_Adapter} class.
13
 *
14
 * @since   3.11.3
15
 * @package Wordlift
16
 */
17
class Wordlift_NewRelic_Adapter {
18
19
	/**
20
	 * Tell NewRelic to ignore this "transaction" for the Apdex.
21
	 *
22
	 * @see   https://github.com/insideout10/wordlift-plugin/issues/521
23
	 *
24
	 * @since 3.11.3
25
	 */
26
	static function ignore_apdex() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
27
28
		// Ensure PHP agent and the function are available.
29
		if ( extension_loaded( 'newrelic' ) && function_exists( 'newrelic_ignore_apdex' ) ) {
30
			newrelic_ignore_apdex();
31
		}
32
33
	}
34
35
}
36