| 1 | package Promises::Promise; | ||||||||||||||||||||||||||||
| 2 | 15 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||||||||||||||||||||
| 3 | 15 | $Promises::Promise::VERSION = '1.05'; | |||||||||||||||||||||||||||
| 4 | # ABSTRACT: An implementation of Promises in Perl | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 15 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 15 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 15 | ▶ | use Scalar::Util qw[ blessed ]; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 15 | ▶ | use Carp qw[ confess ]; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 120 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=12.5
Pod
documented
| |||||||||||||||||||||||||||||
| 13 | 120 | my ( $class, $deferred ) = @_; | |||||||||||||||||||||||||||
| 14 | 120 | ▶ | ( blessed $deferred && $deferred->isa('Promises::Deferred') ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($deferred) and $deferred->isa("Promises::Deferred")
MC/DC0%0/2
builtin::blessed($deferred) and $deferred->isa("Promises::Deferred")
builtin::blessed($deferred)
$deferred->isa("Promises::Deferred")
Truth table33%1/3
A and B
A= builtin::blessed($deferred)B= $deferred->isa("Promises::Deferred")
| |||||||||||||||||||||||||||||
| 15 | || confess "You must supply an instance of Promises::Deferred"; | ||||||||||||||||||||||||||||
| 16 | 120 | bless { 'deferred' => $deferred } => $class; | |||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 80 | ▶ | sub then { (shift)->{'deferred'}->then(@_) } | ||||||||||||||||||||||||||
|
Subroutine
then: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 20 | 0 | ▶ | sub chain { (shift)->{'deferred'}->chain(@_) } | ||||||||||||||||||||||||||
|
Subroutine
chain: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 21 | 1 | ▶ | sub catch { (shift)->{'deferred'}->catch(@_) } | ||||||||||||||||||||||||||
|
Subroutine
catch: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | sub done { (shift)->{'deferred'}->done(@_) } | ||||||||||||||||||||||||||
|
Subroutine
done: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 23 | 3 | ▶ | sub finally { (shift)->{'deferred'}->finally(@_) } | ||||||||||||||||||||||||||
|
Subroutine
finally: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 24 | 0 | ▶ | sub status { (shift)->{'deferred'}->status } | ||||||||||||||||||||||||||
|
Subroutine
status: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 25 | 0 | ▶ | sub result { (shift)->{'deferred'}->result } | ||||||||||||||||||||||||||
|
Subroutine
result: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub timeout { (shift)->{'deferred'}->timeout } | ||||||||||||||||||||||||||
|
Subroutine
timeout: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | ▶ | sub is_unfulfilled { (shift)->{'deferred'}->is_unfulfilled } | ||||||||||||||||||||||||||
|
Subroutine
is_unfulfilled: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 29 | 0 | ▶ | sub is_fulfilled { (shift)->{'deferred'}->is_fulfilled } | ||||||||||||||||||||||||||
|
Subroutine
is_fulfilled: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | 0 | ▶ | sub is_failed { (shift)->{'deferred'}->is_failed } | ||||||||||||||||||||||||||
|
Subroutine
is_failed: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 31 | 0 | ▶ | sub is_done { (shift)->{'deferred'}->is_done } | ||||||||||||||||||||||||||
|
Subroutine
is_done: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 0 | ▶ | sub is_in_progress { (shift)->{'deferred'}->is_in_progress } | ||||||||||||||||||||||||||
|
Subroutine
is_in_progress: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 34 | 0 | ▶ | sub is_resolved { (shift)->{'deferred'}->is_resolved } | ||||||||||||||||||||||||||
|
Subroutine
is_resolved: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 35 | 0 | ▶ | sub is_rejected { (shift)->{'deferred'}->is_rejected } | ||||||||||||||||||||||||||
|
Subroutine
is_rejected: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 15 | 1; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | __END__ | ||||||||||||||||||||||||||||