Skip to content

feat: Add method to manage withRouting options#61

Open
artengin wants to merge 86 commits intomasterfrom
create-addRoutingOption-method
Open

feat: Add method to manage withRouting options#61
artengin wants to merge 86 commits intomasterfrom
create-addRoutingOption-method

Conversation

@artengin
Copy link
Copy Markdown
Contributor

@artengin artengin commented Apr 10, 2026

refs: #62

AZabolotnikov and others added 30 commits January 22, 2026 16:15
# Conflicts:
#	src/Visitors/PropertyVisitors/AbstractPropertyVisitor.php
…rate-withSchedule

# Conflicts:
#	src/Visitors/AppBootstrapVisitors/AbstractAppBootstrapVisitor.php
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/Traits/PreformattedNodesHelperTrait.php Outdated
Comment on lines +175 to +176
&& $current->class instanceof Name
&& $current->class->toString() === 'Application'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Any real Laravel bootstrap/app.php uses the short form Application::configure(...) with a standard import. This edge case doesn't exist in practice.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

if ($this->isParentNode($node) && $this->shouldInsertNode($node)) {
return $this->insertNode($node);

P2 Badge Scope parent-call mutation to Application::configure chain

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".

Comment thread src/Builders/AppBootstrapBuilder.php
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/Builders/AppBootstrapBuilder.php
Comment thread src/Traits/PreformattedNodesHelperTrait.php
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

if ($this->isParentNode($node) && $this->shouldInsertNode($node)) {
return $this->insertNode($node);

P1 Badge Restrict parent-method edits to Application::configure chain

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".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/ValueOptions/ScheduleOption.php
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/Visitors/AppBootstrapVisitors/AbstractAppBootstrapVisitor.php
public string $method,
public array $arguments = [],
) {
$this->validateMethod($this->method);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/Visitors/AppBootstrapVisitors/AbstractAppBootstrapVisitor.php Outdated
@artengin
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/Support/ValueNodeFactory.php
Comment thread src/Visitors/AppBootstrapVisitors/AbstractAppBootstrapVisitor.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants