@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | class Quiet_Skin extends \WP_Upgrader_Skin { |
6 | 6 | |
7 | - public function feedback( $feedback, ...$args ) { |
|
7 | + public function feedback($feedback, ...$args) { |
|
8 | 8 | // Dont print result. |
9 | 9 | } |
10 | 10 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | private $url; |
10 | 10 | |
11 | - public function __construct( $slug, $url ) { |
|
11 | + public function __construct($slug, $url) { |
|
12 | 12 | $this->slug = $slug; |
13 | 13 | $this->url = $url; |
14 | 14 | } |
@@ -22,15 +22,15 @@ discard block |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | function is_plugin_installed() { |
25 | - if ( ! function_exists( 'get_plugins' ) ) { |
|
26 | - require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
25 | + if ( ! function_exists('get_plugins')) { |
|
26 | + require_once ABSPATH.'wp-admin/includes/plugin.php'; |
|
27 | 27 | } |
28 | 28 | $all_plugins = get_plugins(); |
29 | 29 | |
30 | - return array_key_exists( $this->slug, $all_plugins ); |
|
30 | + return array_key_exists($this->slug, $all_plugins); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | function is_plugin_activated() { |
34 | - return is_plugin_active( $this->slug ); |
|
34 | + return is_plugin_active($this->slug); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | \ No newline at end of file |
@@ -9,12 +9,12 @@ discard block |
||
9 | 9 | */ |
10 | 10 | private $installer; |
11 | 11 | |
12 | - public function __construct( Installer $installer ) { |
|
12 | + public function __construct(Installer $installer) { |
|
13 | 13 | $this->installer = $installer; |
14 | 14 | } |
15 | 15 | |
16 | - public function install_and_activate( $new_value, $old_value ) { |
|
17 | - if ( ! $new_value ) { |
|
16 | + public function install_and_activate($new_value, $old_value) { |
|
17 | + if ( ! $new_value) { |
|
18 | 18 | return; |
19 | 19 | } |
20 | 20 | $this->installer->install(); |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | |
25 | 25 | |
26 | 26 | public function register_hooks() { |
27 | - add_action( "wl_feature__change__entity-types-professional", array( $this, 'install_and_activate' ), 10, 2 ); |
|
28 | - add_action( "wl_feature__change__entity-types-business", array( $this, 'install_and_activate' ), 10, 2 ); |
|
27 | + add_action("wl_feature__change__entity-types-professional", array($this, 'install_and_activate'), 10, 2); |
|
28 | + add_action("wl_feature__change__entity-types-business", array($this, 'install_and_activate'), 10, 2); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | } |
32 | 32 | \ No newline at end of file |
@@ -18,29 +18,29 @@ |
||
18 | 18 | * @param $plugin Plugin |
19 | 19 | * @param $upgrader \Plugin_Upgrader |
20 | 20 | */ |
21 | - function __construct( \Plugin_Upgrader $upgrader, Plugin $plugin ) { |
|
21 | + function __construct(\Plugin_Upgrader $upgrader, Plugin $plugin) { |
|
22 | 22 | $this->upgrader = $upgrader; |
23 | 23 | $this->plugin = $plugin; |
24 | 24 | } |
25 | 25 | |
26 | 26 | function install() { |
27 | 27 | |
28 | - if ( $this->plugin->is_plugin_installed() ) { |
|
28 | + if ($this->plugin->is_plugin_installed()) { |
|
29 | 29 | return; |
30 | 30 | } |
31 | 31 | |
32 | 32 | try { |
33 | - $this->upgrader->install( $this->plugin->get_zip_url() ); |
|
34 | - } catch ( \Exception $e ) { |
|
35 | - error_log( "Error caught when installing plugin " . $this->plugin->get_slug() . " error: " . $e->getMessage() ); |
|
33 | + $this->upgrader->install($this->plugin->get_zip_url()); |
|
34 | + } catch (\Exception $e) { |
|
35 | + error_log("Error caught when installing plugin ".$this->plugin->get_slug()." error: ".$e->getMessage()); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
39 | 39 | function activate() { |
40 | - if ( $this->plugin->is_plugin_activated() ) { |
|
40 | + if ($this->plugin->is_plugin_activated()) { |
|
41 | 41 | return; |
42 | 42 | } |
43 | - activate_plugin( $this->plugin->get_slug() ); |
|
43 | + activate_plugin($this->plugin->get_slug()); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 |
@@ -14,206 +14,206 @@ |
||
14 | 14 | |
15 | 15 | use Google\Web_Stories_Dependencies\Symfony\Polyfill\Mbstring as Google_Web_Stories_Mbstring; |
16 | 16 | |
17 | -if ( ! function_exists( 'mb_convert_encoding' ) ) { |
|
18 | - function mb_convert_encoding( $s, $to, $from = null ) { |
|
19 | - return Google_Web_Stories_Mbstring\Mbstring::mb_convert_encoding( $s, $to, $from ); |
|
17 | +if ( ! function_exists('mb_convert_encoding')) { |
|
18 | + function mb_convert_encoding($s, $to, $from = null) { |
|
19 | + return Google_Web_Stories_Mbstring\Mbstring::mb_convert_encoding($s, $to, $from); |
|
20 | 20 | } |
21 | 21 | } |
22 | -if ( ! function_exists( 'mb_decode_mimeheader' ) ) { |
|
23 | - function mb_decode_mimeheader( $s ) { |
|
24 | - return Google_Web_Stories_Mbstring\Mbstring::mb_decode_mimeheader( $s ); |
|
22 | +if ( ! function_exists('mb_decode_mimeheader')) { |
|
23 | + function mb_decode_mimeheader($s) { |
|
24 | + return Google_Web_Stories_Mbstring\Mbstring::mb_decode_mimeheader($s); |
|
25 | 25 | } |
26 | 26 | } |
27 | -if ( ! function_exists( 'mb_encode_mimeheader' ) ) { |
|
28 | - function mb_encode_mimeheader( $s, $charset = null, $transferEnc = null, $lf = null, $indent = null ) { |
|
29 | - return Google_Web_Stories_Mbstring\Mbstring::mb_encode_mimeheader( $s, $charset, $transferEnc, $lf, $indent ); |
|
27 | +if ( ! function_exists('mb_encode_mimeheader')) { |
|
28 | + function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { |
|
29 | + return Google_Web_Stories_Mbstring\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); |
|
30 | 30 | } |
31 | 31 | } |
32 | -if ( ! function_exists( 'mb_decode_numericentity' ) ) { |
|
33 | - function mb_decode_numericentity( $s, $convmap, $enc = null ) { |
|
34 | - return Google_Web_Stories_Mbstring\Mbstring::mb_decode_numericentity( $s, $convmap, $enc ); |
|
32 | +if ( ! function_exists('mb_decode_numericentity')) { |
|
33 | + function mb_decode_numericentity($s, $convmap, $enc = null) { |
|
34 | + return Google_Web_Stories_Mbstring\Mbstring::mb_decode_numericentity($s, $convmap, $enc); |
|
35 | 35 | } |
36 | 36 | } |
37 | -if ( ! function_exists( 'mb_encode_numericentity' ) ) { |
|
38 | - function mb_encode_numericentity( $s, $convmap, $enc = null, $is_hex = false ) { |
|
39 | - return Google_Web_Stories_Mbstring\Mbstring::mb_encode_numericentity( $s, $convmap, $enc, $is_hex ); |
|
37 | +if ( ! function_exists('mb_encode_numericentity')) { |
|
38 | + function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) { |
|
39 | + return Google_Web_Stories_Mbstring\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); |
|
40 | 40 | } |
41 | 41 | } |
42 | -if ( ! function_exists( 'mb_convert_case' ) ) { |
|
43 | - function mb_convert_case( $s, $mode, $enc = null ) { |
|
44 | - return Google_Web_Stories_Mbstring\Mbstring::mb_convert_case( $s, $mode, $enc ); |
|
42 | +if ( ! function_exists('mb_convert_case')) { |
|
43 | + function mb_convert_case($s, $mode, $enc = null) { |
|
44 | + return Google_Web_Stories_Mbstring\Mbstring::mb_convert_case($s, $mode, $enc); |
|
45 | 45 | } |
46 | 46 | } |
47 | -if ( ! function_exists( 'mb_internal_encoding' ) ) { |
|
48 | - function mb_internal_encoding( $enc = null ) { |
|
49 | - return Google_Web_Stories_Mbstring\Mbstring::mb_internal_encoding( $enc ); |
|
47 | +if ( ! function_exists('mb_internal_encoding')) { |
|
48 | + function mb_internal_encoding($enc = null) { |
|
49 | + return Google_Web_Stories_Mbstring\Mbstring::mb_internal_encoding($enc); |
|
50 | 50 | } |
51 | 51 | } |
52 | -if ( ! function_exists( 'mb_language' ) ) { |
|
53 | - function mb_language( $lang = null ) { |
|
54 | - return Google_Web_Stories_Mbstring\Mbstring::mb_language( $lang ); |
|
52 | +if ( ! function_exists('mb_language')) { |
|
53 | + function mb_language($lang = null) { |
|
54 | + return Google_Web_Stories_Mbstring\Mbstring::mb_language($lang); |
|
55 | 55 | } |
56 | 56 | } |
57 | -if ( ! function_exists( 'mb_list_encodings' ) ) { |
|
57 | +if ( ! function_exists('mb_list_encodings')) { |
|
58 | 58 | function mb_list_encodings() { |
59 | 59 | return Google_Web_Stories_Mbstring\Mbstring::mb_list_encodings(); |
60 | 60 | } |
61 | 61 | } |
62 | -if ( ! function_exists( 'mb_encoding_aliases' ) ) { |
|
63 | - function mb_encoding_aliases( $encoding ) { |
|
64 | - return Google_Web_Stories_Mbstring\Mbstring::mb_encoding_aliases( $encoding ); |
|
62 | +if ( ! function_exists('mb_encoding_aliases')) { |
|
63 | + function mb_encoding_aliases($encoding) { |
|
64 | + return Google_Web_Stories_Mbstring\Mbstring::mb_encoding_aliases($encoding); |
|
65 | 65 | } |
66 | 66 | } |
67 | -if ( ! function_exists( 'mb_check_encoding' ) ) { |
|
68 | - function mb_check_encoding( $var = null, $encoding = null ) { |
|
69 | - return Google_Web_Stories_Mbstring\Mbstring::mb_check_encoding( $var, $encoding ); |
|
67 | +if ( ! function_exists('mb_check_encoding')) { |
|
68 | + function mb_check_encoding($var = null, $encoding = null) { |
|
69 | + return Google_Web_Stories_Mbstring\Mbstring::mb_check_encoding($var, $encoding); |
|
70 | 70 | } |
71 | 71 | } |
72 | -if ( ! function_exists( 'mb_detect_encoding' ) ) { |
|
73 | - function mb_detect_encoding( $str, $encodingList = null, $strict = false ) { |
|
74 | - return Google_Web_Stories_Mbstring\Mbstring::mb_detect_encoding( $str, $encodingList, $strict ); |
|
72 | +if ( ! function_exists('mb_detect_encoding')) { |
|
73 | + function mb_detect_encoding($str, $encodingList = null, $strict = false) { |
|
74 | + return Google_Web_Stories_Mbstring\Mbstring::mb_detect_encoding($str, $encodingList, $strict); |
|
75 | 75 | } |
76 | 76 | } |
77 | -if ( ! function_exists( 'mb_detect_order' ) ) { |
|
78 | - function mb_detect_order( $encodingList = null ) { |
|
79 | - return Google_Web_Stories_Mbstring\Mbstring::mb_detect_order( $encodingList ); |
|
77 | +if ( ! function_exists('mb_detect_order')) { |
|
78 | + function mb_detect_order($encodingList = null) { |
|
79 | + return Google_Web_Stories_Mbstring\Mbstring::mb_detect_order($encodingList); |
|
80 | 80 | } |
81 | 81 | } |
82 | -if ( ! function_exists( 'mb_parse_str' ) ) { |
|
83 | - function mb_parse_str( $s, &$result = [] ) { |
|
84 | - parse_str( $s, $result ); |
|
82 | +if ( ! function_exists('mb_parse_str')) { |
|
83 | + function mb_parse_str($s, &$result = []) { |
|
84 | + parse_str($s, $result); |
|
85 | 85 | } |
86 | 86 | } |
87 | -if ( ! function_exists( 'mb_strlen' ) ) { |
|
88 | - function mb_strlen( $s, $enc = null ) { |
|
89 | - return Google_Web_Stories_Mbstring\Mbstring::mb_strlen( $s, $enc ); |
|
87 | +if ( ! function_exists('mb_strlen')) { |
|
88 | + function mb_strlen($s, $enc = null) { |
|
89 | + return Google_Web_Stories_Mbstring\Mbstring::mb_strlen($s, $enc); |
|
90 | 90 | } |
91 | 91 | } |
92 | -if ( ! function_exists( 'mb_strpos' ) ) { |
|
93 | - function mb_strpos( $s, $needle, $offset = 0, $enc = null ) { |
|
94 | - return Google_Web_Stories_Mbstring\Mbstring::mb_strpos( $s, $needle, $offset, $enc ); |
|
92 | +if ( ! function_exists('mb_strpos')) { |
|
93 | + function mb_strpos($s, $needle, $offset = 0, $enc = null) { |
|
94 | + return Google_Web_Stories_Mbstring\Mbstring::mb_strpos($s, $needle, $offset, $enc); |
|
95 | 95 | } |
96 | 96 | } |
97 | -if ( ! function_exists( 'mb_strtolower' ) ) { |
|
98 | - function mb_strtolower( $s, $enc = null ) { |
|
99 | - return Google_Web_Stories_Mbstring\Mbstring::mb_strtolower( $s, $enc ); |
|
97 | +if ( ! function_exists('mb_strtolower')) { |
|
98 | + function mb_strtolower($s, $enc = null) { |
|
99 | + return Google_Web_Stories_Mbstring\Mbstring::mb_strtolower($s, $enc); |
|
100 | 100 | } |
101 | 101 | } |
102 | -if ( ! function_exists( 'mb_strtoupper' ) ) { |
|
103 | - function mb_strtoupper( $s, $enc = null ) { |
|
104 | - return Google_Web_Stories_Mbstring\Mbstring::mb_strtoupper( $s, $enc ); |
|
102 | +if ( ! function_exists('mb_strtoupper')) { |
|
103 | + function mb_strtoupper($s, $enc = null) { |
|
104 | + return Google_Web_Stories_Mbstring\Mbstring::mb_strtoupper($s, $enc); |
|
105 | 105 | } |
106 | 106 | } |
107 | -if ( ! function_exists( 'mb_substitute_character' ) ) { |
|
108 | - function mb_substitute_character( $char = null ) { |
|
109 | - return Google_Web_Stories_Mbstring\Mbstring::mb_substitute_character( $char ); |
|
107 | +if ( ! function_exists('mb_substitute_character')) { |
|
108 | + function mb_substitute_character($char = null) { |
|
109 | + return Google_Web_Stories_Mbstring\Mbstring::mb_substitute_character($char); |
|
110 | 110 | } |
111 | 111 | } |
112 | -if ( ! function_exists( 'mb_substr' ) ) { |
|
113 | - function mb_substr( $s, $start, $length = 2147483647, $enc = null ) { |
|
114 | - return Google_Web_Stories_Mbstring\Mbstring::mb_substr( $s, $start, $length, $enc ); |
|
112 | +if ( ! function_exists('mb_substr')) { |
|
113 | + function mb_substr($s, $start, $length = 2147483647, $enc = null) { |
|
114 | + return Google_Web_Stories_Mbstring\Mbstring::mb_substr($s, $start, $length, $enc); |
|
115 | 115 | } |
116 | 116 | } |
117 | -if ( ! function_exists( 'mb_stripos' ) ) { |
|
118 | - function mb_stripos( $s, $needle, $offset = 0, $enc = null ) { |
|
119 | - return Google_Web_Stories_Mbstring\Mbstring::mb_stripos( $s, $needle, $offset, $enc ); |
|
117 | +if ( ! function_exists('mb_stripos')) { |
|
118 | + function mb_stripos($s, $needle, $offset = 0, $enc = null) { |
|
119 | + return Google_Web_Stories_Mbstring\Mbstring::mb_stripos($s, $needle, $offset, $enc); |
|
120 | 120 | } |
121 | 121 | } |
122 | -if ( ! function_exists( 'mb_stristr' ) ) { |
|
123 | - function mb_stristr( $s, $needle, $part = false, $enc = null ) { |
|
124 | - return Google_Web_Stories_Mbstring\Mbstring::mb_stristr( $s, $needle, $part, $enc ); |
|
122 | +if ( ! function_exists('mb_stristr')) { |
|
123 | + function mb_stristr($s, $needle, $part = false, $enc = null) { |
|
124 | + return Google_Web_Stories_Mbstring\Mbstring::mb_stristr($s, $needle, $part, $enc); |
|
125 | 125 | } |
126 | 126 | } |
127 | -if ( ! function_exists( 'mb_strrchr' ) ) { |
|
128 | - function mb_strrchr( $s, $needle, $part = false, $enc = null ) { |
|
129 | - return Google_Web_Stories_Mbstring\Mbstring::mb_strrchr( $s, $needle, $part, $enc ); |
|
127 | +if ( ! function_exists('mb_strrchr')) { |
|
128 | + function mb_strrchr($s, $needle, $part = false, $enc = null) { |
|
129 | + return Google_Web_Stories_Mbstring\Mbstring::mb_strrchr($s, $needle, $part, $enc); |
|
130 | 130 | } |
131 | 131 | } |
132 | -if ( ! function_exists( 'mb_strrichr' ) ) { |
|
133 | - function mb_strrichr( $s, $needle, $part = false, $enc = null ) { |
|
134 | - return Google_Web_Stories_Mbstring\Mbstring::mb_strrichr( $s, $needle, $part, $enc ); |
|
132 | +if ( ! function_exists('mb_strrichr')) { |
|
133 | + function mb_strrichr($s, $needle, $part = false, $enc = null) { |
|
134 | + return Google_Web_Stories_Mbstring\Mbstring::mb_strrichr($s, $needle, $part, $enc); |
|
135 | 135 | } |
136 | 136 | } |
137 | -if ( ! function_exists( 'mb_strripos' ) ) { |
|
138 | - function mb_strripos( $s, $needle, $offset = 0, $enc = null ) { |
|
139 | - return Google_Web_Stories_Mbstring\Mbstring::mb_strripos( $s, $needle, $offset, $enc ); |
|
137 | +if ( ! function_exists('mb_strripos')) { |
|
138 | + function mb_strripos($s, $needle, $offset = 0, $enc = null) { |
|
139 | + return Google_Web_Stories_Mbstring\Mbstring::mb_strripos($s, $needle, $offset, $enc); |
|
140 | 140 | } |
141 | 141 | } |
142 | -if ( ! function_exists( 'mb_strrpos' ) ) { |
|
143 | - function mb_strrpos( $s, $needle, $offset = 0, $enc = null ) { |
|
144 | - return Google_Web_Stories_Mbstring\Mbstring::mb_strrpos( $s, $needle, $offset, $enc ); |
|
142 | +if ( ! function_exists('mb_strrpos')) { |
|
143 | + function mb_strrpos($s, $needle, $offset = 0, $enc = null) { |
|
144 | + return Google_Web_Stories_Mbstring\Mbstring::mb_strrpos($s, $needle, $offset, $enc); |
|
145 | 145 | } |
146 | 146 | } |
147 | -if ( ! function_exists( 'mb_strstr' ) ) { |
|
148 | - function mb_strstr( $s, $needle, $part = false, $enc = null ) { |
|
149 | - return Google_Web_Stories_Mbstring\Mbstring::mb_strstr( $s, $needle, $part, $enc ); |
|
147 | +if ( ! function_exists('mb_strstr')) { |
|
148 | + function mb_strstr($s, $needle, $part = false, $enc = null) { |
|
149 | + return Google_Web_Stories_Mbstring\Mbstring::mb_strstr($s, $needle, $part, $enc); |
|
150 | 150 | } |
151 | 151 | } |
152 | -if ( ! function_exists( 'mb_get_info' ) ) { |
|
153 | - function mb_get_info( $type = 'all' ) { |
|
154 | - return Google_Web_Stories_Mbstring\Mbstring::mb_get_info( $type ); |
|
152 | +if ( ! function_exists('mb_get_info')) { |
|
153 | + function mb_get_info($type = 'all') { |
|
154 | + return Google_Web_Stories_Mbstring\Mbstring::mb_get_info($type); |
|
155 | 155 | } |
156 | 156 | } |
157 | -if ( ! function_exists( 'mb_http_output' ) ) { |
|
158 | - function mb_http_output( $enc = null ) { |
|
159 | - return Google_Web_Stories_Mbstring\Mbstring::mb_http_output( $enc ); |
|
157 | +if ( ! function_exists('mb_http_output')) { |
|
158 | + function mb_http_output($enc = null) { |
|
159 | + return Google_Web_Stories_Mbstring\Mbstring::mb_http_output($enc); |
|
160 | 160 | } |
161 | 161 | } |
162 | -if ( ! function_exists( 'mb_strwidth' ) ) { |
|
163 | - function mb_strwidth( $s, $enc = null ) { |
|
164 | - return Google_Web_Stories_Mbstring\Mbstring::mb_strwidth( $s, $enc ); |
|
162 | +if ( ! function_exists('mb_strwidth')) { |
|
163 | + function mb_strwidth($s, $enc = null) { |
|
164 | + return Google_Web_Stories_Mbstring\Mbstring::mb_strwidth($s, $enc); |
|
165 | 165 | } |
166 | 166 | } |
167 | -if ( ! function_exists( 'mb_substr_count' ) ) { |
|
168 | - function mb_substr_count( $haystack, $needle, $enc = null ) { |
|
169 | - return Google_Web_Stories_Mbstring\Mbstring::mb_substr_count( $haystack, $needle, $enc ); |
|
167 | +if ( ! function_exists('mb_substr_count')) { |
|
168 | + function mb_substr_count($haystack, $needle, $enc = null) { |
|
169 | + return Google_Web_Stories_Mbstring\Mbstring::mb_substr_count($haystack, $needle, $enc); |
|
170 | 170 | } |
171 | 171 | } |
172 | -if ( ! function_exists( 'mb_output_handler' ) ) { |
|
173 | - function mb_output_handler( $contents, $status ) { |
|
174 | - return Google_Web_Stories_Mbstring\Mbstring::mb_output_handler( $contents, $status ); |
|
172 | +if ( ! function_exists('mb_output_handler')) { |
|
173 | + function mb_output_handler($contents, $status) { |
|
174 | + return Google_Web_Stories_Mbstring\Mbstring::mb_output_handler($contents, $status); |
|
175 | 175 | } |
176 | 176 | } |
177 | -if ( ! function_exists( 'mb_http_input' ) ) { |
|
178 | - function mb_http_input( $type = '' ) { |
|
179 | - return Google_Web_Stories_Mbstring\Mbstring::mb_http_input( $type ); |
|
177 | +if ( ! function_exists('mb_http_input')) { |
|
178 | + function mb_http_input($type = '') { |
|
179 | + return Google_Web_Stories_Mbstring\Mbstring::mb_http_input($type); |
|
180 | 180 | } |
181 | 181 | } |
182 | -if ( ! function_exists( 'mb_convert_variables' ) ) { |
|
183 | - function mb_convert_variables( $toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null ) { |
|
184 | - return Google_Web_Stories_Mbstring\Mbstring::mb_convert_variables( $toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f ); |
|
182 | +if ( ! function_exists('mb_convert_variables')) { |
|
183 | + function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { |
|
184 | + return Google_Web_Stories_Mbstring\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); |
|
185 | 185 | } |
186 | 186 | } |
187 | -if ( ! function_exists( 'mb_ord' ) ) { |
|
188 | - function mb_ord( $s, $enc = null ) { |
|
189 | - return Google_Web_Stories_Mbstring\Mbstring::mb_ord( $s, $enc ); |
|
187 | +if ( ! function_exists('mb_ord')) { |
|
188 | + function mb_ord($s, $enc = null) { |
|
189 | + return Google_Web_Stories_Mbstring\Mbstring::mb_ord($s, $enc); |
|
190 | 190 | } |
191 | 191 | } |
192 | -if ( ! function_exists( 'mb_chr' ) ) { |
|
193 | - function mb_chr( $code, $enc = null ) { |
|
194 | - return Google_Web_Stories_Mbstring\Mbstring::mb_chr( $code, $enc ); |
|
192 | +if ( ! function_exists('mb_chr')) { |
|
193 | + function mb_chr($code, $enc = null) { |
|
194 | + return Google_Web_Stories_Mbstring\Mbstring::mb_chr($code, $enc); |
|
195 | 195 | } |
196 | 196 | } |
197 | -if ( ! function_exists( 'mb_scrub' ) ) { |
|
198 | - function mb_scrub( $s, $enc = null ) { |
|
197 | +if ( ! function_exists('mb_scrub')) { |
|
198 | + function mb_scrub($s, $enc = null) { |
|
199 | 199 | $enc = $enc ?? mb_internal_encoding(); |
200 | - return mb_convert_encoding( $s, $enc, $enc ); |
|
200 | + return mb_convert_encoding($s, $enc, $enc); |
|
201 | 201 | } |
202 | 202 | } |
203 | -if ( ! function_exists( 'mb_str_split' ) ) { |
|
204 | - function mb_str_split( $string, $split_length = 1, $encoding = null ) { |
|
205 | - return Google_Web_Stories_Mbstring\Mbstring::mb_str_split( $string, $split_length, $encoding ); |
|
203 | +if ( ! function_exists('mb_str_split')) { |
|
204 | + function mb_str_split($string, $split_length = 1, $encoding = null) { |
|
205 | + return Google_Web_Stories_Mbstring\Mbstring::mb_str_split($string, $split_length, $encoding); |
|
206 | 206 | } |
207 | 207 | } |
208 | -if ( extension_loaded( 'mbstring' ) ) { |
|
208 | +if (extension_loaded('mbstring')) { |
|
209 | 209 | return; |
210 | 210 | } |
211 | -if ( ! defined( 'MB_CASE_UPPER' ) ) { |
|
212 | - define( 'MB_CASE_UPPER', 0 ); |
|
211 | +if ( ! defined('MB_CASE_UPPER')) { |
|
212 | + define('MB_CASE_UPPER', 0); |
|
213 | 213 | } |
214 | -if ( ! defined( 'MB_CASE_LOWER' ) ) { |
|
215 | - define( 'MB_CASE_LOWER', 1 ); |
|
214 | +if ( ! defined('MB_CASE_LOWER')) { |
|
215 | + define('MB_CASE_LOWER', 1); |
|
216 | 216 | } |
217 | -if ( ! defined( 'MB_CASE_TITLE' ) ) { |
|
218 | - define( 'MB_CASE_TITLE', 2 ); |
|
217 | +if ( ! defined('MB_CASE_TITLE')) { |
|
218 | + define('MB_CASE_TITLE', 2); |
|
219 | 219 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function checkPatches(Event $event) |
88 | 88 | { |
89 | - if (!$this->isPatchingEnabled()) { |
|
89 | + if ( ! $this->isPatchingEnabled()) { |
|
90 | 90 | return; |
91 | 91 | } |
92 | 92 | try { |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | // Remove packages for which the patch set has changed. |
120 | 120 | $promises = array(); |
121 | 121 | foreach ($packages as $package) { |
122 | - if (!$package instanceof AliasPackage) { |
|
122 | + if ( ! $package instanceof AliasPackage) { |
|
123 | 123 | $package_name = $package->getName(); |
124 | 124 | $extra = $package->getExtra(); |
125 | 125 | $has_patches = isset($tmp_patches[$package_name]); |
126 | 126 | $has_applied_patches = isset($extra['patches_applied']) && \count($extra['patches_applied']) > 0; |
127 | - if ($has_patches && !$has_applied_patches || !$has_patches && $has_applied_patches || $has_patches && $has_applied_patches && $tmp_patches[$package_name] !== $extra['patches_applied']) { |
|
127 | + if ($has_patches && ! $has_applied_patches || ! $has_patches && $has_applied_patches || $has_patches && $has_applied_patches && $tmp_patches[$package_name] !== $extra['patches_applied']) { |
|
128 | 128 | $uninstallOperation = new UninstallOperation($package, 'Removing package so it can be re-installed and re-patched.'); |
129 | - $this->io->write('<info>Removing package ' . $package_name . ' so that it can be re-installed and re-patched.</info>'); |
|
129 | + $this->io->write('<info>Removing package '.$package_name.' so that it can be re-installed and re-patched.</info>'); |
|
130 | 130 | $promises[] = $installationManager->uninstall($localRepository, $uninstallOperation); |
131 | 131 | } |
132 | 132 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | if (isset($this->patches['_patchesGathered'])) { |
151 | 151 | $this->io->write('<info>Patches already gathered. Skipping</info>', \TRUE, IOInterface::VERBOSE); |
152 | 152 | return; |
153 | - } elseif (!$this->isPatchingEnabled()) { |
|
153 | + } elseif ( ! $this->isPatchingEnabled()) { |
|
154 | 154 | $this->io->write('<info>Patching is disabled. Skipping.</info>', \TRUE, IOInterface::VERBOSE); |
155 | 155 | return; |
156 | 156 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | if ($this->io->isVerbose()) { |
192 | 192 | foreach ($this->patches as $package => $patches) { |
193 | 193 | $number = \count($patches); |
194 | - $this->io->write('<info>Found ' . $number . ' patches for ' . $package . '.</info>'); |
|
194 | + $this->io->write('<info>Found '.$number.' patches for '.$package.'.</info>'); |
|
195 | 195 | } |
196 | 196 | } |
197 | 197 | // Make sure we don't gather patches again. Extra keys in $this->patches |
@@ -237,12 +237,12 @@ discard block |
||
237 | 237 | $msg = ' - Unknown error'; |
238 | 238 | break; |
239 | 239 | } |
240 | - throw new \Exception('There was an error in the supplied patches file:' . $msg); |
|
240 | + throw new \Exception('There was an error in the supplied patches file:'.$msg); |
|
241 | 241 | } |
242 | 242 | if (isset($patches['patches'])) { |
243 | 243 | $patches = $patches['patches']; |
244 | 244 | return $patches; |
245 | - } elseif (!$patches) { |
|
245 | + } elseif ( ! $patches) { |
|
246 | 246 | throw new \Exception('There was an error in the supplied patch file'); |
247 | 247 | } |
248 | 248 | } else { |
@@ -257,20 +257,20 @@ discard block |
||
257 | 257 | { |
258 | 258 | // Check if we should exit in failure. |
259 | 259 | $extra = $this->composer->getPackage()->getExtra(); |
260 | - $exitOnFailure = \getenv('COMPOSER_EXIT_ON_PATCH_FAILURE') || !empty($extra['composer-exit-on-patch-failure']); |
|
261 | - $skipReporting = \getenv('COMPOSER_PATCHES_SKIP_REPORTING') || !empty($extra['composer-patches-skip-reporting']); |
|
260 | + $exitOnFailure = \getenv('COMPOSER_EXIT_ON_PATCH_FAILURE') || ! empty($extra['composer-exit-on-patch-failure']); |
|
261 | + $skipReporting = \getenv('COMPOSER_PATCHES_SKIP_REPORTING') || ! empty($extra['composer-patches-skip-reporting']); |
|
262 | 262 | // Get the package object for the current operation. |
263 | 263 | $operation = $event->getOperation(); |
264 | 264 | /** @var PackageInterface $package */ |
265 | 265 | $package = $this->getPackageFromOperation($operation); |
266 | 266 | $package_name = $package->getName(); |
267 | - if (!isset($this->patches[$package_name])) { |
|
267 | + if ( ! isset($this->patches[$package_name])) { |
|
268 | 268 | if ($this->io->isVerbose()) { |
269 | - $this->io->write('<info>No patches found for ' . $package_name . '.</info>'); |
|
269 | + $this->io->write('<info>No patches found for '.$package_name.'.</info>'); |
|
270 | 270 | } |
271 | 271 | return; |
272 | 272 | } |
273 | - $this->io->write(' - Applying patches for <info>' . $package_name . '</info>'); |
|
273 | + $this->io->write(' - Applying patches for <info>'.$package_name.'</info>'); |
|
274 | 274 | // Get the install path from the package object. |
275 | 275 | $manager = $event->getComposer()->getInstallationManager(); |
276 | 276 | $install_path = $manager->getInstaller($package->getType())->getInstallPath($package); |
@@ -282,14 +282,14 @@ discard block |
||
282 | 282 | $extra = $localPackage->getExtra(); |
283 | 283 | $extra['patches_applied'] = array(); |
284 | 284 | foreach ($this->patches[$package_name] as $description => $url) { |
285 | - $this->io->write(' <info>' . $url . '</info> (<comment>' . $description . '</comment>)'); |
|
285 | + $this->io->write(' <info>'.$url.'</info> (<comment>'.$description.'</comment>)'); |
|
286 | 286 | try { |
287 | 287 | $this->eventDispatcher->dispatch(NULL, new PatchEvent(PatchEvents::PRE_PATCH_APPLY, $package, $url, $description)); |
288 | 288 | $this->getAndApplyPatch($downloader, $install_path, $url, $package); |
289 | 289 | $this->eventDispatcher->dispatch(NULL, new PatchEvent(PatchEvents::POST_PATCH_APPLY, $package, $url, $description)); |
290 | 290 | $extra['patches_applied'][$description] = $url; |
291 | 291 | } catch (\Exception $e) { |
292 | - $this->io->write(' <error>Could not apply patch! Skipping. The error was: ' . $e->getMessage() . '</error>'); |
|
292 | + $this->io->write(' <error>Could not apply patch! Skipping. The error was: '.$e->getMessage().'</error>'); |
|
293 | 293 | if ($exitOnFailure) { |
294 | 294 | throw new \Exception("Cannot apply patch {$description} ({$url})!"); |
295 | 295 | } |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | } elseif ($operation instanceof UpdateOperation) { |
316 | 316 | $package = $operation->getTargetPackage(); |
317 | 317 | } else { |
318 | - throw new \Exception('Unknown operation: ' . \get_class($operation)); |
|
318 | + throw new \Exception('Unknown operation: '.\get_class($operation)); |
|
319 | 319 | } |
320 | 320 | return $package; |
321 | 321 | } |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $filename = \realpath($patch_url); |
336 | 336 | } else { |
337 | 337 | // Generate random (but not cryptographically so) filename. |
338 | - $filename = \uniqid(\sys_get_temp_dir() . '/') . ".patch"; |
|
338 | + $filename = \uniqid(\sys_get_temp_dir().'/').".patch"; |
|
339 | 339 | // Download file from remote filesystem to this location. |
340 | 340 | $hostname = \parse_url($patch_url, \PHP_URL_HOST); |
341 | 341 | try { |
@@ -352,14 +352,14 @@ discard block |
||
352 | 352 | $patch_levels = array('-p1', '-p0', '-p2', '-p4'); |
353 | 353 | // Check for specified patch level for this package. |
354 | 354 | $extra = $this->composer->getPackage()->getExtra(); |
355 | - if (!empty($extra['patchLevel'][$package->getName()])) { |
|
355 | + if ( ! empty($extra['patchLevel'][$package->getName()])) { |
|
356 | 356 | $patch_levels = array($extra['patchLevel'][$package->getName()]); |
357 | 357 | } |
358 | 358 | // Attempt to apply with git apply. |
359 | 359 | $patched = $this->applyPatchWithGit($install_path, $patch_levels, $filename); |
360 | 360 | // In some rare cases, git will fail to apply a patch, fallback to using |
361 | 361 | // the 'patch' command. |
362 | - if (!$patched) { |
|
362 | + if ( ! $patched) { |
|
363 | 363 | foreach ($patch_levels as $patch_level) { |
364 | 364 | // --no-backup-if-mismatch here is a hack that fixes some |
365 | 365 | // differences between how patch works on windows and unix. |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | } |
375 | 375 | // If the patch *still* isn't applied, then give up and throw an Exception. |
376 | 376 | // Otherwise, let the user know it worked. |
377 | - if (!$patched) { |
|
377 | + if ( ! $patched) { |
|
378 | 378 | throw new \Exception("Cannot apply patch {$patch_url}"); |
379 | 379 | } |
380 | 380 | } |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | protected function isPatchingEnabled() |
388 | 388 | { |
389 | 389 | $extra = $this->composer->getPackage()->getExtra(); |
390 | - if (empty($extra['patches']) && empty($extra['patches-ignore']) && !isset($extra['patches-file'])) { |
|
390 | + if (empty($extra['patches']) && empty($extra['patches-ignore']) && ! isset($extra['patches-file'])) { |
|
391 | 391 | // The root package has no patches of its own, so only allow patching if |
392 | 392 | // it has specifically opted in. |
393 | 393 | return isset($extra['enable-patching']) ? $extra['enable-patching'] : \FALSE; |
@@ -406,10 +406,10 @@ discard block |
||
406 | 406 | $output = "This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches)\n"; |
407 | 407 | $output .= "Patches applied to this directory:\n\n"; |
408 | 408 | foreach ($patches as $description => $url) { |
409 | - $output .= $description . "\n"; |
|
410 | - $output .= 'Source: ' . $url . "\n\n\n"; |
|
409 | + $output .= $description."\n"; |
|
410 | + $output .= 'Source: '.$url."\n\n\n"; |
|
411 | 411 | } |
412 | - \file_put_contents($directory . "/PATCHES.txt", $output); |
|
412 | + \file_put_contents($directory."/PATCHES.txt", $output); |
|
413 | 413 | } |
414 | 414 | /** |
415 | 415 | * Executes a shell command with escaping. |
@@ -430,13 +430,13 @@ discard block |
||
430 | 430 | $command = \call_user_func_array('sprintf', $args); |
431 | 431 | $output = ''; |
432 | 432 | if ($this->io->isVerbose()) { |
433 | - $this->io->write('<comment>' . $command . '</comment>'); |
|
433 | + $this->io->write('<comment>'.$command.'</comment>'); |
|
434 | 434 | $io = $this->io; |
435 | - $output = function ($type, $data) use($io) { |
|
435 | + $output = function($type, $data) use($io) { |
|
436 | 436 | if ($type == Process::ERR) { |
437 | - $io->write('<error>' . $data . '</error>'); |
|
437 | + $io->write('<error>'.$data.'</error>'); |
|
438 | 438 | } else { |
439 | - $io->write('<comment>' . $data . '</comment>'); |
|
439 | + $io->write('<comment>'.$data.'</comment>'); |
|
440 | 440 | } |
441 | 441 | }; |
442 | 442 | } |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | { |
485 | 485 | // Do not use git apply unless the install path is itself a git repo |
486 | 486 | // @see https://stackoverflow.com/a/27283285 |
487 | - if (!\is_dir($install_path . '/.git')) { |
|
487 | + if ( ! \is_dir($install_path.'/.git')) { |
|
488 | 488 | return \FALSE; |
489 | 489 | } |
490 | 490 | $patched = \FALSE; |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | if ($this->io->isVerbose()) { |
493 | 493 | $comment = 'Testing ability to patch with git apply.'; |
494 | 494 | $comment .= ' This command may produce errors that can be safely ignored.'; |
495 | - $this->io->write('<comment>' . $comment . '</comment>'); |
|
495 | + $this->io->write('<comment>'.$comment.'</comment>'); |
|
496 | 496 | } |
497 | 497 | $checked = $this->executeCommand('git -C %s apply --check -v %s %s', $install_path, $patch_level, $filename); |
498 | 498 | $output = $this->executor->getErrorOutput(); |
@@ -2,6 +2,6 @@ |
||
2 | 2 | |
3 | 3 | // autoload.php @generated by Composer |
4 | 4 | |
5 | -require_once __DIR__ . '/composer/autoload_real.php'; |
|
5 | +require_once __DIR__.'/composer/autoload_real.php'; |
|
6 | 6 | |
7 | 7 | return ComposerAutoloaderInite0c9a7454d54053f1869d2801bc0a201::getLoader(); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare (strict_types=1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | namespace Wordlift\Modules\Plugin_Installer_Dependencies\Psr\Container; |
5 | 5 | |
6 | 6 | /** |
@@ -99,12 +99,12 @@ discard block |
||
99 | 99 | $s = \html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); |
100 | 100 | $fromEncoding = 'UTF-8'; |
101 | 101 | } |
102 | - return \iconv($fromEncoding, $toEncoding . '//IGNORE', $s); |
|
102 | + return \iconv($fromEncoding, $toEncoding.'//IGNORE', $s); |
|
103 | 103 | } |
104 | 104 | public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) |
105 | 105 | { |
106 | 106 | $ok = \true; |
107 | - \array_walk_recursive($vars, function (&$v) use(&$ok, $toEncoding, $fromEncoding) { |
|
107 | + \array_walk_recursive($vars, function(&$v) use(&$ok, $toEncoding, $fromEncoding) { |
|
108 | 108 | if (\false === ($v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding))) { |
109 | 109 | $ok = \false; |
110 | 110 | } |
@@ -121,15 +121,15 @@ discard block |
||
121 | 121 | } |
122 | 122 | public static function mb_decode_numericentity($s, $convmap, $encoding = null) |
123 | 123 | { |
124 | - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) { |
|
125 | - \trigger_error('mb_decode_numericentity() expects parameter 1 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING); |
|
124 | + if (null !== $s && ! \is_scalar($s) && ! (\is_object($s) && \method_exists($s, '__toString'))) { |
|
125 | + \trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); |
|
126 | 126 | return null; |
127 | 127 | } |
128 | - if (!\is_array($convmap) || 80000 > \PHP_VERSION_ID && !$convmap) { |
|
128 | + if ( ! \is_array($convmap) || 80000 > \PHP_VERSION_ID && ! $convmap) { |
|
129 | 129 | return \false; |
130 | 130 | } |
131 | - if (null !== $encoding && !\is_scalar($encoding)) { |
|
132 | - \trigger_error('mb_decode_numericentity() expects parameter 3 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING); |
|
131 | + if (null !== $encoding && ! \is_scalar($encoding)) { |
|
132 | + \trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); |
|
133 | 133 | return ''; |
134 | 134 | // Instead of null (cf. mb_encode_numericentity). |
135 | 135 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $encoding = self::getEncoding($encoding); |
141 | 141 | if ('UTF-8' === $encoding) { |
142 | 142 | $encoding = null; |
143 | - if (!\preg_match('//u', $s)) { |
|
143 | + if ( ! \preg_match('//u', $s)) { |
|
144 | 144 | $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); |
145 | 145 | } |
146 | 146 | } else { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $convmap[$i] += $convmap[$i + 2]; |
153 | 153 | $convmap[$i + 1] += $convmap[$i + 2]; |
154 | 154 | } |
155 | - $s = \preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use($cnt, $convmap) { |
|
155 | + $s = \preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function(array $m) use($cnt, $convmap) { |
|
156 | 156 | $c = isset($m[2]) ? (int) \hexdec($m[2]) : $m[1]; |
157 | 157 | for ($i = 0; $i < $cnt; $i += 4) { |
158 | 158 | if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { |
@@ -164,24 +164,24 @@ discard block |
||
164 | 164 | if (null === $encoding) { |
165 | 165 | return $s; |
166 | 166 | } |
167 | - return \iconv('UTF-8', $encoding . '//IGNORE', $s); |
|
167 | + return \iconv('UTF-8', $encoding.'//IGNORE', $s); |
|
168 | 168 | } |
169 | 169 | public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = \false) |
170 | 170 | { |
171 | - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) { |
|
172 | - \trigger_error('mb_encode_numericentity() expects parameter 1 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING); |
|
171 | + if (null !== $s && ! \is_scalar($s) && ! (\is_object($s) && \method_exists($s, '__toString'))) { |
|
172 | + \trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); |
|
173 | 173 | return null; |
174 | 174 | } |
175 | - if (!\is_array($convmap) || 80000 > \PHP_VERSION_ID && !$convmap) { |
|
175 | + if ( ! \is_array($convmap) || 80000 > \PHP_VERSION_ID && ! $convmap) { |
|
176 | 176 | return \false; |
177 | 177 | } |
178 | - if (null !== $encoding && !\is_scalar($encoding)) { |
|
179 | - \trigger_error('mb_encode_numericentity() expects parameter 3 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING); |
|
178 | + if (null !== $encoding && ! \is_scalar($encoding)) { |
|
179 | + \trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); |
|
180 | 180 | return null; |
181 | 181 | // Instead of '' (cf. mb_decode_numericentity). |
182 | 182 | } |
183 | - if (null !== $is_hex && !\is_scalar($is_hex)) { |
|
184 | - \trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, ' . \gettype($s) . ' given', \E_USER_WARNING); |
|
183 | + if (null !== $is_hex && ! \is_scalar($is_hex)) { |
|
184 | + \trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); |
|
185 | 185 | return null; |
186 | 186 | } |
187 | 187 | $s = (string) $s; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $encoding = self::getEncoding($encoding); |
192 | 192 | if ('UTF-8' === $encoding) { |
193 | 193 | $encoding = null; |
194 | - if (!\preg_match('//u', $s)) { |
|
194 | + if ( ! \preg_match('//u', $s)) { |
|
195 | 195 | $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); |
196 | 196 | } |
197 | 197 | } else { |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | for ($j = 0; $j < $cnt; $j += 4) { |
211 | 211 | if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { |
212 | 212 | $cOffset = $c + $convmap[$j + 2] & $convmap[$j + 3]; |
213 | - $result .= $is_hex ? \sprintf('&#x%X;', $cOffset) : '&#' . $cOffset . ';'; |
|
213 | + $result .= $is_hex ? \sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; |
|
214 | 214 | continue 2; |
215 | 215 | } |
216 | 216 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | if (null === $encoding) { |
220 | 220 | return $result; |
221 | 221 | } |
222 | - return \iconv('UTF-8', $encoding . '//IGNORE', $result); |
|
222 | + return \iconv('UTF-8', $encoding.'//IGNORE', $result); |
|
223 | 223 | } |
224 | 224 | public static function mb_convert_case($s, $mode, $encoding = null) |
225 | 225 | { |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $encoding = self::getEncoding($encoding); |
231 | 231 | if ('UTF-8' === $encoding) { |
232 | 232 | $encoding = null; |
233 | - if (!\preg_match('//u', $s)) { |
|
233 | + if ( ! \preg_match('//u', $s)) { |
|
234 | 234 | $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); |
235 | 235 | } |
236 | 236 | } else { |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | if (null === $encoding) { |
286 | 286 | return $s; |
287 | 287 | } |
288 | - return \iconv('UTF-8', $encoding . '//IGNORE', $s); |
|
288 | + return \iconv('UTF-8', $encoding.'//IGNORE', $s); |
|
289 | 289 | } |
290 | 290 | public static function mb_internal_encoding($encoding = null) |
291 | 291 | { |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | if (null === $encodingList) { |
347 | 347 | $encodingList = self::$encodingList; |
348 | 348 | } else { |
349 | - if (!\is_array($encodingList)) { |
|
349 | + if ( ! \is_array($encodingList)) { |
|
350 | 350 | $encodingList = \array_map('trim', \explode(',', $encodingList)); |
351 | 351 | } |
352 | 352 | $encodingList = \array_map('strtoupper', $encodingList); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | foreach ($encodingList as $enc) { |
355 | 355 | switch ($enc) { |
356 | 356 | case 'ASCII': |
357 | - if (!\preg_match('/[\\x80-\\xFF]/', $str)) { |
|
357 | + if ( ! \preg_match('/[\\x80-\\xFF]/', $str)) { |
|
358 | 358 | return $enc; |
359 | 359 | } |
360 | 360 | break; |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | if (null === $encodingList) { |
378 | 378 | return self::$encodingList; |
379 | 379 | } |
380 | - if (!\is_array($encodingList)) { |
|
380 | + if ( ! \is_array($encodingList)) { |
|
381 | 381 | $encodingList = \array_map('trim', \explode(',', $encodingList)); |
382 | 382 | } |
383 | 383 | $encodingList = \array_map('strtoupper', $encodingList); |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | $needle = (string) $needle; |
414 | 414 | if ('' === $needle) { |
415 | 415 | if (80000 > \PHP_VERSION_ID) { |
416 | - \trigger_error(__METHOD__ . ': Empty delimiter', \E_USER_WARNING); |
|
416 | + \trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); |
|
417 | 417 | return \false; |
418 | 418 | } |
419 | 419 | return 0; |
@@ -443,8 +443,8 @@ discard block |
||
443 | 443 | } |
444 | 444 | public static function mb_str_split($string, $split_length = 1, $encoding = null) |
445 | 445 | { |
446 | - if (null !== $string && !\is_scalar($string) && !(\is_object($string) && \method_exists($string, '__toString'))) { |
|
447 | - \trigger_error('mb_str_split() expects parameter 1 to be string, ' . \gettype($string) . ' given', \E_USER_WARNING); |
|
446 | + if (null !== $string && ! \is_scalar($string) && ! (\is_object($string) && \method_exists($string, '__toString'))) { |
|
447 | + \trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); |
|
448 | 448 | return null; |
449 | 449 | } |
450 | 450 | if (1 > ($split_length = (int) $split_length)) { |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | $rx .= '.{65535}'; |
464 | 464 | $split_length -= 65535; |
465 | 465 | } |
466 | - $rx .= '.{' . $split_length . '})/us'; |
|
466 | + $rx .= '.{'.$split_length.'})/us'; |
|
467 | 467 | return \preg_split($rx, $string, null, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); |
468 | 468 | } |
469 | 469 | $result = []; |
@@ -605,11 +605,11 @@ discard block |
||
605 | 605 | if (0x80 > ($code %= 0x200000)) { |
606 | 606 | $s = \chr($code); |
607 | 607 | } elseif (0x800 > $code) { |
608 | - $s = \chr(0xc0 | $code >> 6) . \chr(0x80 | $code & 0x3f); |
|
608 | + $s = \chr(0xc0 | $code >> 6).\chr(0x80 | $code & 0x3f); |
|
609 | 609 | } elseif (0x10000 > $code) { |
610 | - $s = \chr(0xe0 | $code >> 12) . \chr(0x80 | $code >> 6 & 0x3f) . \chr(0x80 | $code & 0x3f); |
|
610 | + $s = \chr(0xe0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3f).\chr(0x80 | $code & 0x3f); |
|
611 | 611 | } else { |
612 | - $s = \chr(0xf0 | $code >> 18) . \chr(0x80 | $code >> 12 & 0x3f) . \chr(0x80 | $code >> 6 & 0x3f) . \chr(0x80 | $code & 0x3f); |
|
612 | + $s = \chr(0xf0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3f).\chr(0x80 | $code >> 6 & 0x3f).\chr(0x80 | $code & 0x3f); |
|
613 | 613 | } |
614 | 614 | if ('UTF-8' !== ($encoding = self::getEncoding($encoding))) { |
615 | 615 | $s = \mb_convert_encoding($s, $encoding, 'UTF-8'); |
@@ -663,17 +663,17 @@ discard block |
||
663 | 663 | } else { |
664 | 664 | $c = ($m[$i++] - 0xc0 << 6) + $m[$i++] - 0x80; |
665 | 665 | } |
666 | - $entities .= '&#' . $c . ';'; |
|
666 | + $entities .= '&#'.$c.';'; |
|
667 | 667 | } |
668 | 668 | return $entities; |
669 | 669 | } |
670 | 670 | private static function title_case(array $s) |
671 | 671 | { |
672 | - return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8') . self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); |
|
672 | + return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); |
|
673 | 673 | } |
674 | 674 | private static function getData($file) |
675 | 675 | { |
676 | - if (\file_exists($file = __DIR__ . '/Resources/unidata/' . $file . '.php')) { |
|
676 | + if (\file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { |
|
677 | 677 | return require $file; |
678 | 678 | } |
679 | 679 | return \false; |