Branch Coverage

blib/lib/PHP/Functions/Password.pm
Criterion Covered Total %
branch 83 132 62.8


line true false branch
161 2 0 if ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
185 5 29 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
187 18 16 if ($crypted =~ /$RE_BCRYPT_STRING/) { }
10 6 elsif ($crypted =~ /$RE_ARGON2_STRING/) { }
202 12 6 wantarray ? :
227 8 2 wantarray ? :
236 4 2 wantarray ? :
255 41 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
258 0 41 @_ && ref $_[0] ? :
259 35 6 if ($algo == 1) { }
6 0 elsif ($algo == 3 or $algo == 2) { }
261 32 3 if (defined $options{'salt'} and length $options{'salt'}) { }
262 0 32 unless ($options{'salt'} =~ /^$RE_BCRYPT_SALT$/)
275 0 6 unless ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
276 0 0 $algo == 3 ? :
286 4 2 if utf8::is_utf8($password)
289 3 3 if ($algo == 3) { }
311 12 12 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
314 24 0 @_ && ref $_[0] ? :
316 2 22 unless ($info{'algo'} == $algo)
317 0 2 if $options{'debug'}
320 12 10 if ($algo == 1) { }
8 2 elsif ($algo == 3 or $algo == 2) { }
321 4 8 if ($info{'algoSig'} ne $SIG_BCRYPT)
322 0 4 if $options{'debug'}
326 4 4 unless (defined $info{'options'}{'cost'} and $info{'options'}{'cost'} == $cost)
327 0 4 if $options{'debug'}
333 2 6 if ($info{'options'}{'memory_cost'} != $memory_cost)
334 0 2 if $options{'debug'}
338 2 4 if ($info{'options'}{'time_cost'} != $time_cost)
339 0 2 if $options{'debug'}
343 2 2 if ($info{'options'}{'threads'} != $threads)
344 0 2 if $options{'debug'}
347 0 2 defined $options{'salt'} && length $options{'salt'} ? :
350 2 0 if ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
351 0 2 if ('version'->parse($Crypt::Argon2::VERSION) < 'version'->parse('0.008')) { }
352 0 0 if ($info{'version'} < 19)
353 0 0 if $options{'debug'}
358 0 0 unless (defined $salt)
359 0 0 if $options{'debug'}
363 0 0 if ($wanted_salt_length != $actual_salt_length)
364 0 0 if $options{'debug'}
370 0 0 if ($wanted_tag_length != $actual_tag_length)
371 0 0 if $options{'debug'}
381 0 2 if $options{'debug'}
396 25 25 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
398 32 18 if ($crypted =~ /$RE_BCRYPT_STRING/) { }
16 2 elsif ($crypted =~ /$RE_ARGON2_STRING/) { }
407 20 12 if ($crypted eq $new_crypt)
414 0 16 unless ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
421 10 6 if utf8::is_utf8($password)
424 8 8 if ($algo == 3) { }
451 1 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
466 5 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
482 41 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
484 0 41 @_ && ref $_[0] ? :
500 12 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
514 25 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
528 35 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
530 0 35 unless ($settings =~ qr/^ \$ ($RE_BCRYPT_ALGO) \$ ($RE_BCRYPT_COST) \$ ($RE_BCRYPT_SALT) /x)
558 35 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
560 35 0 if ($settings->{'key_nul'} or $password eq "")
565 24 11 if utf8::is_utf8($password)
591 35 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
593 0 35 unless ($text =~ m[\A(?>(?:[./A-Za-z0-9]{4})*)(?:|[./A-Za-z0-9]{2}[.CGKOSWaeimquy26]|[./A-Za-z0-9][.Oeu])\z])
607 38 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :