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.
Passed
Push — master ( efd704...9084d4 )
by Christian
02:55
created

inc/Defaults.php (8 issues)

1
<?php
2
/**
3
 * @author    Podlove <[email protected]>
4
 * @copyright Copyright (c) 2014-2018, Podlove
5
 * @license   https://github.com/podlove/podlove-subscribe-button-wp-plugin/blob/master/LICENSE MIT
6
 * @package   Podlove\PodloveSubscribeButton
7
 */
8
9
namespace PodloveSubscribeButton;
10
11
class Defaults {
12
13
	static function button( $property ) {
14
15
		$style = array(
16
			'filled'    => __( 'Filled', 'podlove-subscribe-button' ),
17
			'outline'   => __( 'Outline', 'podlove-subscribe-button' ),
18
			'frameless' => __( 'Frameless', 'podlove-subscribe-button' ),
19
		);
20
21
		$format = array(
22
			'rectangle' => __( 'Rectangle', 'podlove-subscribe-button' ),
23
			'square'    => __( 'Square', 'podlove-subscribe-button' ),
24
			'cover'     => __( 'Cover', 'podlove-subscribe-button' ),
25
		);
26
27
		$autowidth = array(
28
			'on'  => __( 'Yes', 'podlove-subscribe-button' ),
29
			'off' => __( 'No', 'podlove-subscribe-button' ),
30
		);
31
32
		$size = array(
33
			'small'  => __( 'Small', 'podlove-subscribe-button' ),
34
			'medium' => __( 'Medium', 'podlove-subscribe-button' ),
35
			'big'    => __( 'Big', 'podlove-subscribe-button' ),
36
		);
37
38
		$language = array( 'de', 'en', 'eo', 'fi', 'fr', 'nl', 'zh', 'ja', );
39
40
		return $$property;
41
42
	}
43
44
	/**
45
	 * @return array
46
	 */
47
	public static function media_types() {
48
49
		$media_types = array(
50
			0 => array(
51
				'title'     => 'MP3 audio',
52
				'mime_type' => 'audio/mpeg',
53
				'extension' => 'mp3',
54
			),
55
			1 => array(
56
				'title'     => 'MPEG-4 AAC Audio',
57
				'mime_type' => 'audio/mp4',
58
				'extension' => 'aac',
59
			),
60
			2 => array(
61
				'title'     => 'MPEG-4 ALAC Audio',
62
				'mime_type' => 'audio/mp4',
63
				'extension' => 'aac',
64
			),
65
			3 => array(
66
				'title'     => 'Ogg Vorbis Audio',
67
				'mime_type' => 'audio/ogg',
68
				'extension' => 'ogg',
69
			),
70
			4 => array(
71
				'title'     => 'WebM Audio',
72
				'mime_type' => 'audio/webm',
73
				'extension' => 'webm',
74
			),
75
			5 => array(
76
				'title'     => 'FLAC Audio',
77
				'mime_type' => 'audio/flac',
78
				'extension' => 'flac',
79
			),
80
			6 => array(
81
				'title'     => 'Matroska Audio',
82
				'mime_type' => 'audio/x-matroska',
83
				'extension' => 'mka',
84
			),
85
			7 => array(
86
				'title'     => 'Opus Audio',
87
				'mime_type' => 'audio/opus',
88
				'extension' => 'opus',
89
			)
90
		);
91
92
		return apply_filters( 'podlove_psb_defaults_media_types', $media_types );
93
94
	}
95
96
	static function options_install() {
0 ignored issues
show
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...
Method name "Defaults::options_install" is not in camel caps format
Loading history...
Coding Style Documentation introduced by
Missing doc comment for function options_install()
Loading history...
Comprehensibility Best Practice introduced by
It is recommend to declare an explicit visibility for options_install.

Generally, we recommend to declare visibility for all methods in your source code. This has the advantage of clearly communication to other developers, and also yourself, how this method should be consumed.

If you are not sure which visibility to choose, it is a good idea to start with the most restrictive visibility, and then raise visibility as needed, i.e. start with private, and only raise it to protected if a sub-class needs to have access, or public if an external class needs access.

Loading history...
97
98
		$options = array(
99
			'size'      => 'big',
100
			'autowidth' => 'on',
101
			'color'     => '#599677',
102
			'style'     => 'filled',
103
			'format'    => 'rectangle',
104
			'language'  => \PodloveSubscribeButton\Helpers::language( get_site_option( 'WPLANG' ) ),
0 ignored issues
show
It seems like get_site_option('WPLANG') can also be of type false; however, parameter $language of PodloveSubscribeButton\Helpers::language() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

104
			'language'  => \PodloveSubscribeButton\Helpers::language( /** @scrutinizer ignore-type */ get_site_option( 'WPLANG' ) ),
Loading history...
105
		);
106
107
		return $options;
108
109
	}
110
111
	static function options() {
0 ignored issues
show
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...
Coding Style Documentation introduced by
Missing doc comment for function options()
Loading history...
Comprehensibility Best Practice introduced by
It is recommend to declare an explicit visibility for options.

Generally, we recommend to declare visibility for all methods in your source code. This has the advantage of clearly communication to other developers, and also yourself, how this method should be consumed.

If you are not sure which visibility to choose, it is a good idea to start with the most restrictive visibility, and then raise visibility as needed, i.e. start with private, and only raise it to protected if a sub-class needs to have access, or public if an external class needs access.

Loading history...
112
113
		$options = array(
114
			'size'      => 'big',
115
			'autowidth' => 'on',
116
			'color'     => '#599677',
117
			'style'     => 'filled',
118
			'format'    => 'rectangle',
119
			'language'  => \PodloveSubscribeButton\Helpers::language( '' ),
120
		);
121
122
		return apply_filters( 'podlove_psb_defaults_options', $options );
123
124
	}
125
126
} // END class
127