diff --git a/includes/core/classes/class-event-setup.php b/includes/core/classes/class-event-setup.php index 2907ac116..93586a899 100644 --- a/includes/core/classes/class-event-setup.php +++ b/includes/core/classes/class-event-setup.php @@ -96,18 +96,36 @@ public function register_post_type(): void { Event::POST_TYPE, array( 'labels' => array( - 'name' => _x( 'Events', 'Post Type General Name', 'gatherpress' ), - 'singular_name' => _x( 'Event', 'Post Type Singular Name', 'gatherpress' ), - 'menu_name' => __( 'Events', 'gatherpress' ), - 'all_items' => __( 'All Events', 'gatherpress' ), - 'view_item' => __( 'View Event', 'gatherpress' ), - 'add_new_item' => __( 'Add New Event', 'gatherpress' ), - 'add_new' => __( 'Add New', 'gatherpress' ), - 'edit_item' => __( 'Edit Event', 'gatherpress' ), - 'update_item' => __( 'Update Event', 'gatherpress' ), - 'search_items' => __( 'Search Events', 'gatherpress' ), - 'not_found' => __( 'Not Found', 'gatherpress' ), - 'not_found_in_trash' => __( 'Not found in Trash', 'gatherpress' ), + 'name' => _x( 'Events', 'Post Type General Name', 'gatherpress' ), + 'singular_name' => _x( 'Event', 'Post Type Singular Name', 'gatherpress' ), + 'add_new' => __( 'Add New', 'gatherpress' ), + 'add_new_item' => __( 'Add New Event', 'gatherpress' ), + 'edit_item' => __( 'Edit Event', 'gatherpress' ), + 'new_item' => __( 'New Event', 'gatherpress' ), + 'view_item' => __( 'View Event', 'gatherpress' ), + 'view_items' => __( 'View Events', 'gatherpress' ), + 'search_items' => __( 'Search Events', 'gatherpress' ), + 'not_found' => __( 'No Events found.', 'gatherpress' ), + 'not_found_in_trash' => __( 'No Events found in Trash.', 'gatherpress' ), + 'parent_item_colon' => __( 'Parent Events:', 'gatherpress' ), + 'all_items' => __( 'All Events', 'gatherpress' ), + 'archives' => __( 'Event Archives', 'gatherpress' ), + 'attributes' => __( 'Event Attributes', 'gatherpress' ), + 'insert_into_item' => __( 'Insert into Event', 'gatherpress' ), + 'uploaded_to_this_item' => __( 'Uploaded to this Event', 'gatherpress' ), + 'menu_name' => __( 'Events', 'gatherpress' ), + 'filter_items_list' => __( 'Filter Event list', 'gatherpress' ), + 'filter_by_date' => __( 'Filter by date', 'gatherpress' ), + 'update_item' => __( 'Update Event', 'gatherpress' ), // ??? Is not in the docs. + 'items_list_navigation' => __( 'Events list navigation', 'gatherpress' ), + 'items_list' => __( 'Events list', 'gatherpress' ), + 'item_published' => __( 'Event published.', 'gatherpress' ), + 'item_published_privately' => __( 'Event published privately.', 'gatherpress' ), + 'item_reverted_to_draft' => __( 'Event reverted to draft.', 'gatherpress' ), + 'item_scheduled' => __( 'Event scheduled.', 'gatherpress' ), + 'item_updated' => __( 'Event updated.', 'gatherpress' ), + 'item_link' => __( 'Event Link', 'gatherpress' ), + 'item_link_description' => __( 'A link to an event.', 'gatherpress' ), ), 'show_in_rest' => true, 'rest_base' => 'gatherpress_events', diff --git a/includes/core/classes/class-topic.php b/includes/core/classes/class-topic.php index 91fad5a97..76e4cf5d2 100644 --- a/includes/core/classes/class-topic.php +++ b/includes/core/classes/class-topic.php @@ -79,20 +79,31 @@ public function register_taxonomy(): void { Event::POST_TYPE, array( 'labels' => array( - 'name' => _x( 'Topics', 'Taxonomy General Name', 'gatherpress' ), - 'singular_name' => _x( 'Topic', 'Taxonomy Singular Name', 'gatherpress' ), - 'search_items' => __( 'Search Topics', 'gatherpress' ), - 'all_items' => __( 'All Topics', 'gatherpress' ), - 'view_item' => __( 'View Topic', 'gatherpress' ), - 'parent_item' => __( 'Parent Topic', 'gatherpress' ), - 'parent_item_colon' => __( 'Parent Topic:', 'gatherpress' ), - 'edit_item' => __( 'Edit Topic', 'gatherpress' ), - 'update_item' => __( 'Update Topic', 'gatherpress' ), - 'add_new_item' => __( 'Add New Topic', 'gatherpress' ), - 'new_item_name' => __( 'New Topic Name', 'gatherpress' ), - 'not_found' => __( 'No Topics Found', 'gatherpress' ), - 'back_to_items' => __( 'Back to Topics', 'gatherpress' ), - 'menu_name' => __( 'Topics', 'gatherpress' ), + 'name' => _x( 'Topics', 'Taxonomy General Name', 'gatherpress' ), + 'singular_name' => _x( 'Topic', 'Taxonomy Singular Name', 'gatherpress' ), + 'search_items' => __( 'Search Topics', 'gatherpress' ), + 'popular_items' => __( 'Popular Topics', 'gatherpress' ), + 'all_items' => __( 'All Topics', 'gatherpress' ), + 'parent_item' => __( 'Parent Topic', 'gatherpress' ), + 'parent_item_colon' => __( 'Parent Topic:', 'gatherpress' ), + 'edit_item' => __( 'Edit Topic', 'gatherpress' ), + 'view_item' => __( 'View Topic', 'gatherpress' ), + 'update_item' => __( 'Update Topic', 'gatherpress' ), + 'add_new_item' => __( 'Add New Topic', 'gatherpress' ), + 'new_item_name' => __( 'New Topic Name', 'gatherpress' ), + 'separate_items_with_commas' => __( 'Separate topics with commas', 'gatherpress' ), + 'add_or_remove_items' => __( 'Add or remove topics', 'gatherpress' ), + 'choose_from_most_used' => __( 'Choose from the most used topics', 'gatherpress' ), + 'not_found' => __( 'No Topics Found', 'gatherpress' ), + 'no_terms' => __( 'No topics', 'gatherpress' ), + 'filter_by_item' => __( 'Filter by topic', 'gatherpress' ), + 'items_list_navigation' => __( 'Topics list navigation', 'gatherpress' ), + 'items_list' => __( 'Topics list', 'gatherpress' ), + 'back_to_items' => __( 'Back to Topics', 'gatherpress' ), + 'item_link' => _x( 'Topic Link', 'navigation link block title', 'gatherpress' ), + 'item_link_description' => _x( 'A link to a topic.', 'navigation link block description', 'gatherpress' ), + 'menu_name' => __( 'Topics', 'gatherpress' ), + ), 'hierarchical' => true, 'public' => true, diff --git a/includes/core/classes/class-venue.php b/includes/core/classes/class-venue.php index db7c0b119..bfa3775aa 100644 --- a/includes/core/classes/class-venue.php +++ b/includes/core/classes/class-venue.php @@ -104,18 +104,35 @@ public function register_post_type(): void { self::POST_TYPE, array( 'labels' => array( - 'name' => _x( 'Venues', 'Post Type General Name', 'gatherpress' ), - 'singular_name' => _x( 'Venue', 'Post Type Singular Name', 'gatherpress' ), - 'menu_name' => __( 'Venues', 'gatherpress' ), - 'all_items' => __( 'Venues', 'gatherpress' ), - 'view_item' => __( 'View Venue', 'gatherpress' ), - 'add_new_item' => __( 'Add New Venue', 'gatherpress' ), - 'add_new' => __( 'Add New', 'gatherpress' ), - 'edit_item' => __( 'Edit Venue', 'gatherpress' ), - 'update_item' => __( 'Update Venue', 'gatherpress' ), - 'search_items' => __( 'Search Venues', 'gatherpress' ), - 'not_found' => __( 'Not Found', 'gatherpress' ), - 'not_found_in_trash' => __( 'Not found in Trash', 'gatherpress' ), + 'name' => _x( 'Venues', 'Post Type General Name', 'gatherpress' ), + 'singular_name' => _x( 'Venue', 'Post Type Singular Name', 'gatherpress' ), + 'add_new' => __( 'Add New', 'gatherpress' ), + 'add_new_item' => __( 'Add New Venue', 'gatherpress' ), + 'edit_item' => __( 'Edit Venue', 'gatherpress' ), + 'new_item' => __( 'New Venue', 'gatherpress' ), + 'view_item' => __( 'View Venue', 'gatherpress' ), + 'view_items' => __( 'View Venues', 'gatherpress' ), + 'search_items' => __( 'Search Venues', 'gatherpress' ), + 'not_found' => __( 'No Venues found.', 'gatherpress' ), + 'not_found_in_trash' => __( 'No Venues found in Trash.', 'gatherpress' ), + 'parent_item_colon' => __( 'Parent Venues:', 'gatherpress' ), + 'all_items' => __( 'Venues', 'gatherpress' ), + 'archives' => __( 'Venue Archives', 'gatherpress' ), + 'attributes' => __( 'Venue Attributes', 'gatherpress' ), + 'insert_into_item' => __( 'Insert into Venue', 'gatherpress' ), + 'uploaded_to_this_item' => __( 'Uploaded to this Venue', 'gatherpress' ), + 'filter_items_list' => __( 'Filter Venue list', 'gatherpress' ), + 'filter_by_date' => __( 'Filter by date', 'gatherpress' ), + 'update_item' => __( 'Update Venue', 'gatherpress' ), // ??? Is not in the docs. + 'items_list_navigation' => __( 'Venues list navigation', 'gatherpress' ), + 'items_list' => __( 'Venues list', 'gatherpress' ), + 'item_published' => __( 'Venue published.', 'gatherpress' ), + 'item_published_privately' => __( 'Venue published privately.', 'gatherpress' ), + 'item_reverted_to_draft' => __( 'Venue reverted to draft.', 'gatherpress' ), + 'item_scheduled' => __( 'Venue scheduled.', 'gatherpress' ), + 'item_updated' => __( 'Venue updated.', 'gatherpress' ), + 'item_link' => __( 'Venue Link', 'gatherpress' ), + 'item_link_description' => __( 'A link to a venue.', 'gatherpress' ), ), 'show_in_rest' => true, 'rest_base' => 'gatherpress_venues', diff --git a/phpstan.neon b/phpstan.neon deleted file mode 100644 index a77b8b0d6..000000000 --- a/phpstan.neon +++ /dev/null @@ -1,42 +0,0 @@ -includes: - - vendor/szepeviktor/phpstan-wordpress/extension.neon - # Bleeding edge offers a preview of the next major version. - # When you enable Bleeding edge in your configuration file, you will get new rules, - # behaviour, and bug fixes that will be enabled for everyone later - # when the next PHPStan’s major version is released. - - phar://phpstan.phar/conf/bleedingEdge.neon - -parameters: - bootstrapFiles: - # Constants, functions, etc. used by GatherPress - #- phpstan.stubs -# - vendor/pmc/unit-test/src/classes/autoloader.php -# - vendor/autoload.php -# - gatherpress.php - parallel: - maximumNumberOfProcesses: 1 - processTimeout: 300.0 - - # the analysis level, from 0 (loose) to 9 (strict) - # https://phpstan.org/user-guide/rule-levels - level: 5 - - paths: - - includes/ -# - test/ - -# excludePaths: -# analyse: -# - vendor/ - - ignoreErrors: - - '#^Constant GATHERPRESS_CORE_FILE not found\.$#' - - '#^Constant GATHERPRESS_CORE_PATH not found\.$#' - - '#^Constant GATHERPRESS_CORE_URL not found\.$#' - - '#^Constant GATHERPRESS_REST_NAMESPACE not found\.$#' - - '#^Constant GATHERPRESS_REQUIRES_PHP not found\.$#' - - # core/classes/class-setup.php - # - # A dev-only error, which can occur if the gatherpress is symlinked into a WP instance or called via wp-env or Playground. - - '#^Path in require_once\(\) "\./wp-admin/includes/upgrade\.php" is not a file or it does not exist\.$#' \ No newline at end of file diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 320835a33..603801133 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -23,7 +23,18 @@ parameters: - includes/ ignoreErrors: - # core/classes/class-setup.php + # includes/core/classes/class-setup.php # # A dev-only errors, which can occur if the gatherpress is symlinked into a WP instance or called via wp-env or Playground. - '#^Path in require_once\(\) "\./wp-admin/includes/upgrade\.php" is not a file or it does not exist\.$#' + + # includes/core/classes/endpoints/class-endpoint.php + # + # A known issue, but not a problem. + # This "callable-string" is only used in a debug message and is not run. + - + # I was not able to get the escaping work for the "'", so this matches all argument.type errors in this file, + # which is not nice, but the workaround. + # message: '#Parameter #1 \$function_name of function wp_trigger_error expects callable-string, \'GatherPress\\Core\\Endpoints\\Endpoint\' given.#' + identifier: argument.type + path: includes/core/classes/endpoints/class-endpoint.php \ No newline at end of file