Skip to content

Comments

Code improvements#8

Merged
sstok merged 1 commit intorollerworks:mainfrom
gharlan:code-improvement
Feb 3, 2026
Merged

Code improvements#8
sstok merged 1 commit intorollerworks:mainfrom
gharlan:code-improvement

Conversation

@gharlan
Copy link
Contributor

@gharlan gharlan commented Feb 2, 2026

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets
License MIT

}

if (! \is_scalar($value) && ! (\is_object($value) && method_exists($value, '__toString'))) {
if (! \is_scalar($value) && ! $value instanceof \Stringable) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

PHP 8 implicitly implements Stringable for all classes with __toString method.

$passwordFile = __DIR__ . '/../../Resources/common_lists/list-' . mb_strlen($value) . '.php';

if (! file_exists($passwordFile)) {
if (! is_file($passwordFile)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

is_file is faster because of caching.

@sstok sstok merged commit e615780 into rollerworks:main Feb 3, 2026
0 of 5 checks passed
@sstok
Copy link
Member

sstok commented Feb 3, 2026

Thank you @gharlan

@sstok
Copy link
Member

sstok commented Feb 3, 2026

Workflow failures are unrelated.

@gharlan gharlan deleted the code-improvement branch February 3, 2026 11:29
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.

2 participants