Skip to content

Conversation

@AronNovak
Copy link
Member

No description provided.

AronNovak and others added 2 commits October 10, 2025 06:11
…natives and allow execution calls in robo-components.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
$this->taskReplaceInFile('.bootstrap/.ddev/config.yaml')
->from('8880')
->to((string) rand(6000, 8000))
->to((string) random_int(6000, 8000))
Copy link
Member

Choose a reason for hiding this comment

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

What's the benefit of this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Here, it would be fine with rand. This is just a demonstration of a security-focused ruleset for phpstan. If we stick to random_int, we can be sure the numbers are not predictable. At some places, it matters a lot.

Copy link
Member Author

Choose a reason for hiding this comment

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

See Slack devstuff for more context.

Copy link
Collaborator

@mariano-dagostino mariano-dagostino left a comment

Choose a reason for hiding this comment

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

phpstan.neon Outdated
- RoboFile.php
-
function: 'popen()'
message: 'use Symfony Process instead'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we link to the component page? https://symfony.com/doc/current/components/process.html

Copy link
Member Author

Choose a reason for hiding this comment

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

added

@AronNovak
Copy link
Member Author

@mariano-dagostino I added some more rules and adapted the custom code, good point!

function: 'print_r()'
message: 'use some logger instead'
allowParamsAnywhere:
2: true
Copy link
Member

Choose a reason for hiding this comment

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

what is 2 in this context?

Copy link
Member Author

Choose a reason for hiding this comment

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

✅ Allowed: print_r($var, true) - returns output as string (for logging)

❌ Disallowed: print_r($var) or print_r($var, false) - outputs directly to screen

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.

4 participants