diff --git a/web/app/mu-plugins/nebula-blocks/includes/classes/Blocks.php b/web/app/mu-plugins/nebula-blocks/includes/classes/Blocks.php index 6ee41c8..159478b 100644 --- a/web/app/mu-plugins/nebula-blocks/includes/classes/Blocks.php +++ b/web/app/mu-plugins/nebula-blocks/includes/classes/Blocks.php @@ -18,7 +18,7 @@ class Blocks { * * @return void */ - public function setup() { + public function setup(): void { add_action( 'init', [ $this, 'register' ] ); } @@ -31,7 +31,7 @@ public function setup() { * * @see https://developer.wordpress.org/reference/functions/register_block_type/ */ - public function register() { + public function register(): void { $blocks_directory = trailingslashit( NEBULA_BLOCKS_PATH . 'build' ); // Register all the blocks in the plugin. diff --git a/web/app/mu-plugins/eighteen73-core/.editorconfig b/web/app/mu-plugins/nebula-core/.editorconfig similarity index 100% rename from web/app/mu-plugins/eighteen73-core/.editorconfig rename to web/app/mu-plugins/nebula-core/.editorconfig diff --git a/web/app/mu-plugins/eighteen73-core/.gitignore b/web/app/mu-plugins/nebula-core/.gitignore similarity index 94% rename from web/app/mu-plugins/eighteen73-core/.gitignore rename to web/app/mu-plugins/nebula-core/.gitignore index a8ec18a..d1861ea 100644 --- a/web/app/mu-plugins/eighteen73-core/.gitignore +++ b/web/app/mu-plugins/nebula-core/.gitignore @@ -29,4 +29,5 @@ node_modules/ # dotenv environment variables file .env +# Composer vendor directory vendor/ diff --git a/web/app/mu-plugins/eighteen73-core/README.md b/web/app/mu-plugins/nebula-core/README.md similarity index 100% rename from web/app/mu-plugins/eighteen73-core/README.md rename to web/app/mu-plugins/nebula-core/README.md diff --git a/web/app/mu-plugins/eighteen73-core/autoload.php b/web/app/mu-plugins/nebula-core/autoload.php similarity index 89% rename from web/app/mu-plugins/eighteen73-core/autoload.php rename to web/app/mu-plugins/nebula-core/autoload.php index 49e70b4..84f3788 100644 --- a/web/app/mu-plugins/eighteen73-core/autoload.php +++ b/web/app/mu-plugins/nebula-core/autoload.php @@ -9,13 +9,13 @@ * * @return void * - * @package Eighteen73Core + * @package NebulaCore */ spl_autoload_register( function ( $class_name ) { $namspaces = [ - 'Eighteen73\\C\\' => __DIR__ . '/includes/classes/', + 'Eighteen73\\Nebula\\Core\\' => __DIR__ . '/includes/classes/', ]; foreach ( $namspaces as $prefix => $base_dir ) { $len = strlen( $prefix ); diff --git a/web/app/mu-plugins/eighteen73-core/composer.json b/web/app/mu-plugins/nebula-core/composer.json similarity index 72% rename from web/app/mu-plugins/eighteen73-core/composer.json rename to web/app/mu-plugins/nebula-core/composer.json index eedf6c2..0671ac9 100644 --- a/web/app/mu-plugins/eighteen73-core/composer.json +++ b/web/app/mu-plugins/nebula-core/composer.json @@ -1,6 +1,6 @@ { - "name": "eighteen73/core", - "description": "Core functionality for an eighteen73 project.", + "name": "eighteen73/nebula-core", + "description": "Core functionality for a Nebula project.", "type": "wordpress-plugin", "require-dev": { "eighteen73/wordpress-coding-standards": "^2.0" diff --git a/web/app/mu-plugins/eighteen73-core/includes/classes/PostTypes/AbstractCorePostType.php b/web/app/mu-plugins/nebula-core/includes/classes/PostTypes/AbstractCorePostType.php similarity index 80% rename from web/app/mu-plugins/eighteen73-core/includes/classes/PostTypes/AbstractCorePostType.php rename to web/app/mu-plugins/nebula-core/includes/classes/PostTypes/AbstractCorePostType.php index 8625425..1468e9d 100644 --- a/web/app/mu-plugins/eighteen73-core/includes/classes/PostTypes/AbstractCorePostType.php +++ b/web/app/mu-plugins/nebula-core/includes/classes/PostTypes/AbstractCorePostType.php @@ -5,7 +5,7 @@ * @package Eighteen73Core */ -namespace Eighteen73\Core\PostTypes; +namespace Eighteen73\Nebula\Core\PostTypes; /** * Abstract class for core post types. @@ -23,7 +23,7 @@ abstract class AbstractCorePostType extends AbstractPostType { * * @return string */ - public function get_singular_label() { + public function get_singular_label(): string { return ''; } @@ -34,7 +34,7 @@ public function get_singular_label() { * * @return string */ - public function get_plural_label() { + public function get_plural_label(): string { return ''; } @@ -45,7 +45,7 @@ public function get_plural_label() { * * @return string */ - public function get_menu_icon() { + public function get_menu_icon(): string { return ''; } @@ -56,7 +56,7 @@ public function get_menu_icon() { * * @return bool */ - public function can_register() { + public function can_register(): bool { return true; } @@ -64,9 +64,9 @@ public function can_register() { * Registers a post type and associates its taxonomies. * * @uses $this->get_name() to get the post's type name. - * @return Bool Whether this theme has supports for this post type. + * @return Bool Whether this project has supports for this post type. */ - public function register() { + public function register(): bool { $this->register_taxonomies(); $this->after_register(); diff --git a/web/app/mu-plugins/eighteen73-core/includes/classes/PostTypes/AbstractPostType.php b/web/app/mu-plugins/nebula-core/includes/classes/PostTypes/AbstractPostType.php similarity index 60% rename from web/app/mu-plugins/eighteen73-core/includes/classes/PostTypes/AbstractPostType.php rename to web/app/mu-plugins/nebula-core/includes/classes/PostTypes/AbstractPostType.php index 20c85b5..7cf1189 100644 --- a/web/app/mu-plugins/eighteen73-core/includes/classes/PostTypes/AbstractPostType.php +++ b/web/app/mu-plugins/nebula-core/includes/classes/PostTypes/AbstractPostType.php @@ -2,12 +2,12 @@ /** * AbstractPostType * - * @package Eighteen73Core + * @package NebulaCore */ -namespace Eighteen73\Core\PostTypes; +namespace Eighteen73\Nebula\Core\PostTypes; -use Eighteen73\Core\Singleton; +use Eighteen73\Nebula\Core\Singleton; /** * Abstract class for post types. @@ -16,23 +16,23 @@ * * class Testimonial extends AbstractPostType { * - * public function get_name() { + * public function get_name(): string { * return 'testimonial'; * } * - * public function get_singular_label() { + * public function get_singular_label(): string { * return 'Testimonial'; * } * - * public function get_plural_label() { + * public function get_plural_label(): string { * return 'Testomonials'; * } * - * public function get_menu_icon() { + * public function get_menu_icon(): string { * return 'embed-post'; * } * - * public function can_register() { + * public function can_register(): bool { * return true; * } * } @@ -44,21 +44,21 @@ abstract class AbstractPostType extends Singleton { * * @return string */ - abstract public function get_name(); + abstract public function get_name(): string; /** * Get the singular post type label. * * @return string */ - abstract public function get_singular_label(); + abstract public function get_singular_label(): string; /** * Get the plural post type label. * * @return string */ - abstract public function get_plural_label(); + abstract public function get_plural_label(): string; /** * Get the menu icon for the post type. @@ -69,14 +69,14 @@ abstract public function get_plural_label(); * * @return string */ - abstract public function get_menu_icon(); + abstract public function get_menu_icon(): string; /** * Get the menu position for the post type. * * @return int|null */ - public function get_menu_position() { + public function get_menu_position(): ?int { return null; } @@ -85,7 +85,7 @@ public function get_menu_position() { * * @return bool */ - public function is_hierarchical() { + public function is_hierarchical(): bool { return false; } @@ -94,7 +94,7 @@ public function is_hierarchical() { * * @return array */ - public function get_editor_supports() { + public function get_editor_supports(): array { $supports = [ 'title', 'editor', @@ -112,7 +112,7 @@ public function get_editor_supports() { * * @return array */ - public function get_options() { + public function get_options(): array { return [ 'labels' => $this->get_labels(), 'public' => true, @@ -133,7 +133,7 @@ public function get_options() { * * @return array */ - public function get_labels() { + public function get_labels(): array { $plural_label = $this->get_plural_label(); $singular_label = $this->get_singular_label(); @@ -143,29 +143,29 @@ public function get_labels() { // Already translated via get_plural_label(). 'singular_name' => $singular_label, // Already translated via get_singular_label(). - 'add_new' => sprintf( __( 'Add New %s', 'eighteen73-core' ), $singular_label ), - 'add_new_item' => sprintf( __( 'Add New %s', 'eighteen73-core' ), $singular_label ), - 'edit_item' => sprintf( __( 'Edit %s', 'eighteen73-core' ), $singular_label ), - 'new_item' => sprintf( __( 'New %s', 'eighteen73-core' ), $singular_label ), - 'view_item' => sprintf( __( 'View %s', 'eighteen73-core' ), $singular_label ), - 'view_items' => sprintf( __( 'View %s', 'eighteen73-core' ), $plural_label ), - 'search_items' => sprintf( __( 'Search %s', 'eighteen73-core' ), $plural_label ), - 'not_found' => sprintf( __( 'No %s found.', 'eighteen73-core' ), strtolower( $plural_label ) ), - 'not_found_in_trash' => sprintf( __( 'No %s found in Trash.', 'eighteen73-core' ), strtolower( $plural_label ) ), - 'parent_item_colon' => sprintf( __( 'Parent %s:', 'eighteen73-core' ), $plural_label ), - 'all_items' => sprintf( __( 'All %s', 'eighteen73-core' ), $plural_label ), - 'archives' => sprintf( __( '%s Archives', 'eighteen73-core' ), $singular_label ), - 'attributes' => sprintf( __( '%s Attributes', 'eighteen73-core' ), $singular_label ), - 'insert_into_item' => sprintf( __( 'Insert into %s', 'eighteen73-core' ), strtolower( $singular_label ) ), - 'uploaded_to_this_item' => sprintf( __( 'Uploaded to this %s', 'eighteen73-core' ), strtolower( $singular_label ) ), - 'filter_items_list' => sprintf( __( 'Filter %s list', 'eighteen73-core' ), strtolower( $plural_label ) ), - 'items_list_navigation' => sprintf( __( '%s list navigation', 'eighteen73-core' ), $plural_label ), - 'items_list' => sprintf( __( '%s list', 'eighteen73-core' ), $plural_label ), - 'item_published' => sprintf( __( '%s published.', 'eighteen73-core' ), $singular_label ), - 'item_published_privately' => sprintf( __( '%s published privately.', 'eighteen73-core' ), $singular_label ), - 'item_reverted_to_draft' => sprintf( __( '%s reverted to draft.', 'eighteen73-core' ), $singular_label ), - 'item_scheduled' => sprintf( __( '%s scheduled.', 'eighteen73-core' ), $singular_label ), - 'item_updated' => sprintf( __( '%s updated.', 'eighteen73-core' ), $singular_label ), + 'add_new' => sprintf( __( 'Add New %s', 'nebula-core' ), $singular_label ), + 'add_new_item' => sprintf( __( 'Add New %s', 'nebula-core' ), $singular_label ), + 'edit_item' => sprintf( __( 'Edit %s', 'nebula-core' ), $singular_label ), + 'new_item' => sprintf( __( 'New %s', 'nebula-core' ), $singular_label ), + 'view_item' => sprintf( __( 'View %s', 'nebula-core' ), $singular_label ), + 'view_items' => sprintf( __( 'View %s', 'nebula-core' ), $plural_label ), + 'search_items' => sprintf( __( 'Search %s', 'nebula-core' ), $plural_label ), + 'not_found' => sprintf( __( 'No %s found.', 'nebula-core' ), strtolower( $plural_label ) ), + 'not_found_in_trash' => sprintf( __( 'No %s found in Trash.', 'nebula-core' ), strtolower( $plural_label ) ), + 'parent_item_colon' => sprintf( __( 'Parent %s:', 'nebula-core' ), $plural_label ), + 'all_items' => sprintf( __( 'All %s', 'nebula-core' ), $plural_label ), + 'archives' => sprintf( __( '%s Archives', 'nebula-core' ), $singular_label ), + 'attributes' => sprintf( __( '%s Attributes', 'nebula-core' ), $singular_label ), + 'insert_into_item' => sprintf( __( 'Insert into %s', 'nebula-core' ), strtolower( $singular_label ) ), + 'uploaded_to_this_item' => sprintf( __( 'Uploaded to this %s', 'nebula-core' ), strtolower( $singular_label ) ), + 'filter_items_list' => sprintf( __( 'Filter %s list', 'nebula-core' ), strtolower( $plural_label ) ), + 'items_list_navigation' => sprintf( __( '%s list navigation', 'nebula-core' ), $plural_label ), + 'items_list' => sprintf( __( '%s list', 'nebula-core' ), $plural_label ), + 'item_published' => sprintf( __( '%s published.', 'nebula-core' ), $singular_label ), + 'item_published_privately' => sprintf( __( '%s published privately.', 'nebula-core' ), $singular_label ), + 'item_reverted_to_draft' => sprintf( __( '%s reverted to draft.', 'nebula-core' ), $singular_label ), + 'item_scheduled' => sprintf( __( '%s scheduled.', 'nebula-core' ), $singular_label ), + 'item_updated' => sprintf( __( '%s updated.', 'nebula-core' ), $singular_label ), 'menu_name' => $plural_label, 'name_admin_bar' => $singular_label, ]; @@ -178,9 +178,9 @@ public function get_labels() { * Registers a post type and associates its taxonomies. * * @uses $this->get_name() to get the post's type name. - * @return Bool Whether this theme has supports for this post type. + * @return Bool Whether this project has supports for this post type. */ - public function register() { + public function register(): bool { $this->register_post_type(); $this->register_taxonomies(); @@ -194,7 +194,7 @@ public function register() { * * @return void */ - public function register_post_type() { + public function register_post_type(): void { register_post_type( $this->get_name(), $this->get_options() @@ -206,7 +206,7 @@ public function register_post_type() { * * @return void */ - public function register_taxonomies() { + public function register_taxonomies(): void { $taxonomies = $this->get_supported_taxonomies(); $object_type = $this->get_name(); @@ -227,7 +227,7 @@ public function register_taxonomies() { * * @return array */ - public function get_supported_taxonomies() { + public function get_supported_taxonomies(): array { return []; } @@ -236,7 +236,7 @@ public function get_supported_taxonomies() { * * @return void */ - public function after_register() { + public function after_register(): void { // Do nothing. } } diff --git a/web/app/mu-plugins/eighteen73-core/includes/classes/Singleton.php b/web/app/mu-plugins/nebula-core/includes/classes/Singleton.php similarity index 90% rename from web/app/mu-plugins/eighteen73-core/includes/classes/Singleton.php rename to web/app/mu-plugins/nebula-core/includes/classes/Singleton.php index dc54ea8..e0ce4db 100644 --- a/web/app/mu-plugins/eighteen73-core/includes/classes/Singleton.php +++ b/web/app/mu-plugins/nebula-core/includes/classes/Singleton.php @@ -2,10 +2,10 @@ /** * Singleton trait * - * @package Eighteen73Core + * @package NebulaCore */ -namespace Eighteen73\Core; +namespace Eighteen73\Nebula\Core; trait Singleton { diff --git a/web/app/mu-plugins/eighteen73-core/includes/classes/Taxonomies/AbstractPostType.php b/web/app/mu-plugins/nebula-core/includes/classes/Taxonomies/AbstractTaxonomy.php similarity index 59% rename from web/app/mu-plugins/eighteen73-core/includes/classes/Taxonomies/AbstractPostType.php rename to web/app/mu-plugins/nebula-core/includes/classes/Taxonomies/AbstractTaxonomy.php index c522e00..7e209ab 100644 --- a/web/app/mu-plugins/eighteen73-core/includes/classes/Taxonomies/AbstractPostType.php +++ b/web/app/mu-plugins/nebula-core/includes/classes/Taxonomies/AbstractTaxonomy.php @@ -2,12 +2,12 @@ /** * AbstractTaxonomy * - * @package Eighteen73Core + * @package NebulaCore */ -namespace Eighteen73\Core\Taxonomies; +namespace Eighteen73\Nebula\Core\Taxonomies; -use Eighteen73\Core\Singleton; +use Eighteen73\Nebula\Core\Singleton; /** * Abstract Base Class for Taxonomies. @@ -16,19 +16,19 @@ * * class TestimonialType extends AbstractTaxonomy { * - * public function get_name() { + * public function get_name(): string { * return 'testimonial_type'; * } * - * public function get_singular_label() { + * public function get_singular_label(): string { * return 'Testimonial Type'; * } * - * public function get_plural_label() { + * public function get_plural_label(): string { * return 'Testimonial Types'; * } * - * public function can_register() { + * public function can_register(): bool { * return true; * } * } @@ -40,28 +40,28 @@ abstract class AbstractTaxonomy extends Singleton { * * @return string */ - abstract public function get_name(); + abstract public function get_name(): string; /** * Get the singular taxonomy label. * * @return string */ - abstract public function get_singular_label(); + abstract public function get_singular_label(): string; /** * Get the plural taxonomy label. * * @return string */ - abstract public function get_plural_label(); + abstract public function get_plural_label(): string; /** * Is the taxonomy hierarchical? * * @return bool */ - public function is_hierarchical() { + public function is_hierarchical(): bool { return false; } @@ -71,7 +71,7 @@ public function is_hierarchical() { * @uses $this->get_name() to get the taxonomy's slug. * @return bool */ - public function register() { + public function register(): bool { \register_taxonomy( $this->get_name(), $this->get_post_types(), @@ -88,7 +88,7 @@ public function register() { * * @return array */ - public function get_options() { + public function get_options(): array { return [ 'labels' => $this->get_labels(), 'hierarchical' => $this->is_hierarchical(), @@ -105,7 +105,7 @@ public function get_options() { * * @return array */ - public function get_labels() { + public function get_labels(): array { $plural_label = $this->get_plural_label(); $singular_label = $this->get_singular_label(); @@ -113,19 +113,19 @@ public function get_labels() { $labels = [ 'name' => $plural_label, // Already translated via get_plural_label(). 'singular_name' => $singular_label, // Already translated via get_singular_label(). - 'search_items' => sprintf( __( 'Search %s', 'eighteen73-core' ), $plural_label ), - 'popular_items' => sprintf( __( 'Popular %s', 'eighteen73-core' ), $plural_label ), - 'all_items' => sprintf( __( 'All %s', 'eighteen73-core' ), $plural_label ), - 'edit_item' => sprintf( __( 'Edit %s', 'eighteen73-core' ), $singular_label ), - 'update_item' => sprintf( __( 'Update %s', 'eighteen73-core' ), $singular_label ), - 'add_new_item' => sprintf( __( 'Add %s', 'eighteen73-core' ), $singular_label ), - 'new_item_name' => sprintf( __( 'New %s Name', 'eighteen73-core' ), $singular_label ), - 'separate_items_with_commas' => sprintf( __( 'Separate %s with commas', 'eighteen73-core' ), strtolower( $plural_label ) ), - 'add_or_remove_items' => sprintf( __( 'Add or remove %s', 'eighteen73-core' ), strtolower( $plural_label ) ), - 'choose_from_most_used' => sprintf( __( 'Choose from the most used %s', 'eighteen73-core' ), strtolower( $plural_label ) ), - 'not_found' => sprintf( __( 'No %s found.', 'eighteen73-core' ), strtolower( $plural_label ) ), - 'not_found_in_trash' => sprintf( __( 'No %s found in Trash.', 'eighteen73-core' ), strtolower( $plural_label ) ), - 'view_item' => sprintf( __( 'View %s', 'eighteen73-core' ), $singular_label ), + 'search_items' => sprintf( __( 'Search %s', 'nebula-core' ), $plural_label ), + 'popular_items' => sprintf( __( 'Popular %s', 'nebula-core' ), $plural_label ), + 'all_items' => sprintf( __( 'All %s', 'nebula-core' ), $plural_label ), + 'edit_item' => sprintf( __( 'Edit %s', 'nebula-core' ), $singular_label ), + 'update_item' => sprintf( __( 'Update %s', 'nebula-core' ), $singular_label ), + 'add_new_item' => sprintf( __( 'Add %s', 'nebula-core' ), $singular_label ), + 'new_item_name' => sprintf( __( 'New %s Name', 'nebula-core' ), $singular_label ), + 'separate_items_with_commas' => sprintf( __( 'Separate %s with commas', 'nebula-core' ), strtolower( $plural_label ) ), + 'add_or_remove_items' => sprintf( __( 'Add or remove %s', 'nebula-core' ), strtolower( $plural_label ) ), + 'choose_from_most_used' => sprintf( __( 'Choose from the most used %s', 'nebula-core' ), strtolower( $plural_label ) ), + 'not_found' => sprintf( __( 'No %s found.', 'nebula-core' ), strtolower( $plural_label ) ), + 'not_found_in_trash' => sprintf( __( 'No %s found in Trash.', 'nebula-core' ), strtolower( $plural_label ) ), + 'view_item' => sprintf( __( 'View %s', 'nebula-core' ), $singular_label ), ]; // phpcs:enable @@ -138,7 +138,7 @@ public function get_labels() { * * @return array|null */ - public function get_post_types() { + public function get_post_types(): ?array { return null; } @@ -147,7 +147,7 @@ public function get_post_types() { * * @return void */ - public function after_register() { + public function after_register(): void { // Do nothing. } } diff --git a/web/app/mu-plugins/eighteen73-core/eighteen73-core.php b/web/app/mu-plugins/nebula-core/nebula-core.php similarity index 50% rename from web/app/mu-plugins/eighteen73-core/eighteen73-core.php rename to web/app/mu-plugins/nebula-core/nebula-core.php index 4028aa2..0b46447 100644 --- a/web/app/mu-plugins/eighteen73-core/eighteen73-core.php +++ b/web/app/mu-plugins/nebula-core/nebula-core.php @@ -1,27 +1,27 @@ - Eighteen73 Core + Nebula Core .