line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dancer::Deprecation; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:SUKRIA'; |
3
|
|
|
|
|
|
|
#ABSTRACT: handle deprecation messages |
4
|
|
|
|
|
|
|
$Dancer::Deprecation::VERSION = '1.3520'; |
5
|
194
|
|
|
194
|
|
1875
|
use strict; |
|
194
|
|
|
|
|
431
|
|
|
194
|
|
|
|
|
5752
|
|
6
|
194
|
|
|
194
|
|
4462
|
use warnings; |
|
194
|
|
|
|
|
599
|
|
|
194
|
|
|
|
|
5903
|
|
7
|
194
|
|
|
194
|
|
1160
|
use Carp; |
|
194
|
|
|
|
|
421
|
|
|
194
|
|
|
|
|
11425
|
|
8
|
194
|
|
|
194
|
|
1312
|
use Dancer::Exception qw(:all); |
|
194
|
|
|
|
|
473
|
|
|
194
|
|
|
|
|
59604
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub deprecated { |
11
|
5
|
|
|
5
|
1
|
3414
|
my ($class, %args) = @_; |
12
|
|
|
|
|
|
|
|
13
|
5
|
|
|
|
|
41
|
my ( $package, undef, undef, $sub ) = caller(1); |
14
|
|
|
|
|
|
|
|
15
|
5
|
100
|
|
|
|
21
|
unless ( defined $args{feature} ) { |
16
|
3
|
|
|
|
|
17
|
$args{feature} = $sub; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
5
|
100
|
|
|
|
26
|
my $deprecated_at = defined $args{version} ? $args{version} : undef; |
20
|
|
|
|
|
|
|
|
21
|
5
|
|
|
|
|
6
|
my $msg; |
22
|
5
|
100
|
|
|
|
13
|
if ( defined $args{message} ) { |
23
|
2
|
|
|
|
|
3
|
$msg = $args{message}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
else { |
26
|
3
|
|
|
|
|
6
|
$msg = "$args{feature} has been deprecated"; |
27
|
|
|
|
|
|
|
} |
28
|
5
|
100
|
|
|
|
14
|
$msg .= " since version $deprecated_at" if defined $deprecated_at; |
29
|
5
|
50
|
|
|
|
13
|
$msg .= ". " . $args{reason} if defined $args{reason}; |
30
|
|
|
|
|
|
|
|
31
|
5
|
100
|
|
|
|
25
|
raise core_deprecation => $msg if $args{fatal}; |
32
|
4
|
|
|
|
|
605
|
carp($msg); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |