Skip to content

Commit ad2b40b

Browse files
authored
Release v3.27.0
2 parents ae6dd43 + f90fca3 commit ad2b40b

29 files changed

Lines changed: 465 additions & 288 deletions

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@
1919
/packager.sh export-ignore
2020
/packager.php export-ignore
2121
/phpunit.xml.dist export-ignore
22+
/phpstan.neon.dist export-ignore
23+
/phpstan export-ignore

.github/workflows/test-package.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,42 @@ jobs:
4949
run: composer update --prefer-dist --no-progress --no-suggest --no-interaction ${{ matrix.composer-flags }}
5050

5151
- run: composer run-script test
52+
53+
phpstan:
54+
runs-on: ubuntu-latest
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
# TODO: we likely have to care about Guzzle's version too - ideally we'd
59+
# check our use of Guzzle is correct on each version
60+
php-version: ['7.1', '8.1']
61+
phpstan-version: ['~1.4']
62+
63+
steps:
64+
- uses: actions/checkout@v2
65+
66+
- name: install PHP
67+
uses: shivammathur/setup-php@v2
68+
with:
69+
php-version: ${{ matrix.php-version }}
70+
coverage: none
71+
extensions: intl, mbstring
72+
# by default setup-php uses a production php.ini so force development values
73+
ini-values: >-
74+
zend.exception_ignore_args=Off,
75+
zend.exception_string_param_max_len=15,
76+
error_reporting=-1,
77+
display_errors=On,
78+
display_startup_errors=On,
79+
zend.assertions=1
80+
81+
# - name: require guzzle
82+
# run: composer require "guzzlehttp/guzzle:${{ matrix.guzzle-version }}" --no-update ${{ matrix.composer-flags }}
83+
84+
- name: require phpstan
85+
run: composer require "phpstan/phpstan:${{ matrix.phpstan-version }}" --no-update ${{ matrix.composer-flags }}
86+
87+
- name: install dependencies
88+
run: composer update --prefer-dist --no-progress --no-suggest --no-interaction ${{ matrix.composer-flags }}
89+
90+
- run: ./vendor/bin/phpstan

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ vendor
55
/.idea
66
.phpunit.result.cache
77
decisions.yml
8+
phpstan.neon

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
Changelog
22
=========
33

4+
## 3.27.0 (2022-02-07)
5+
6+
### Enhancements
7+
8+
* Improve serialisation of backed enums. Previously a backed enum would JSON encode to their backing value, but will now include the enum name like `EnumName::CaseName (value)`
9+
[#639](https://github.com/bugsnag/bugsnag-php/pull/639)
10+
11+
### Fixes
12+
13+
* A number of errors in docblocks have been corrected
14+
[xPaw](https://github.com/xPaw)
15+
[#633](https://github.com/bugsnag/bugsnag-php/pull/633)
16+
[#637](https://github.com/bugsnag/bugsnag-php/pull/637)
17+
* Handle serialising pure enums when added as metadata. Previously a pure enum would be JSON encoded as `null`, but will now be converted to a string like `EnumName::CaseName`
18+
[#639](https://github.com/bugsnag/bugsnag-php/pull/639)
19+
* Remove use of the deprecated `strftime` function
20+
[#640](https://github.com/bugsnag/bugsnag-php/pull/640)
21+
* Fix session throttling when storage backend doesn't store integers
22+
[#643](https://github.com/bugsnag/bugsnag-php/pull/643)
23+
424
## 3.26.1 (2021-09-09)
525

626
### Fixes

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
FROM php:5.5.38-alpine
1+
FROM php:5.5-alpine
22

33
ENV COMPOSER_ALLOW_SUPERUSER 1
44

5-
RUN curl -sS https://getcomposer.org/installer | php \
6-
&& mv composer.phar /usr/local/bin/composer
5+
RUN apk update && apk upgrade
6+
7+
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
78

89
ENTRYPOINT ["php"]

package.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
if [[ "$(docker images -q bugsnag/php:5.5 2> /dev/null)" == "" ]]; then
4-
docker pull php:5.5.38-alpine
4+
docker pull php:5.5-alpine
55
docker build --no-cache -t bugsnag/php:5.5 .
66
fi
77

phpstan.neon.dist

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
includes:
2+
- phpstan/ignore-by-php-version.neon.php
3+
4+
parameters:
5+
level: 6
6+
7+
treatPhpDocTypesAsCertain: false
8+
checkMissingIterableValueType: false # TODO: remove this!
9+
10+
paths:
11+
- src/
12+
13+
ignoreErrors:
14+
-
15+
message: "#^Property Bugsnag\\\\Handler\\:\\:\\$reservedMemory is never read, only written\\.$#"
16+
count: 1
17+
path: src/Handler.php
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
ignoreErrors:
3+
- '#Class UnitEnum not found\.#'
4+
- '#.*invalid type UnitEnum\.#'
5+
- '#.*unknown class UnitEnum\.#'
6+
- '#Class BackedEnum not found\.#'
7+
- '#.*unknown class BackedEnum\.#'
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* Ignore errors based on the current PHP version.
7+
*
8+
* This is useful in cases where errors are caused by the use of features that
9+
* do not exist in the current version of PHP, e.g. enums
10+
*
11+
* This is the approach used by PHPStan itself:
12+
* https://github.com/phpstan/phpstan-src/blob/master/build/ignore-by-php-version.neon.php
13+
*/
14+
15+
use PHPStan\DependencyInjection\NeonAdapter;
16+
17+
$config = [];
18+
$adapter = new NeonAdapter();
19+
20+
if (version_compare(PHP_VERSION, '8.1.0', '<')) {
21+
$config = array_merge_recursive($config, $adapter->load(__DIR__.'/baseline-less-than-8.1.neon'));
22+
}
23+
24+
$config['parameters']['phpVersion'] = PHP_VERSION_ID;
25+
26+
return $config;

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
stopOnError="false"
1717
stopOnFailure="false"
1818
verbose="true"
19+
executionOrder="random"
1920
>
2021
<coverage processUncoveredFiles="true">
2122
<include>

0 commit comments

Comments
 (0)