feat: Add method to manage withRouting options#61
Conversation
# Conflicts: # src/Visitors/PropertyVisitors/AbstractPropertyVisitor.php
…rate-withSchedule
…rate-withSchedule # Conflicts: # src/Visitors/AppBootstrapVisitors/AbstractAppBootstrapVisitor.php
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0928d8983
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| && $current->class instanceof Name | ||
| && $current->class->toString() === 'Application' |
There was a problem hiding this comment.
Match Application::configure chains beyond bare class name
The bootstrap-chain check only accepts Name nodes whose text is exactly Application, so valid bootstraps like \Illuminate\Foundation\Application::configure(...) or aliased imports are treated as non-target chains and never updated. In those files, addExceptionsRender, addScheduleCommand, and addRoutingOption silently skip modifications even though the chain is the correct Laravel bootstrap entrypoint.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Any real Laravel bootstrap/app.php uses the short form Application::configure(...) with a standard import. This edge case doesn't exist in practice.
There was a problem hiding this comment.
💡 Codex Review
After the create-chain guard, the generic parent-method block still mutates any matching method call in the file without verifying it belongs to the Laravel bootstrap chain. This means addRoutingOption()/addScheduleCommand() can rewrite unrelated withRouting/withSchedule calls (for example helper builders instantiated earlier in bootstrap/app.php), producing unintended edits outside the target application builder chain.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6c67d6c8f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
The generic parent-node rewrite path still runs on any method named withExceptions/withSchedule/withRouting, even when that call is not part of an Application::configure(...)->...->create() chain. In bootstrap/app.php files that contain another object with a same-named method (for example helper builders or factories), this visitor will mutate the unrelated call as well, which can silently alter behavior and produce incorrect generated code. Add the same bootstrap-chain guard used in the create branch before calling insertNode() on existing parent calls.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…te-addRoutingOption-method
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e17f0f21d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…te-addRoutingOption-method
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c80678846b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| public string $method, | ||
| public array $arguments = [], | ||
| ) { | ||
| $this->validateMethod($this->method); |
There was a problem hiding this comment.
Validate ScheduleOption argument arity during construction
ScheduleOption currently validates only method names, so options with required parameters can be constructed with empty arguments (e.g., new ScheduleOption('dailyAt') or new ScheduleOption('between')). The generator then emits calls like ->dailyAt() that are syntactically valid but fail with ArgumentCountError when Laravel evaluates the schedule callback. Adding required-parameter validation here would prevent generating broken bootstrap code.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The library is responsible for generating syntactically valid code, not for enforcing Laravel's runtime contracts. Ensuring correct arguments is the caller's responsibility, just as with any code generation tool.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0609ce7fbf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f90a7991f2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
refs: #62