File Coverage

blib/lib/SBOM/CycloneDX/Component/Patch.pm
Criterion Covered Total %
statement 26 33 78.7
branch 0 6 0.0
condition n/a
subroutine 9 10 90.0
pod 1 1 100.0
total 36 50 72.0


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Component::Patch;
2              
3 1     1   1003 use 5.010001;
  1         3  
4 1     1   4 use strict;
  1         1  
  1         26  
5 1     1   3 use warnings;
  1         1  
  1         36  
6 1     1   3 use utf8;
  1         1  
  1         5  
7              
8 1     1   25 use SBOM::CycloneDX::List;
  1         1  
  1         30  
9              
10 1     1   3 use Types::Standard qw(Str InstanceOf Enum);
  1         2  
  1         6  
11 1     1   2895 use Types::TypeTiny qw(ArrayLike);
  1         3  
  1         8  
12              
13 1     1   603 use Moo;
  1         3  
  1         11  
14 1     1   536 use namespace::autoclean;
  1         3  
  1         12  
15              
16             extends 'SBOM::CycloneDX::Base';
17              
18             has type => (is => 'rw', isa => Enum [qw(unofficial monkey backport cherry-pick)]);
19             has diff => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Component::Diff']);
20             has resolves => (is => 'rw', isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Issue']]);
21              
22             sub TO_JSON {
23              
24 0     0 1   my $self = shift;
25              
26 0           my $json = {};
27              
28 0 0         $json->{type} = $self->type if $self->type;
29 0 0         $json->{diff} = $self->diff if $self->diff;
30 0 0         $json->{resolves} = $self->resolves if @{$self->resolves};
  0            
31              
32 0           return $json;
33              
34             }
35              
36             1;
37              
38             =encoding utf-8
39              
40             =head1 NAME
41              
42             SBOM::CycloneDX::Component::Patch - Patch
43              
44             =head1 SYNOPSIS
45              
46             SBOM::CycloneDX::Component::Patch->new();
47              
48              
49             =head1 DESCRIPTION
50              
51             L specifies an individual patch
52              
53             =head2 METHODS
54              
55             L inherits all methods from L
56             and implements the following new ones.
57              
58             =over
59              
60             =item SBOM::CycloneDX::Component::Patch->new( %PARAMS )
61              
62             Properties:
63              
64             =over
65              
66             =item * C, The patch file (or diff) that shows changes. Refer to
67             L
68              
69             =item * C, A collection of issues the patch resolves
70              
71             =item * C, Specifies the purpose for the patch including the resolution
72             of defects, security issues, or new behavior or functionality.
73              
74             =back
75              
76             =item $patch->diff
77              
78             =item $patch->resolves
79              
80             =item $patch->type
81              
82             =back
83              
84              
85             =head1 SUPPORT
86              
87             =head2 Bugs / Feature Requests
88              
89             Please report any bugs or feature requests through the issue tracker
90             at L.
91             You will be notified automatically of any progress on your issue.
92              
93             =head2 Source Code
94              
95             This is open source software. The code repository is available for
96             public review and contribution under the terms of the license.
97              
98             L
99              
100             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
101              
102              
103             =head1 AUTHOR
104              
105             =over 4
106              
107             =item * Giuseppe Di Terlizzi
108              
109             =back
110              
111              
112             =head1 LICENSE AND COPYRIGHT
113              
114             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
115              
116             This is free software; you can redistribute it and/or modify it under
117             the same terms as the Perl 5 programming language system itself.
118              
119             =cut