Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/license-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2

- name: install PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@2.37.1
with:
php-version: '8.2'
coverage: none
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ jobs:
guzzle-version: '^7.9'
- php-version: '8.5'
guzzle-version: '^7.10'
- php-version: '7.4'
guzzle-version: '^8.0'
- php-version: '8.0'
guzzle-version: '^8.0'
- php-version: '8.1'
guzzle-version: '^8.0'
- php-version: '8.2'
guzzle-version: '^8.0'
- php-version: '8.3'
guzzle-version: '^8.0'
- php-version: '8.4'
guzzle-version: '^8.0'
- php-version: '8.5'
guzzle-version: '^8.0'

steps:
- uses: actions/checkout@v2
Expand Down
61 changes: 57 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,63 @@
# Build artifacts
/build
vendor
bugsnag.phar

# Composer
vendor/
/composer.lock
/composer.phar
/.idea
auth.json

# PHPUnit
.phpunit.result.cache
decisions.yml
.phpunit.cache/
coverage/
clover.xml
coverage.xml
junit.xml

# PHPStan
phpstan.neon

# PHP-CS-Fixer / PHP CodeSniffer
.php-cs-fixer.cache
.php_cs.cache
.phpcs-cache

# IDE / Editor
/.idea
/.vscode
bugsnag-php.iml
bugsnag.phar
*.suo
*.ntvs*
*.njsproj
*.sln
*.swp
*.bak
*.orig

# OS files
.DS_Store
Thumbs.db

# Environment
.env
.env.local
.env.*.local
.php-version

# Project-specific
decisions.yml
*.log

# Security tools
.gitleaks.toml
.pre-commit-config.yaml
.gitleaks-baseline.json

# Docker
docker-compose.override.yml

# Certificates (if any)
*.pem
*.crt
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

## 3.31.0 (2026-07-29)

### Enhancements

* Add support for Guzzle 8
[#696](https://github.com/bugsnag/bugsnag-php/pull/696)

## 3.30.1 (2026-01-22)

### Changes
Expand Down
22 changes: 9 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,12 @@ Test the notifier by running the application locally.
Releasing
=========

1. Commit all outstanding changes
2. Bump the version in `src/Configuration.php`.
3. Update the CHANGELOG.md, and README if appropriate.
4. Check out a new branch and commit your changes
5. Open a pull request for the release
6. Once merged, pull the latest changes and then tag the release:
```
git tag v3.x.x
git push --tags
```
7. Build a new phar package by running `make package` and attach it to the GitHub release.
8. Ensure `utility/bugsnag-prepend.php` works with the example php project and attach it to the Github release.
9. Update the setup guides for PHP (and its frameworks) with any new content.
1. Merge all outstanding PRs to go into the release.
1. Create a new release branch from `next`, named in the format `release/v1.x.x`.
1. Bump the version in `src/Configuration.php`.
1. Update the CHANGELOG.md, and README if appropriate.
1. Open a pull request into `master` and get it approved.
1. Merge the pull request using a message of the form "Release v1.x.x".
1. Pull the latest `master` branch locally.
1. Build a new phar package by running `make package`.
1. Create a new release on GitHub, attaching the phar.
15 changes: 13 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@
"email": "notifiers@bugsnag.com",
"homepage": "https://bugsnag.com"
}],
"config": {
"_comment": "Audit ignores are required for older Guzzle versions (5.x/6.x) to run PHPUnit tests on PHP 5.5-7.2, and for guzzlehttp/psr7 1.x (CVE-2026-49214, CVE-2026-48998) which cannot be upgraded on PHP <7.2.5",
"audit": {
"ignore": [
"PKSA-z3gr-8qht-p93v",
"PKSA-w57n-mhp6-c9sd",
"PKSA-gm5x-j3mz-71n9",
"PKSA-jj5t-2zs1-dcfm"
]
}
},
"require": {
"php": ">=5.5",
"composer/ca-bundle": "^1.0",
"guzzlehttp/guzzle": "^5.0|^6.0|^7.0"
"guzzlehttp/guzzle": "^5.0|^6.0|^7.0|^8.0"
},
"require-dev": {
"guzzlehttp/psr7": "^1.3|^2.0",
"guzzlehttp/psr7": "^1.3|^2.0|^3.0",
"mtdowling/burgomaster": "dev-master#72151eddf5f0cf101502b94bf5031f9c53501a04",
"phpunit/phpunit": "^4.8.36|^7.5.15|^9.3.10",
"php-mock/php-mock-phpunit": "^1.1|^2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Configuration implements FeatureDataStore
*/
protected $notifier = [
'name' => 'Bugsnag PHP (Official)',
'version' => '3.30.1',
'version' => '3.31.0',
'url' => 'https://bugsnag.com',
];

Expand Down
18 changes: 14 additions & 4 deletions src/Internal/GuzzleCompat.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,26 @@ public static function getBaseUriOptionName()
/**
* Get the base URL/URI, which depends on the Guzzle version.
*
* Returns null when using Guzzle 8+ and the provided ClientInterface
* implementation does not expose a `getConfig()` method (which was removed
* from the interface in Guzzle 8).
*
* @param GuzzleHttp\ClientInterface $guzzle
*
* @return mixed
*/
public static function getBaseUri(GuzzleHttp\ClientInterface $guzzle)
{
// TODO: validate this by running PHPStan with Guzzle 5
return self::isUsingGuzzle5()
? $guzzle->getBaseUrl() // @phpstan-ignore-line
: $guzzle->getConfig(self::getBaseUriOptionName());
if (self::isUsingGuzzle5()) {
// TODO: validate this by running PHPStan with Guzzle 5
return $guzzle->getBaseUrl(); // @phpstan-ignore-line
}

// Guzzle 8 removed 'getConfig' from ClientInterface, but it still
// exists on the concrete Client class
return method_exists($guzzle, 'getConfig')
? $guzzle->getConfig(self::getBaseUriOptionName())
: null;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions tests/phpt/Utilities/FakeGuzzle.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
5 => FakeGuzzle5::class,
6 => FakeGuzzle6::class,
7 => FakeGuzzle7::class,
// the Guzzle 7 implementation also satisfies Guzzle 8's ClientInterface,
// which is the same as Guzzle 7's but without 'getConfig'
8 => FakeGuzzle7::class,
];

// Parse a version number like '1.0.0' into the major version only (1)
Expand Down
2 changes: 1 addition & 1 deletion tests/phpt/Utilities/FakeGuzzle7.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Psr\Http\Message\ResponseInterface;

/**
* A Guzzle 7 compatible implementation of ClientInterface for use in PHPT tests.
* A Guzzle 7 and 8 compatible implementation of ClientInterface for use in PHPT tests.
*
* This should never be used directly; use 'FakeGuzzle' instead!
*/
Expand Down
Loading