Repository navigation
Dev #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Dev #40
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
e0d2238
Add Laravel 13 to CI workflow matrix
nicobleiler 8298329
chore: update Trivy action to version 0.36.0 in workflow
nicobleiler 2e18b78
chore: remove php82 support from Rector configuration
nicobleiler f84b910
refactor: fully_qualified_strict_types
nicobleiler 78e0f01
chore: rename phpstan configuration file
nicobleiler ea55cb1
chore: update .gitignore to include phpstan.neon
nicobleiler 8142fc3
fix: add missing type annotation for words array in loadBundledEff me…
nicobleiler 1f0a069
fix: add missing type annotations for word list and excluded words in…
nicobleiler baeb52e
feat: add ConfigException for validation and update PassphraseService…
nicobleiler 782815f
feat: enhance ConfigException for better validation messages and upda…
nicobleiler aeb829d
fix: reorder scripts in composer.json for consistency
nicobleiler e054418
feat: add validation tests for non-integer num_words, non-string word…
nicobleiler f5df767
refactor: Refactored cachedEff for better typing
nicobleiler 7fe0dd8
refactor: update PassphraseGenerator singleton to use Application typ…
nicobleiler d23edc7
fix: update PHPStan level from 9 to 10 for improved analysis
nicobleiler 47fc756
fix: remove unused NewlineBetweenClassLikeStmtsRector from configuration
nicobleiler adabe5a
fix: update orchestra/testbench requirement to support version 11.0
nicobleiler 416f6b5
fix: enable platform automerge for dev branch in Renovate configuration
nicobleiler 2af0b76
chore(deps): update dependency ubuntu to v24
renovate[bot] 1ebb0eb
Merge pull request #34 from nicobleiler/renovate/ubuntu-24.x
nicobleiler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,4 +7,5 @@ | |
| *.swo | ||
| .DS_Store | ||
| Thumbs.db | ||
| .phpstan/cache/ | ||
| .phpstan/cache/ | ||
| phpstan.neon | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| parameters: | ||
| level: 8 | ||
| level: 10 | ||
| paths: | ||
| - src | ||
| treatPhpDocTypesAsCertain: false | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace NicoBleiler\Passphrase\Exceptions; | ||
|
|
||
| use RuntimeException; | ||
|
|
||
| class ConfigException extends RuntimeException | ||
| { | ||
| public static function invalidNumWords(): self | ||
| { | ||
| return new self('Number of words config must be an integer'); | ||
| } | ||
|
|
||
| public static function invalidWordSeparator(): self | ||
| { | ||
| return new self('Word separator config must be a string'); | ||
| } | ||
|
|
||
| public static function invalidCapitalize(): self | ||
| { | ||
| return new self('Capitalize config must be a boolean'); | ||
| } | ||
|
|
||
| public static function invalidIncludeNumber(): self | ||
| { | ||
| return new self('Include number config must be a boolean'); | ||
| } | ||
|
|
||
| public static function invalidWordList(): self | ||
| { | ||
| return new self('Word list config must be an array of strings'); | ||
| } | ||
|
|
||
| public static function invalidExcludedWords(): self | ||
| { | ||
| return new self('Excluded words config must be an array of strings'); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validate
word_list/excluded_wordselement types in provider.Line 21 and Line 27 only validate that values are arrays. Arrays containing non-strings currently bypass this layer and fail later with
WordListException, which breaks the new config-validation exception contract.🔧 Proposed fix
if (! is_array($excludedWords)) { throw ConfigException::invalidExcludedWords(); } + foreach ($excludedWords as $excludedWord) { + if (! is_string($excludedWord)) { + throw ConfigException::invalidExcludedWords(); + } + } /** `@var` array<string> $excludedWords */ if ($wordList !== null) { if (! is_array($wordList)) { throw ConfigException::invalidWordList(); } + foreach ($wordList as $configuredWord) { + if (! is_string($configuredWord)) { + throw ConfigException::invalidWordList(); + } + } /** `@var` array<string> $wordList */As per coding guidelines: "Keep error handling explicit with package exception types where appropriate".
🧰 Tools
🪛 PHPMD (2.15.0)
[error] 22-22: Avoid using static access to class '\NicoBleiler\Passphrase\Exceptions\ConfigException' in method 'register'. (undefined)
(StaticAccess)
[error] 28-28: Avoid using static access to class '\NicoBleiler\Passphrase\Exceptions\ConfigException' in method 'register'. (undefined)
(StaticAccess)
🤖 Prompt for AI Agents