Skip to content

Updating project methods to follow core conventions#174

Merged
armanist merged 2 commits intosoftberg:masterfrom
armanist:master
Apr 1, 2026
Merged

Updating project methods to follow core conventions#174
armanist merged 2 commits intosoftberg:masterfrom
armanist:master

Conversation

@armanist
Copy link
Copy Markdown
Member

@armanist armanist commented Mar 31, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Corrected the user delete command's description text.
  • Refactor

    • Improved internal code structure and consistency across command execution methods.
    • Enhanced exception documentation for better error handling clarity.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

📝 Walkthrough

Walkthrough

The pull request migrates the application type selection from class constants to an enum, replacing App::WEB and App::CONSOLE with AppType::WEB and AppType::CONSOLE across multiple files. Additionally, command exec() methods receive explicit void return types, and exception documentation is consolidated into unified union-style annotations. A minor description correction is made to UserDeleteCommand.

Changes

Cohort / File(s) Summary
App Type Enum Migration
public/index.php, qt, tests/Feature/AppTestCase.php, tests/bootstrap.php
Updated imports from Quantum\App\App to Quantum\App\Enums\AppType and replaced App::WEB/App::CONSOLE constants with AppType::WEB/AppType::CONSOLE enum values.
Command Return Type Declarations
shared/Commands/CommentCreateCommand.php, shared/Commands/CommentDeleteCommand.php, shared/Commands/DemoCommand.php, shared/Commands/PostCreateCommand.php, shared/Commands/PostDeleteCommand.php, shared/Commands/PostShowCommand.php, shared/Commands/PostUpdateCommand.php, shared/Commands/UserCreateCommand.php, shared/Commands/UserDeleteCommand.php, shared/Commands/UserShowCommand.php
Added explicit : void return type to exec() method signatures across all command classes.
Exception Documentation Updates
shared/Commands/CommandValidationTrait.php, shared/Commands/CommentCreateCommand.php, shared/Commands/CommentDeleteCommand.php, shared/Commands/PostCreateCommand.php, shared/Commands/PostDeleteCommand.php, shared/Commands/UserCreateCommand.php, shared/Commands/UserDeleteCommand.php
Consolidated @throws docblock annotations from individual tags into unified union-style declarations (e.g., DiException|ServiceException|BaseException|ReflectionException).
Minor Bug Fix & Help Text
shared/Commands/UserDeleteCommand.php, shared/Commands/PostUpdateCommand.php
Fixed UserDeleteCommand description from "clears the entire posts table" to "clears the entire users table"; removed -a [Author] option from PostUpdateCommand help text.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Suggested labels

help wanted

Suggested reviewers

  • Arno2005
  • Vahram1995
  • andrey-smaelov

Poem

🐰 From class constants, we hop to enums so bright,
Return types declared, the code feels just right,
Exceptions consolidated, docs unified and clear,
Quantum leaps forward—refactoring cheer! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the PR: updating command methods with explicit return types and exception documentation to follow project conventions.
Docstring Coverage ✅ Passed Docstring coverage is 84.62% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
shared/Commands/CommandValidationTrait.php (1)

60-68: Remove duplicated docblock above firstError().

Line 60–63 and Line 65–68 create two consecutive docblocks for the same method. Keep a single block to avoid noisy/misread API docs.

Suggested cleanup
-    /**
-     * Gets the first validation error
-     * `@return` string|null
-     */
-
     /**
+     * Gets the first validation error
      * `@return` string|null
      * `@throws` ConfigException|DiException|LangException|ReflectionException
      */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shared/Commands/CommandValidationTrait.php` around lines 60 - 68, There are
two consecutive docblocks for the same method firstError() causing duplicated
documentation; remove the redundant/empty docblock (the simple "/** Gets the
first validation error */" block) and keep the single comprehensive docblock
that includes the return type and `@throws` annotations so the method firstError()
has only one accurate PHPDoc entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@shared/Commands/UserDeleteCommand.php`:
- Around line 72-74: The exec method in UserDeleteCommand declares a return type
`: void` which conflicts with the base QtCommand::exec() signature; remove the
`: void` from the UserDeleteCommand::exec() declaration so it reads `public
function exec()` to exactly match the parent signature (ensure no other
subclasses keep a differing return type and update the method declaration in the
UserDeleteCommand class accordingly).

---

Nitpick comments:
In `@shared/Commands/CommandValidationTrait.php`:
- Around line 60-68: There are two consecutive docblocks for the same method
firstError() causing duplicated documentation; remove the redundant/empty
docblock (the simple "/** Gets the first validation error */" block) and keep
the single comprehensive docblock that includes the return type and `@throws`
annotations so the method firstError() has only one accurate PHPDoc entry.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c2bc7029-35fa-4c71-ac41-254c313a7063

📥 Commits

Reviewing files that changed from the base of the PR and between 432c5d4 and ab5dba2.

📒 Files selected for processing (15)
  • public/index.php
  • qt
  • shared/Commands/CommandValidationTrait.php
  • shared/Commands/CommentCreateCommand.php
  • shared/Commands/CommentDeleteCommand.php
  • shared/Commands/DemoCommand.php
  • shared/Commands/PostCreateCommand.php
  • shared/Commands/PostDeleteCommand.php
  • shared/Commands/PostShowCommand.php
  • shared/Commands/PostUpdateCommand.php
  • shared/Commands/UserCreateCommand.php
  • shared/Commands/UserDeleteCommand.php
  • shared/Commands/UserShowCommand.php
  • tests/Feature/AppTestCase.php
  • tests/bootstrap.php

@armanist armanist merged commit 7d527a5 into softberg:master Apr 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants