• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eliashaeussler / composer-update-check / 16900093970

12 Aug 2025 05:43AM UTC coverage: 20.538%. First build
16900093970

Pull #130

github

web-flow
Merge pull request #188 from eliashaeussler/renovate/composer-composer-2.x-lockfile
Pull Request #130: [!!!][FEATURE] Modernize plugin

356 of 1832 new or added lines in 57 files covered. (19.43%)

382 of 1860 relevant lines covered (20.54%)

1.11 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Configuration/ComposerUpdateCheckConfig.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the Composer package "eliashaeussler/composer-update-check".
7
 *
8
 * Copyright (C) 2020-2025 Elias Häußler <elias@haeussler.dev>
9
 *
10
 * This program is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU General Public License as published by
12
 * the Free Software Foundation, either version 3 of the License, or
13
 * (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22
 */
23

24
namespace EliasHaeussler\ComposerUpdateCheck\Configuration;
25

26
use EliasHaeussler\ComposerUpdateCheck\IO;
27

28
/**
29
 * ComposerUpdateCheckConfig.
30
 *
31
 * @author Elias Häußler <elias@haeussler.dev>
32
 * @license GPL-3.0-or-later
33
 */
34
final class ComposerUpdateCheckConfig
35
{
36
    /**
37
     * @param list<Options\PackageExcludePattern> $excludePatterns
38
     * @param array<string, array<string, mixed>> $reporters
39
     */
NEW
40
    public function __construct(
×
41
        private array $excludePatterns = [],
42
        private bool $includeDevPackages = true,
43
        private bool $performSecurityScan = false,
44
        private string $format = IO\Formatter\TextFormatter::FORMAT,
45
        private array $reporters = [],
NEW
46
    ) {}
×
47

NEW
48
    public function excludePackageByName(string $name): self
×
49
    {
NEW
50
        $this->excludePatterns[] = Options\PackageExcludePattern::byName($name);
×
51

NEW
52
        return $this;
×
53
    }
54

NEW
55
    public function excludePackageByRegularExpression(string $regex): self
×
56
    {
NEW
57
        $this->excludePatterns[] = Options\PackageExcludePattern::byRegularExpression($regex);
×
58

NEW
59
        return $this;
×
60
    }
61

NEW
62
    public function excludePackageByPattern(Options\PackageExcludePattern $excludePattern): self
×
63
    {
NEW
64
        $this->excludePatterns[] = $excludePattern;
×
65

NEW
66
        return $this;
×
67
    }
68

69
    /**
70
     * @return list<Options\PackageExcludePattern>
71
     */
NEW
72
    public function getExcludePatterns(): array
×
73
    {
NEW
74
        return $this->excludePatterns;
×
75
    }
76

NEW
77
    public function includeDevPackages(): self
×
78
    {
NEW
79
        $this->includeDevPackages = true;
×
80

NEW
81
        return $this;
×
82
    }
83

NEW
84
    public function excludeDevPackages(): self
×
85
    {
NEW
86
        $this->includeDevPackages = false;
×
87

NEW
88
        return $this;
×
89
    }
90

NEW
91
    public function areDevPackagesIncluded(): bool
×
92
    {
NEW
93
        return $this->includeDevPackages;
×
94
    }
95

NEW
96
    public function performSecurityScan(): self
×
97
    {
NEW
98
        $this->performSecurityScan = true;
×
99

NEW
100
        return $this;
×
101
    }
102

NEW
103
    public function skipSecurityScan(): self
×
104
    {
NEW
105
        $this->performSecurityScan = false;
×
106

NEW
107
        return $this;
×
108
    }
109

NEW
110
    public function shouldPerformSecurityScan(): bool
×
111
    {
NEW
112
        return $this->performSecurityScan;
×
113
    }
114

NEW
115
    public function setFormat(string $format): self
×
116
    {
NEW
117
        $this->format = $format;
×
118

NEW
119
        return $this;
×
120
    }
121

NEW
122
    public function getFormat(): string
×
123
    {
NEW
124
        return $this->format;
×
125
    }
126

127
    /**
128
     * @param array<string, mixed> $options
129
     */
NEW
130
    public function enableReporter(string $name, array $options = []): self
×
131
    {
NEW
132
        $this->reporters[$name] = $options;
×
133

NEW
134
        return $this;
×
135
    }
136

NEW
137
    public function disableReporter(string $name): self
×
138
    {
NEW
139
        unset($this->reporters[$name]);
×
140

NEW
141
        return $this;
×
142
    }
143

144
    /**
145
     * @return array<string, array<string, mixed>>
146
     */
NEW
147
    public function getReporters(): array
×
148
    {
NEW
149
        return $this->reporters;
×
150
    }
151
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc