Showing 34 of 34 total issues
The parameter $available_algorithms is not named in camelCase. Open
Open
public function __construct(
public readonly string $value,
?array $available_algorithms = null,
) {
if (!in_array($this->value, $available_algorithms ?? hash_hmac_algos())) {
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $include_original is not named in camelCase. Open
Open
public function generate(int $amount, bool $include_original = false): array;
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $include_original is not named in camelCase. Open
Open
public function generate(int $amount, bool $include_original = false): array
{
$serverSeed = $this->serverSeed;
$results = $include_original
? [new Result(
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The method generate has a boolean flag argument $include_original, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public function generate(int $amount, bool $include_original = false): array;
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method generate has a boolean flag argument $include_original, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public function generate(int $amount, bool $include_original = false): array
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Line exceeds 120 characters; contains 197 characters Open
Open
<option <?php echo $available_algorithm === $algorithm->value ? 'selected' : '' ?> value="<?php echo $available_algorithm ?>"><?php echo $available_algorithm ?></option>
- Exclude checks
Line exceeds 120 characters; contains 214 characters Open
Open
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
- Exclude checks
Line exceeds 120 characters; contains 155 characters Open
Open
<input class="form-control" id="server" autocomplete="off" type="text" name="server" value="<?php echo $serverSeed->value ?>" required>
- Exclude checks
Line exceeds 120 characters; contains 144 characters Open
Open
<input class="form-check-input" type="checkbox" id="prepend" name="prepend" <?php echo $prepend === true ? 'checked' : '' ?> >
- Exclude checks
Line exceeds 120 characters; contains 154 characters Open
Open
<input class="form-control" id="amount" autocomplete="off" type="number" min="0" name="amount" value="<?php echo $amount ?>" required>
- Exclude checks
Line exceeds 120 characters; contains 155 characters Open
Open
<input class="form-control" id="client" autocomplete="off" type="text" name="client" value="<?php echo $clientSeed->value ?>" required>
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly SeedInterface $clientSeed,
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
<?php foreach ($results as $result): ?>
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
<?php foreach (hash_hmac_algos() as $available_algorithm): ?>
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly string $value,
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly SeedInterface $serverSeed,
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly AlgorithmInterface $algorithm
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly AlgorithmInterface $algorithm,
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly string $hash,
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly string $value,
- Exclude checks