Skip to content

Commit 9575818

Browse files
committed
fix(phpcs): refactors and improves code quality
Refactors code for better readability and maintainability. Updates parameter naming for clarity and consistency. Ensures scripts are loaded in the footer for improved page load performance. Removes unnecessary whitespace.
1 parent 9f9fd51 commit 9575818

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

inc/Helpers/Formatting/Link.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,5 +283,4 @@ function get_acf_link_classes( $field, array $classes ): string {
283283
}
284284

285285
return implode( ' ', $classes );
286-
287286
}

inc/Service_Container.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ public function register_service( string $service ): bool {
7575
/**
7676
* Instantiate a single service.
7777
*
78-
* @param string $class Service class to instantiate.
78+
* @param string $service_class Service class to instantiate.
7979
*
8080
* @return Service
8181
*/
82-
private function instantiate_service( string $class ): Service {
82+
private function instantiate_service( string $service_class ): Service {
8383
/**
8484
* @var Service $service
8585
*/
86-
$service = new $class();
86+
$service = new $service_class();
8787
$service->register( $this );
8888
$this->services[ $service->get_service_name() ] = $service;
8989

inc/Services/Editor.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public function admin_editor_script(): void {
197197
$filepath,
198198
$asset_data['dependencies'],
199199
$asset_data['version'],
200-
true
200+
[ 'in_footer' => true ]
201201
);
202202

203203
$this->assets_tools->add_inline_script(
@@ -309,7 +309,5 @@ public function gutenberg_blocks_allowed( $allowed_blocks, \WP_Block_Editor_Cont
309309
];
310310

311311
return ( is_array( $allowed_blocks ) ) ? array_merge( $allowed, $allowed_blocks ) : $allowed;
312-
313312
}
314-
315313
}

inc/Tools/Body_Class.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,25 @@ public function remove( string $body_class ): void {
6767

6868
/**
6969
*
70-
* @param array $classes
70+
* @param array $body_classes
7171
*
7272
* @return array
7373
*/
74-
public function body_class( array $classes ): array {
74+
public function body_class( array $body_classes ): array {
7575
// Filter body classes
76-
return array_filter( \array_merge( $classes, $this->body_class ), [ $this, 'filter' ] );
76+
return array_filter( \array_merge( $body_classes, $this->body_class ), [ $this, 'filter' ] );
7777
}
7878

7979
/**
8080
* Filter method which handle to delete wanted body_class
8181
*
82-
* @param string $class
82+
* @param string $class_name
8383
*
8484
* @author Maxime CULEA
8585
*
8686
* @return bool
8787
*/
88-
private function filter( string $class ): bool {
89-
return ! in_array( $class, $this->unwanted_classes, true );
88+
private function filter( string $class_name ): bool {
89+
return ! in_array( $class_name, $this->unwanted_classes, true );
9090
}
9191
}

0 commit comments

Comments
 (0)