Skip to content

Commit 8a7137b

Browse files
committed
Fix PHPStan warnings
1 parent f4d78b4 commit 8a7137b

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

.github/workflows/main.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
name: CI
22

33
on:
4-
pull_request: null
5-
push:
6-
branches:
7-
- master
4+
- pull_request
5+
- push
86

97
jobs:
108
tests:
119
runs-on: ubuntu-latest
1210
strategy:
1311
matrix:
1412
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
15-
name: PHP ${{ matrix.php }} tests
13+
name: PHP ${{ matrix.php }}
1614
steps:
1715
- uses: actions/checkout@v2
1816
# required for "git tag" presence for MonorepoBuilder split and ChangelogLinker git tags resolver; default is 1
@@ -27,6 +25,7 @@ jobs:
2725
- run: composer phpunit
2826

2927
tests_lowest_dependencies:
28+
name: Lowest dependencies
3029
runs-on: ubuntu-latest
3130
steps:
3231
- uses: actions/checkout@v2
@@ -41,6 +40,7 @@ jobs:
4140
- run: composer phpunit
4241

4342
test_coverage:
43+
name: Coverage
4444
runs-on: ubuntu-latest
4545
steps:
4646
- uses: actions/checkout@v2
@@ -56,10 +56,9 @@ jobs:
5656
composer coverage
5757
# codecov.io
5858
bash <(curl -s https://codecov.io/bash)
59-
env:
60-
CODECOV_TOKEN: 'de38eee4-bbc9-43bc-811c-c96a7d6ec3b6'
6159
6260
php-cs-fixer:
61+
name: PHP CS Fixer
6362
runs-on: ubuntu-latest
6463
steps:
6564
- uses: actions/checkout@v2
@@ -73,12 +72,13 @@ jobs:
7372
- run: composer php-cs-fixer-dry-run
7473

7574
phpstan:
75+
name: PHPStan
7676
runs-on: ubuntu-latest
7777
steps:
7878
- uses: actions/checkout@v2
7979
- uses: shivammathur/setup-php@v2
8080
with:
81-
php-version: 7.1
81+
php-version: 8.1
8282
coverage: none
8383
- run: composer install --no-progress
8484
- run: composer phpstan

src/AbstractElement.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ protected static function addChildWithTypeToElement(SimpleXMLElement $parent, st
219219
protected static function addCData(string $cdataText, SimpleXMLElement $element): void
220220
{
221221
$node = dom_import_simplexml($element);
222-
assert(false !== $node);
223222
$no = $node->ownerDocument;
224223
assert(null !== $no);
225224
$node->appendChild($no->createCDATASection($cdataText));

src/Feed.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class Feed extends AbstractElement
3939

4040
/**
4141
* @var array[]
42+
*
4243
* @phpstan-var array<array{ns: string, uri: string, name: string, value: string, attributes: string[]}>
4344
*/
4445
protected $customElements = [];
@@ -201,17 +202,16 @@ public function getSimpleXML(): SimpleXMLElement
201202
public function getDocument(): DOMDocument
202203
{
203204
$node = dom_import_simplexml($this->getSimpleXML());
204-
assert(false !== $node);
205205
$no = $node->ownerDocument;
206206
assert(null !== $no);
207207

208208
return $no;
209209
}
210210

211211
/**
212-
* @throws Exception
213-
*
214212
* @return false|string
213+
*
214+
* @throws Exception
215215
*/
216216
public function saveXML()
217217
{

0 commit comments

Comments
 (0)