diff --git a/mu-plugins/10up-plugin/plugin.php b/mu-plugins/10up-plugin/plugin.php index ccc77f74..f7cc9628 100755 --- a/mu-plugins/10up-plugin/plugin.php +++ b/mu-plugins/10up-plugin/plugin.php @@ -16,6 +16,8 @@ * @package TenUpPlugin */ +declare( strict_types = 1 ); + // Useful global constants. define( 'TENUP_PLUGIN_VERSION', '0.1.0' ); define( 'TENUP_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); diff --git a/mu-plugins/10up-plugin/src/Assets.php b/mu-plugins/10up-plugin/src/Assets.php index c9a6607c..7deb5967 100644 --- a/mu-plugins/10up-plugin/src/Assets.php +++ b/mu-plugins/10up-plugin/src/Assets.php @@ -5,6 +5,8 @@ * @package TenUpPlugin */ +declare( strict_types = 1 ); + namespace TenUpPlugin; use TenupFramework\Assets\GetAssetInfo; @@ -26,7 +28,7 @@ class Assets implements ModuleInterface { * * @return bool */ - public function can_register() { + public function can_register(): bool { return true; } @@ -35,7 +37,7 @@ public function can_register() { * * @return void */ - public function register() { + public function register(): void { $this->setup_asset_vars( dist_path: TENUP_PLUGIN_PATH . 'dist/', fallback_version: TENUP_PLUGIN_VERSION @@ -50,7 +52,7 @@ public function register() { * * @return void */ - public function admin_scripts() { + public function admin_scripts(): void { wp_enqueue_script( 'tenup_plugin_admin', TENUP_PLUGIN_URL . 'dist/js/admin.js', @@ -65,7 +67,7 @@ public function admin_scripts() { * * @return void */ - public function admin_styles() { + public function admin_styles(): void { wp_enqueue_style( 'tenup_plugin_admin', TENUP_PLUGIN_URL . 'dist/css/admin.css', diff --git a/mu-plugins/10up-plugin/src/Core/Emoji.php b/mu-plugins/10up-plugin/src/Core/Emoji.php index b3d58357..4a4885f4 100644 --- a/mu-plugins/10up-plugin/src/Core/Emoji.php +++ b/mu-plugins/10up-plugin/src/Core/Emoji.php @@ -5,6 +5,8 @@ * @package TenUpPlugin/Core */ +declare( strict_types = 1 ); + namespace TenUpPlugin\Core; use TenupFramework\Module; diff --git a/mu-plugins/10up-plugin/src/Core/HeadOverrides.php b/mu-plugins/10up-plugin/src/Core/HeadOverrides.php index f2b926ef..94063d3e 100644 --- a/mu-plugins/10up-plugin/src/Core/HeadOverrides.php +++ b/mu-plugins/10up-plugin/src/Core/HeadOverrides.php @@ -5,6 +5,8 @@ * @package TenUpPlugin/Core */ +declare( strict_types = 1 ); + namespace TenUpPlugin\Core; use TenupFramework\Module; diff --git a/mu-plugins/10up-plugin/src/PluginCore.php b/mu-plugins/10up-plugin/src/PluginCore.php index f30e9f69..b92f2554 100644 --- a/mu-plugins/10up-plugin/src/PluginCore.php +++ b/mu-plugins/10up-plugin/src/PluginCore.php @@ -5,6 +5,8 @@ * @package TenUpPlugin */ +declare( strict_types = 1 ); + namespace TenUpPlugin; use TenupFramework\ModuleInitialization; diff --git a/mu-plugins/10up-plugin/src/PostTypes/Demo.php b/mu-plugins/10up-plugin/src/PostTypes/Demo.php index c22f2ad5..a4cd1ecf 100644 --- a/mu-plugins/10up-plugin/src/PostTypes/Demo.php +++ b/mu-plugins/10up-plugin/src/PostTypes/Demo.php @@ -5,6 +5,8 @@ * @package TenUpPlugin */ +declare( strict_types = 1 ); + namespace TenUpPlugin\PostTypes; use TenupFramework\PostTypes\AbstractPostType; @@ -19,7 +21,7 @@ class Demo extends AbstractPostType { * * @return string */ - public function get_name() { + public function get_name(): string { return 'tenup-demo'; } @@ -28,7 +30,7 @@ public function get_name() { * * @return string */ - public function get_singular_label() { + public function get_singular_label(): string { return esc_html__( 'Demo', 'tenup-plugin' ); } @@ -37,7 +39,7 @@ public function get_singular_label() { * * @return string */ - public function get_plural_label() { + public function get_plural_label(): string { return esc_html__( 'Demos', 'tenup-plugin' ); } @@ -50,7 +52,7 @@ public function get_plural_label() { * * @return string */ - public function get_menu_icon() { + public function get_menu_icon(): string { return 'dashicons-chart-pie'; } @@ -59,7 +61,7 @@ public function get_menu_icon() { * * @return bool */ - public function can_register() { + public function can_register(): bool { return false; } @@ -69,7 +71,7 @@ public function can_register() { * * @return array */ - public function get_supported_taxonomies() { + public function get_supported_taxonomies(): array { return [ 'tenup-tax-demo', ]; @@ -80,7 +82,7 @@ public function get_supported_taxonomies() { * * @return void */ - public function after_register() { + public function after_register(): void { // Register any hooks/filters you need. } } diff --git a/mu-plugins/10up-plugin/src/PostTypes/Page.php b/mu-plugins/10up-plugin/src/PostTypes/Page.php index 98bdeb8c..0fe48df4 100644 --- a/mu-plugins/10up-plugin/src/PostTypes/Page.php +++ b/mu-plugins/10up-plugin/src/PostTypes/Page.php @@ -5,6 +5,8 @@ * @package TenUpPlugin */ +declare( strict_types = 1 ); + namespace TenUpPlugin\PostTypes; use TenupFramework\PostTypes\AbstractCorePostType; @@ -22,7 +24,7 @@ class Page extends AbstractCorePostType { * * @return string */ - public function get_name() { + public function get_name(): string { return 'page'; } @@ -32,7 +34,7 @@ public function get_name() { * * @return array */ - public function get_supported_taxonomies() { + public function get_supported_taxonomies(): array { return []; } @@ -41,7 +43,7 @@ public function get_supported_taxonomies() { * * @return void */ - public function after_register() { + public function after_register(): void { // Do nothing. } } diff --git a/mu-plugins/10up-plugin/src/PostTypes/Post.php b/mu-plugins/10up-plugin/src/PostTypes/Post.php index a84fe7d8..0a919e5e 100644 --- a/mu-plugins/10up-plugin/src/PostTypes/Post.php +++ b/mu-plugins/10up-plugin/src/PostTypes/Post.php @@ -5,6 +5,8 @@ * @package TenUpPlugin */ +declare( strict_types = 1 ); + namespace TenUpPlugin\PostTypes; use TenupFramework\PostTypes\AbstractCorePostType; @@ -22,7 +24,7 @@ class Post extends AbstractCorePostType { * * @return string */ - public function get_name() { + public function get_name(): string { return 'post'; } @@ -34,7 +36,7 @@ public function get_name() { * * @return array */ - public function get_supported_taxonomies() { + public function get_supported_taxonomies(): array { return []; } @@ -43,7 +45,7 @@ public function get_supported_taxonomies() { * * @return void */ - public function after_register() { + public function after_register(): void { // Do nothing. } } diff --git a/mu-plugins/10up-plugin/src/Taxonomies/Demo.php b/mu-plugins/10up-plugin/src/Taxonomies/Demo.php index ad89ce24..098281dc 100644 --- a/mu-plugins/10up-plugin/src/Taxonomies/Demo.php +++ b/mu-plugins/10up-plugin/src/Taxonomies/Demo.php @@ -5,6 +5,8 @@ * @package TenUpPlugin */ +declare( strict_types = 1 ); + namespace TenUpPlugin\Taxonomies; use TenupFramework\Taxonomies\AbstractTaxonomy; @@ -19,7 +21,7 @@ class Demo extends AbstractTaxonomy { * * @return string */ - public function get_name() { + public function get_name(): string { return 'tenup-tax-demo'; } @@ -28,7 +30,7 @@ public function get_name() { * * @return string */ - public function get_singular_label() { + public function get_singular_label(): string { return esc_html__( 'Demo Term', 'tenup-plugin' ); } @@ -37,7 +39,7 @@ public function get_singular_label() { * * @return string */ - public function get_plural_label() { + public function get_plural_label(): string { return esc_html__( 'Demo Terms', 'tenup-plugin' ); } @@ -46,7 +48,7 @@ public function get_plural_label() { * * @return bool */ - public function can_register() { + public function can_register(): bool { return false; } } diff --git a/themes/10up-block-theme/src/Assets.php b/themes/10up-block-theme/src/Assets.php index d2bc60e7..d8ee273b 100644 --- a/themes/10up-block-theme/src/Assets.php +++ b/themes/10up-block-theme/src/Assets.php @@ -5,6 +5,8 @@ * @package TenupBlockTheme */ +declare( strict_types = 1 ); + namespace TenupBlockTheme; use TenupFramework\Assets\GetAssetInfo; @@ -26,7 +28,7 @@ class Assets implements ModuleInterface { * * @return bool */ - public function can_register() { + public function can_register(): bool { return true; } @@ -35,7 +37,7 @@ public function can_register() { * * @return void */ - public function register() { + public function register(): void { $this->setup_asset_vars( dist_path: TENUP_BLOCK_THEME_DIST_PATH, fallback_version: TENUP_BLOCK_THEME_VERSION @@ -51,7 +53,7 @@ public function register() { * * @return void */ - public function enqueue_frontend_assets() { + public function enqueue_frontend_assets(): void { wp_enqueue_style( 'tenup-theme-styles', TENUP_BLOCK_THEME_TEMPLATE_URL . '/dist/css/frontend.css', @@ -77,7 +79,7 @@ public function enqueue_frontend_assets() { * * @return void */ - public function enqueue_block_editor_assets() { + public function enqueue_block_editor_assets(): void { wp_enqueue_style( 'tenup-theme-editor-frame-style-overrides', TENUP_BLOCK_THEME_TEMPLATE_URL . '/dist/css/editor-frame-style-overrides.css', @@ -99,7 +101,7 @@ public function enqueue_block_editor_assets() { * * @return void */ - public function enqueue_block_editor_iframe_assets() { + public function enqueue_block_editor_iframe_assets(): void { // The `enqueue_block_assets` action is triggered both on the front-end and in the editor iframe. // We only want to enqueue these styles inside the editor iframe. @@ -120,7 +122,7 @@ public function enqueue_block_editor_iframe_assets() { * * @return void */ - public function register_all_icons() { + public function register_all_icons(): void { if ( ! function_exists( '\UIKitCore\Helpers\register_icons' ) ) { return; } diff --git a/themes/10up-block-theme/src/Blocks.php b/themes/10up-block-theme/src/Blocks.php index f689eec3..186dde0f 100644 --- a/themes/10up-block-theme/src/Blocks.php +++ b/themes/10up-block-theme/src/Blocks.php @@ -5,6 +5,8 @@ * @package TenupBlockTheme */ +declare( strict_types = 1 ); + namespace TenupBlockTheme; use TenupFramework\Assets\GetAssetInfo; @@ -26,7 +28,7 @@ class Blocks implements ModuleInterface { * * @return bool */ - public function can_register() { + public function can_register(): bool { return true; } @@ -35,7 +37,7 @@ public function can_register() { * * @return void */ - public function register() { + public function register(): void { $this->setup_asset_vars( dist_path: TENUP_BLOCK_THEME_DIST_PATH, fallback_version: TENUP_BLOCK_THEME_VERSION @@ -53,7 +55,7 @@ public function register() { * * @return void */ - public function register_theme_blocks() { + public function register_theme_blocks(): void { // Register all the blocks in the theme. if ( file_exists( TENUP_BLOCK_THEME_BLOCK_DIST_DIR ) ) { $block_json_files = glob( TENUP_BLOCK_THEME_BLOCK_DIST_DIR . '*/block.json' ); @@ -91,7 +93,7 @@ function ( array|bool $allowed_blocks ) use ( $block_names ): array|bool { * * @return void */ - public function enqueue_theme_block_styles() { + public function enqueue_theme_block_styles(): void { $stylesheets = glob( TENUP_BLOCK_THEME_DIST_PATH . '/blocks/autoenqueue/**/*.css' ); if ( empty( $stylesheets ) ) { diff --git a/themes/10up-block-theme/src/TemplateTags.php b/themes/10up-block-theme/src/TemplateTags.php index 95e77e5f..59661e04 100644 --- a/themes/10up-block-theme/src/TemplateTags.php +++ b/themes/10up-block-theme/src/TemplateTags.php @@ -5,6 +5,8 @@ * @package TenupBlockTheme */ +declare( strict_types = 1 ); + namespace TenupBlockTheme; use TenupFramework\Module; @@ -24,7 +26,7 @@ class TemplateTags implements ModuleInterface { * * @return bool */ - public function can_register() { + public function can_register(): bool { return true; } @@ -33,7 +35,7 @@ public function can_register() { * * @return void */ - public function register() { + public function register(): void { add_action( 'wp_head', [ $this, 'add_viewport_meta_tag' ], 10, 0 ); } @@ -42,7 +44,7 @@ public function register() { * * @return void */ - public function add_viewport_meta_tag() { + public function add_viewport_meta_tag(): void { ?> setup_asset_vars( dist_path: TENUP_THEME_DIST_PATH, fallback_version: TENUP_THEME_VERSION @@ -51,7 +53,7 @@ public function register() { * * @return void */ - public function scripts() { + public function scripts(): void { /** * Enqueuing frontend.js is required to get css hot reloading working in the frontend * If you're not shipping any front-end js wrap this enqueue in a SCRIPT_DEBUG check. @@ -70,7 +72,7 @@ public function scripts() { * * @return void */ - public function enqueue_block_editor_scripts() { + public function enqueue_block_editor_scripts(): void { wp_enqueue_script( 'block-editor-script', TENUP_THEME_DIST_URL . 'js/block-editor-script.js', @@ -85,7 +87,7 @@ public function enqueue_block_editor_scripts() { * * @return void */ - public function styles() { + public function styles(): void { wp_enqueue_style( 'styles', TENUP_THEME_TEMPLATE_URL . '/dist/css/frontend.css', diff --git a/themes/10up-theme/src/Blocks.php b/themes/10up-theme/src/Blocks.php index 306bdd7a..e734551b 100644 --- a/themes/10up-theme/src/Blocks.php +++ b/themes/10up-theme/src/Blocks.php @@ -5,6 +5,8 @@ * @package TenUpTheme */ +declare( strict_types = 1 ); + namespace TenUpTheme; use TenupFramework\Assets\GetAssetInfo; @@ -26,7 +28,7 @@ class Blocks implements ModuleInterface { * * @return bool */ - public function can_register() { + public function can_register(): bool { return true; } @@ -35,7 +37,7 @@ public function can_register() { * * @return void */ - public function register() { + public function register(): void { $this->setup_asset_vars( dist_path: TENUP_THEME_DIST_PATH, fallback_version: TENUP_THEME_VERSION @@ -55,7 +57,7 @@ public function register() { * * @return void */ - public function register_theme_blocks() { + public function register_theme_blocks(): void { // Register all the blocks in the theme if ( file_exists( TENUP_THEME_BLOCK_DIST_DIR ) ) { $block_json_files = glob( TENUP_THEME_BLOCK_DIST_DIR . '*/block.json' ); @@ -97,7 +99,7 @@ public function register_theme_blocks() { * * @return void */ - public function blocks_editor_styles() { + public function blocks_editor_styles(): void { wp_enqueue_style( 'editor-style-overrides', TENUP_THEME_TEMPLATE_URL . '/dist/css/editor-style-overrides.css', @@ -132,7 +134,7 @@ public function blocks_editor_styles() { * * @return void */ - public function enqueue_block_specific_styles() { + public function enqueue_block_specific_styles(): void { $stylesheets = glob( TENUP_THEME_DIST_PATH . 'blocks/autoenqueue/**/*.css' ); if ( empty( $stylesheets ) ) { @@ -179,7 +181,7 @@ public function enqueue_block_specific_styles() { * * @return void */ - public function register_block_pattern_categories() { + public function register_block_pattern_categories(): void { // Register a block pattern category register_block_pattern_category( '10up-theme', diff --git a/themes/10up-theme/src/ThemeCore.php b/themes/10up-theme/src/ThemeCore.php index b42b8d2d..1958ea19 100644 --- a/themes/10up-theme/src/ThemeCore.php +++ b/themes/10up-theme/src/ThemeCore.php @@ -5,6 +5,8 @@ * @package TenUpTheme */ +declare( strict_types = 1 ); + namespace TenUpTheme; use TenupFramework\ModuleInitialization;