Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit b5df412

Browse files
chore: tweaks
1 parent 7a86bf9 commit b5df412

File tree

1 file changed

+19
-38
lines changed

1 file changed

+19
-38
lines changed

src/classes/models/custom_post/setting.php

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@ public function get_default_class( $post_id, $is_selector = true ) {
8787
* @return array
8888
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
8989
*/
90-
protected function filter_edit_form_params(
91-
/** @noinspection PhpUnusedParameterInspection */
92-
$params, $post
93-
) {
90+
protected function filter_edit_form_params( $params, $post ) {
9491
/** @var Assets $assets */
9592
$assets = Assets::get_instance( $this->app );
9693
$setting_details = $assets->get_setting_details( 'setting' );
@@ -161,20 +158,14 @@ protected function get_manage_posts_columns() {
161158
},
162159
'display' => [
163160
'name' => $this->translate( 'display' ),
164-
'callback' => function (
165-
/** @noinspection PhpUnusedParameterInspection */
166-
$value, $data, $post
167-
) {
161+
'callback' => function ( $value, $data, $post ) {
168162
return $this->display_callback( $value, $data, $post );
169163
},
170164
'unescape' => true,
171165
],
172166
'others' => [
173167
'name' => $this->translate( 'others' ),
174-
'callback' => function (
175-
/** @noinspection PhpUnusedParameterInspection */
176-
$value, $data, $post
177-
) {
168+
'callback' => function ( $value, $data, $post ) {
178169
return $this->others_callback( $value, $data, $post );
179170
},
180171
'unescape' => true,
@@ -199,7 +190,9 @@ protected function get_manage_posts_columns() {
199190
*/
200191
private function display_callback(
201192
/** @noinspection PhpUnusedParameterInspection */
202-
$value, $data, $post
193+
$value,
194+
$data,
195+
$post
203196
) {
204197
/** @var Assets $assets */
205198
$assets = Assets::get_instance( $this->app );
@@ -294,7 +287,9 @@ private function get_display_callback_target() {
294287
*/
295288
private function others_callback(
296289
/** @noinspection PhpUnusedParameterInspection */
297-
$value, $data, $post
290+
$value,
291+
$data,
292+
$post
298293
) {
299294
return $this->get_view( 'admin/custom_post/setting/others', [
300295
'details' => [
@@ -311,7 +306,8 @@ private function others_callback(
311306
*/
312307
protected function before_output_edit_form(
313308
/** @noinspection PhpUnusedParameterInspection */
314-
$post, $params
309+
$post,
310+
$params
315311
) {
316312
$this->setup_color_picker();
317313

@@ -324,10 +320,7 @@ protected function before_output_edit_form(
324320
* @param WP_Post $post
325321
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
326322
*/
327-
public function output_after_editor(
328-
/** @noinspection PhpUnusedParameterInspection */
329-
WP_Post $post
330-
) {
323+
public function output_after_editor( WP_Post $post ) {
331324
$this->get_view( 'admin/custom_post/setting/test', [], true );
332325
}
333326

@@ -351,10 +344,7 @@ protected function get_table_column_name( $key ) {
351344
* @param array $new
352345
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
353346
*/
354-
public function data_updated(
355-
/** @noinspection PhpUnusedParameterInspection */
356-
$post_id, WP_Post $post, array $old, array $new
357-
) {
347+
public function data_updated( $post_id, WP_Post $post, array $old, array $new ) {
358348
$this->clear_options_cache();
359349
}
360350

@@ -364,10 +354,7 @@ public function data_updated(
364354
* @param array $data
365355
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
366356
*/
367-
public function data_inserted(
368-
/** @noinspection PhpUnusedParameterInspection */
369-
$post_id, WP_Post $post, array $data
370-
) {
357+
public function data_inserted( $post_id, WP_Post $post, array $data ) {
371358
$this->clear_options_cache();
372359
}
373360

@@ -376,21 +363,15 @@ public function data_inserted(
376363
* @param WP_Post $post
377364
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
378365
*/
379-
public function untrash_post(
380-
/** @noinspection PhpUnusedParameterInspection */
381-
$post_id, WP_Post $post
382-
) {
366+
public function untrash_post( $post_id, WP_Post $post ) {
383367
$this->clear_options_cache();
384368
}
385369

386370
/**
387371
* @param int $post_id
388372
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
389373
*/
390-
public function trash_post(
391-
/** @noinspection PhpUnusedParameterInspection */
392-
$post_id
393-
) {
374+
public function trash_post( $post_id ) {
394375
$this->clear_options_cache();
395376
}
396377

@@ -429,7 +410,7 @@ public function get_settings( $target ) {
429410
$this->app->array->get( $this->get_list_data( function ( $query ) {
430411
/** @var Builder $query */
431412
$query->where( 'is_valid', 1 )
432-
->order_by( 'priority' );
413+
->order_by( 'priority' );
433414
} ), 'data' ) as $data
434415
) {
435416
$options = [];
@@ -455,7 +436,7 @@ public function get_settings( $target ) {
455436
$options['selector'] .= ', ' . $data['selector'];
456437
}
457438
if ( 'editor' === $target ) {
458-
$options = $this->toCamel( $options );
439+
$options = $this->to_camel( $options );
459440
}
460441
$settings[] = [
461442
'id' => $post->ID,
@@ -472,7 +453,7 @@ public function get_settings( $target ) {
472453
*
473454
* @return array
474455
*/
475-
private function toCamel( $options ) {
456+
private function to_camel( $options ) {
476457
foreach ( $options as $key => $item ) {
477458
$new_key = $this->app->string->camel( $key );
478459
if ( $key !== $new_key ) {

0 commit comments

Comments
 (0)