GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( bb6361...a2a740 )
by Brad
04:28
created

FS_Affiliate   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 72
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A is_active() 0 3 1
A is_pending() 0 3 1
A is_suspended() 0 3 1
A is_rejected() 0 3 1
A is_blocked() 0 3 1
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 13 and the first side effect is on line 10.

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
	 * @package     Freemius
4
	 * @copyright   Copyright (c) 2015, Freemius, Inc.
5
	 * @license     https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
	 * @since       1.2.3
7
	 */
8
9
	if ( ! defined( 'ABSPATH' ) ) {
10
		exit;
11
	}
12
13
	class FS_Affiliate extends FS_Scope_Entity {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
14
15
        #region Properties
16
17
        /**
18
         * @var string
19
         */
20
        public $paypal_email;
21
        /**
22
         * @var number
23
         */
24
        public $custom_affiliate_terms_id;
25
        /**
26
         * @var boolean
27
         */
28
        public $is_using_custom_terms;
29
        /**
30
         * @var string status Enum: `pending`, `rejected`, `suspended`, or `active`. Defaults to `pending`.
31
         */
32
        public $status;
33
        /**
34
         * @var string
35
         */
36
        public $domain;
37
38
        #endregion Properties
39
40
        /**
41
         * @author Leo Fajardo
42
         *
43
         * @return bool
44
         */
45
        function is_active() {
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...
46
            return ( 'active' === $this->status );
47
        }
48
49
        /**
50
         * @author Leo Fajardo
51
         *
52
         * @return bool
53
         */
54
        function is_pending() {
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...
55
            return ( 'pending' === $this->status );
56
        }
57
58
        /**
59
         * @author Leo Fajardo
60
         *
61
         * @return bool
62
         */
63
        function is_suspended() {
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...
64
            return ( 'suspended' === $this->status );
65
        }
66
67
        /**
68
         * @author Leo Fajardo
69
         *
70
         * @return bool
71
         */
72
        function is_rejected() {
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...
73
            return ( 'rejected' === $this->status );
74
        }
75
76
        /**
77
         * @author Leo Fajardo
78
         *
79
         * @return bool
80
         */
81
        function is_blocked() {
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...
82
            return ( 'blocked' === $this->status );
83
        }
84
	}