Branch Coverage

blib/lib/PHP/Functions/Password.pm
Criterion Covered Total %
branch 77 126 61.1


line true false branch
131 2 0 if ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
155 5 29 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
157 18 16 if ($crypted =~ m[^\$(2[abxy]?)\$([0-3]\d)\$([./A-Za-z0-9]{22})([./A-Za-z0-9]+)$]) { }
10 6 elsif ($crypted =~ m[^\$(argon2id?)\$v=(\d{1,3})\$m=(\d{1,10}),t=(\d{1,3}),p=(\d{1,3})\$([A-Za-z0-9+/]+)\$([A-Za-z0-9+/]+)$]) { }
172 12 6 wantarray ? :
199 8 2 wantarray ? :
208 4 2 wantarray ? :
227 23 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
230 0 23 @_ && ref $_[0] ? :
231 17 6 if ($algo == 1) { }
6 0 elsif ($algo == 3 or $algo == 2) { }
233 14 3 if (defined $options{'salt'} and length $options{'salt'}) { }
234 0 14 unless ($options{'salt'} =~ m[^[./A-Za-z0-9]{22}$])
247 0 6 unless ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
248 0 0 $algo == 3 ? :
257 3 3 if ($algo == 3) { }
279 12 12 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
282 24 0 @_ && ref $_[0] ? :
284 2 22 unless ($info{'algo'} == $algo)
285 0 2 if $options{'debug'}
288 12 10 if ($algo == 1) { }
8 2 elsif ($algo == 3 or $algo == 2) { }
289 4 8 if ($info{'algoSig'} ne '2y')
290 0 4 if $options{'debug'}
294 4 4 unless (defined $info{'options'}{'cost'} and $info{'options'}{'cost'} == $cost)
295 0 4 if $options{'debug'}
301 2 6 if ($info{'options'}{'memory_cost'} != $memory_cost)
302 0 2 if $options{'debug'}
306 2 4 if ($info{'options'}{'time_cost'} != $time_cost)
307 0 2 if $options{'debug'}
311 2 2 if ($info{'options'}{'threads'} != $threads)
312 0 2 if $options{'debug'}
315 0 2 defined $options{'salt'} && length $options{'salt'} ? :
318 2 0 if ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
319 0 2 if ('version'->parse($Crypt::Argon2::VERSION) < 'version'->parse('0.008')) { }
320 0 0 if ($info{'version'} < 19)
321 0 0 if $options{'debug'}
326 0 0 unless (defined $salt)
327 0 0 if $options{'debug'}
331 0 0 if ($wanted_salt_length != $actual_salt_length)
332 0 0 if $options{'debug'}
338 0 0 if ($wanted_tag_length != $actual_tag_length)
339 0 0 if $options{'debug'}
349 0 2 if $options{'debug'}
364 16 16 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
366 14 18 if ($crypted =~ m[^\$(2[abxy]?)\$([0-3]\d)\$([./A-Za-z0-9]{22})([./A-Za-z0-9]+)$]) { }
16 2 elsif ($crypted =~ m[^\$(argon2id?)\$v=(\d{1,3})\$m=(\d{1,10}),t=(\d{1,3}),p=(\d{1,3})\$([A-Za-z0-9+/]+)\$([A-Za-z0-9+/]+)$]) { }
375 8 6 if ($crypted eq $new_crypt)
382 0 16 unless ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
388 8 8 if ($algo == 3) { }
415 1 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
430 5 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
446 23 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
448 0 23 @_ && ref $_[0] ? :
464 12 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
478 16 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
492 17 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
494 0 17 unless ($settings =~ m[^\$(2[abxy]?)\$([0-3]\d)\$([./A-Za-z0-9]{22})])
515 17 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
517 17 0 if ($settings->{'key_nul'} or $password eq '')
544 17 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
546 0 17 unless ($text =~ m[\A(?>(?:[./A-Za-z0-9]{4})*)(?:|[./A-Za-z0-9]{2}[.CGKOSWaeimquy26]|[./A-Za-z0-9][.Oeu])\z])
560 20 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :