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

eliashaeussler / composer-update-check / 11500247089

24 Oct 2024 01:23PM UTC coverage: 20.327%. First build
11500247089

Pull #130

github

renovate[bot]
[TASK] Update php-http/httplug to v2.4.1

| datasource | package          | from  | to    |
| ---------- | ---------------- | ----- | ----- |
| packagist  | php-http/httplug | 2.4.0 | 2.4.1 |
Pull Request #130: [!!!][FEATURE] Modernize plugin

347 of 1809 new or added lines in 56 files covered. (19.18%)

373 of 1835 relevant lines covered (20.33%)

1.09 hits per line

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

0.0
/src/Entity/Report/Dto/TeamsContent.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-2024 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\Entity\Report\Dto;
25

26
use EliasHaeussler\ComposerUpdateCheck\Entity;
27
use JsonSerializable;
28

29
use function array_filter;
30

31
/**
32
 * TeamsContent.
33
 *
34
 * @author Elias Häußler <elias@haeussler.dev>
35
 * @license GPL-3.0-or-later
36
 */
37
final class TeamsContent implements JsonSerializable
38
{
39
    /**
40
     * @param list<TeamsTableColumn>|null $columns
41
     * @param list<TeamsFact>|null        $facts
42
     * @param list<self>|null             $items
43
     * @param list<TeamsTableRow>|null    $rows
44
     */
NEW
45
    private function __construct(
×
46
        public readonly string $type,
47
        public readonly ?array $columns = null,
48
        public readonly ?array $facts = null,
49
        public readonly ?bool $firstRowAsHeader = null,
50
        public readonly ?string $gridStyle = null,
51
        public readonly ?string $id = null,
52
        public readonly ?bool $isVisible = null,
53
        public readonly ?array $items = null,
54
        public readonly ?array $rows = null,
55
        public readonly ?Entity\Report\Enum\TeamsFontSize $size = null,
56
        public readonly ?Entity\Report\Enum\TeamsSpacing $spacing = null,
57
        public readonly ?string $text = null,
58
        public readonly ?Entity\Report\Enum\TeamsFontWeight $weight = null,
59
        public readonly ?bool $wrap = null,
NEW
60
    ) {}
×
61

62
    /**
63
     * @param list<self> $items
64
     *
65
     * @see https://github.com/microsoft/AdaptiveCards/blob/main/schemas/src/elements/Container.json
66
     */
NEW
67
    public static function container(
×
68
        array $items,
69
        bool $isVisible = true,
70
        string $id = null,
71
        Entity\Report\Enum\TeamsSpacing $spacing = null,
72
    ): self {
NEW
73
        return new self(
×
NEW
74
            type: 'Container',
×
NEW
75
            id: $id,
×
NEW
76
            isVisible: $isVisible,
×
NEW
77
            items: $items,
×
NEW
78
            spacing: $spacing,
×
NEW
79
        );
×
80
    }
81

82
    /**
83
     * @param list<TeamsFact> $facts
84
     *
85
     * @see https://github.com/microsoft/AdaptiveCards/blob/main/schemas/src/elements/FactSet.json
86
     */
NEW
87
    public static function factSet(array $facts, Entity\Report\Enum\TeamsSpacing $spacing = null): self
×
88
    {
NEW
89
        return new self(
×
NEW
90
            type: 'FactSet',
×
NEW
91
            facts: $facts,
×
NEW
92
            spacing: $spacing,
×
NEW
93
        );
×
94
    }
95

96
    /**
97
     * @param list<TeamsTableColumn> $columns
98
     * @param list<TeamsTableRow>    $rows
99
     *
100
     * @see https://github.com/microsoft/AdaptiveCards/blob/main/schemas/src/elements/Table.json
101
     */
NEW
102
    public static function table(
×
103
        array $columns,
104
        array $rows,
105
        bool $firstRowAsHeader = false,
106
        string $gridStyle = null,
107
    ): self {
NEW
108
        return new self(
×
NEW
109
            type: 'Table',
×
NEW
110
            columns: $columns,
×
NEW
111
            firstRowAsHeader: $firstRowAsHeader,
×
NEW
112
            gridStyle: $gridStyle,
×
NEW
113
            rows: $rows,
×
NEW
114
        );
×
115
    }
116

117
    /**
118
     * @see https://github.com/microsoft/AdaptiveCards/blob/main/schemas/src/elements/TextBlock.json
119
     */
NEW
120
    public static function textBlock(
×
121
        string $text,
122
        bool $wrap = false,
123
        Entity\Report\Enum\TeamsFontSize $size = null,
124
        Entity\Report\Enum\TeamsSpacing $spacing = null,
125
        Entity\Report\Enum\TeamsFontWeight $weight = null,
126
    ): self {
NEW
127
        return new self(
×
NEW
128
            type: 'TextBlock',
×
NEW
129
            size: $size,
×
NEW
130
            spacing: $spacing,
×
NEW
131
            text: $text,
×
NEW
132
            weight: $weight,
×
NEW
133
            wrap: $wrap,
×
NEW
134
        );
×
135
    }
136

137
    /**
138
     * @return array{
139
     *     type: string,
140
     *     columns?: list<TeamsTableColumn>,
141
     *     facts?: list<TeamsFact>,
142
     *     firstRowAsHeader?: bool,
143
     *     gridStyle?: string,
144
     *     id?: string,
145
     *     isVisible?: bool,
146
     *     items?: list<self>,
147
     *     rows?: list<TeamsTableRow>,
148
     *     size?: string,
149
     *     spacing?: string,
150
     *     text?: string,
151
     *     weight?: string,
152
     *     wrap?: bool,
153
     * }
154
     */
NEW
155
    public function jsonSerialize(): array
×
156
    {
NEW
157
        $body = [
×
NEW
158
            'type' => $this->type,
×
NEW
159
            'columns' => $this->columns,
×
NEW
160
            'facts' => $this->facts,
×
NEW
161
            'firstRowAsHeader' => $this->firstRowAsHeader,
×
NEW
162
            'gridStyle' => $this->gridStyle,
×
NEW
163
            'id' => $this->id,
×
NEW
164
            'isVisible' => $this->isVisible,
×
NEW
165
            'items' => $this->items,
×
NEW
166
            'rows' => $this->rows,
×
NEW
167
            'size' => $this->size?->value,
×
NEW
168
            'spacing' => $this->spacing?->value,
×
NEW
169
            'text' => $this->text,
×
NEW
170
            'weight' => $this->weight?->value,
×
NEW
171
            'wrap' => $this->wrap,
×
NEW
172
        ];
×
173

NEW
174
        return array_filter($body, static fn (mixed $value) => null !== $value);
×
175
    }
176
}
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