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.

Code Duplication    Length = 9-14 lines in 4 locations

classes/deprecated.php 1 location

@@ 78-90 (lines=13) @@
75
	 *
76
	 * @return array An array of instantiated classes
77
	 */
78
	private static function instantiate( $classname ) {
79
80
		if ( ! class_exists( $classname ) )
81
			return new \WP_Error( 'hmbkp_invalid_type_error', sprintf( __( 'Argument 1 for %s must be a valid class', 'backupwordpress' ) ), __METHOD__ );
82
83
		/**
84
		 * @var HMBKP_Service
85
		 */
86
		$class = new $classname( self::instance()->schedule );
87
88
		return $class;
89
90
	}
91
92
}
93

classes/class-services.php 3 locations

@@ 82-90 (lines=9) @@
79
	 * @param $classname
80
	 * @return bool|WP_Error
81
	 */
82
	public static function register( $filepath, $classname ) {
83
		if ( ! file_exists( $filepath ) ) {
84
			return new \WP_Error( 'hmbkp_invalid_path_error', sprintf( __( 'Argument 1 for %s must be a valid filepath', 'backupwordpress' ), __METHOD__ ) );
85
		}
86
87
		self::instance()->services[ $filepath ] = $classname;
88
89
		return true;
90
	}
91
92
	/**
93
	 * De-register an existing service
@@ 97-106 (lines=10) @@
94
	 * @param string $filepath
95
	 * @return bool|WP_Error
96
	 */
97
	public static function unregister( $filepath ) {
98
99
		if ( ! isset( self::instance()->services[ $filepath ] ) ) {
100
			return new \WP_Error( 'hmbkp_unrecognized_service_error', sprintf( __( 'Argument 1 for %s must be a registered service', 'backupwordpress' ), __METHOD__ ) );
101
		}
102
103
		unset( self::instance()->services[ $filepath ] );
104
105
		return true;
106
	}
107
108
	/**
109
	 * Instantiate the individual service classes
@@ 115-128 (lines=14) @@
112
	 *
113
	 * @return array An array of instantiated classes
114
	 */
115
	private static function instantiate( $classname ) {
116
117
		if ( ! class_exists( $classname ) ) {
118
			return new \WP_Error( 'hmbkp_invalid_type_error', sprintf( __( 'Argument 1 for %s must be a valid class', 'backupwordpress' ), __METHOD__ ) );
119
		}
120
121
		/**
122
		 * @var Service
123
		 */
124
		$class = new $classname( self::instance()->schedule );
125
126
		return $class;
127
128
	}
129
130
}
131