Skip to content

Conversation

@rullzer
Copy link
Member

@rullzer rullzer commented Aug 12, 2019

Cleans it up a bit.

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

So clean 🧐

public function validate(string $password): bool {
$enforceNonCommonPassword = $this->config->getEnforceNonCommonPassword();
if($enforceNonCommonPassword) {
$passwordFile = __DIR__ . '/../../lists/list-'.strlen($password).'.php';
Copy link
Member

Choose a reason for hiding this comment

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

move the $passwordFile assigment one line up and combine the first two if's for better readibility

['banana', false, true],
['bananabananabananabanana', false, true],
['banana', true, false],
['bananabananabananabanana', true, true],
Copy link
Member

Choose a reason for hiding this comment

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

😆

}

$this->assertTrue($this->validator->validate($password));
$this->assertTrue(true);
Copy link
Member

Choose a reason for hiding this comment

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

Really? What if if fails?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well it either throws an exception or not.
The assert is there to ensure phpunit is quite about risky tests

Copy link
Member

Choose a reason for hiding this comment

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

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer rullzer force-pushed the enh/split_into_validators branch from 4000ea6 to 776583e Compare August 27, 2019 12:52
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer rullzer force-pushed the enh/split_into_validators branch from 776583e to 7d92b2c Compare August 27, 2019 13:02
@rullzer rullzer merged commit d805762 into master Aug 27, 2019
@rullzer rullzer deleted the enh/split_into_validators branch August 27, 2019 13:17
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