| 1 | package SBOM::CycloneDX::Component::Patch; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use SBOM::CycloneDX::List; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use Types::Standard qw(Str InstanceOf Enum); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 1 | ▶ | use Types::TypeTiny qw(ArrayLike); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | |||||||||||
| 16 | 1 | extends 'SBOM::CycloneDX::Base'; | |||||||||
| 17 | |||||||||||
| 18 | 1 | has type => (is => 'rw', isa => Enum [qw(unofficial monkey backport cherry-pick)]); | |||||||||
| 19 | 1 | has diff => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Component::Diff']); | |||||||||
| 20 | 1 | has resolves => (is => 'rw', isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Issue']]); | |||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub TO_JSON { | ||||||||
|
Subroutine
TO_JSON: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 23 | |||||||||||
| 24 | 0 | my $self = shift; | |||||||||
| 25 | |||||||||||
| 26 | 0 | my $json = {}; | |||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | $json->{type} = $self->type if $self->type; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 0 | ▶ | $json->{diff} = $self->diff if $self->diff; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 0 | ▶ | $json->{resolves} = $self->resolves if @{$self->resolves}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | |||||||||||
| 32 | 0 | return $json; | |||||||||
| 33 | |||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 1 | 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<SBOM::CycloneDX::Component::Patch> specifies an individual patch | ||||||||||
| 52 | |||||||||||
| 53 | =head2 METHODS | ||||||||||
| 54 | |||||||||||
| 55 | L<SBOM::CycloneDX::Component::Patch> inherits all methods from L<SBOM::CycloneDX::Base> | ||||||||||
| 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<diff>, The patch file (or diff) that shows changes. Refer to | ||||||||||
| 67 | L<https://en.wikipedia.org/wiki/Diff> | ||||||||||
| 68 | |||||||||||
| 69 | =item * C<resolves>, A collection of issues the patch resolves | ||||||||||
| 70 | |||||||||||
| 71 | =item * C<type>, 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<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>. | ||||||||||
| 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<https://github.com/giterlizzi/perl-SBOM-CycloneDX> | ||||||||||
| 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 <gdt@cpan.org> | ||||||||||
| 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 | ||||||||||