Skip to content

Commit

Permalink
Fix PHPCS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
anubisthejackle committed Apr 3, 2024
1 parent 9f9a5b8 commit b5edb52
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
36 changes: 18 additions & 18 deletions src/assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ function action_wp_enqueue_scripts(): void {
*/

// wp_enqueue_script(
// 'wp-pdf-generator-example-entry',
// get_entry_asset_url( 'example-entry' ),
// get_asset_dependency_array( 'example-entry' ),
// get_asset_version( 'example-entry' ),
// true
// 'wp-pdf-generator-example-entry',
// get_entry_asset_url( 'example-entry' ),
// get_asset_dependency_array( 'example-entry' ),
// get_asset_version( 'example-entry' ),
// true
// );
// wp_set_script_translations( 'wp-pdf-generator-example-entry', 'wp-pdf-generator' );
}
Expand All @@ -57,11 +57,11 @@ function action_admin_enqueue_scripts(): void {
*/

// wp_enqueue_script(
// 'wp-pdf-generator-admin-handle',
// get_entry_asset_url( 'admin-handle' ),
// get_asset_dependency_array( 'admin-handle' ),
// get_asset_version( 'admin-handle' ),
// true
// 'wp-pdf-generator-admin-handle',
// get_entry_asset_url( 'admin-handle' ),
// get_asset_dependency_array( 'admin-handle' ),
// get_asset_version( 'admin-handle' ),
// true
// );
// wp_set_script_translations( 'wp-pdf-generator-admin-handle', 'wp-pdf-generator' );
}
Expand All @@ -81,11 +81,11 @@ function action_enqueue_block_editor_assets(): void {
*/

// wp_enqueue_script(
// 'wp-pdf-generator-slotfills',
// get_entry_asset_url( 'slotfills' ),
// get_asset_dependency_array( 'slotfills' ),
// get_asset_version( 'slotfills' ),
// true
// 'wp-pdf-generator-slotfills',
// get_entry_asset_url( 'slotfills' ),
// get_asset_dependency_array( 'slotfills' ),
// get_asset_version( 'slotfills' ),
// true
// );
// wp_set_script_translations( 'wp-pdf-generator-slotfills', 'wp-pdf-generator' );
}
Expand All @@ -96,7 +96,7 @@ function action_enqueue_block_editor_assets(): void {
* @param string $path The file path to validate.
* @return bool True if the path is valid and the file exists.
*/
function validate_path( string $path ) : bool {
function validate_path( string $path ): bool {
return 0 === validate_file( $path ) && file_exists( $path );
}

Expand Down Expand Up @@ -152,7 +152,7 @@ function get_entry_asset_map( string $dir_entry_name ): array {
*
* @return array<int, string> The asset's dependency array.
*/
function get_asset_dependency_array( string $dir_entry_name ) : array {
function get_asset_dependency_array( string $dir_entry_name ): array {
$asset_arr = get_entry_asset_map( $dir_entry_name );
return $asset_arr['dependencies'] ?? [];
}
Expand All @@ -164,7 +164,7 @@ function get_asset_dependency_array( string $dir_entry_name ) : array {
*
* @return string The asset's version hash.
*/
function get_asset_version( string $dir_entry_name ) : string {
function get_asset_version( string $dir_entry_name ): string {
$asset_arr = get_entry_asset_map( $dir_entry_name );
return $asset_arr['version'] ?? '1.0';
}
Expand Down
4 changes: 2 additions & 2 deletions src/meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ function register_meta_helper(
string|array $object_slugs,
string $meta_key,
array $args = []
) : bool {
): bool {

// Object type must be either post or term.
if ( ! in_array( $object_type, [ 'post', 'term' ], true ) ) {
throw new \InvalidArgumentException(
__(
esc_html__(
'Object type must be one of "post", "term".',
'wp-pdf-generator'
)
Expand Down
2 changes: 1 addition & 1 deletion wp-pdf-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
if ( ! class_exists( \Composer\InstalledVersions::class ) ) {
\add_action(
'admin_notices',
function() {
function () {
?>
<div class="notice notice-error">
<p><?php esc_html_e( 'Composer is not installed and wp-pdf-generator cannot load. Try using a `*-built` branch if the plugin is being loaded as a submodule.', 'wp-pdf-generator' ); ?></p>
Expand Down

0 comments on commit b5edb52

Please sign in to comment.