Skip to content

Commit

Permalink
Merge pull request #268 from scoutapp/fix-missing-libcurl
Browse files Browse the repository at this point in the history
Update before installing apt packages in CI
  • Loading branch information
asgrim authored May 2, 2022
2 parents c08f44e + 765d09b commit a94a4fe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
- name: "Install scoutapm extension"
if: ${{ matrix.scout-ext == 'with-scout-ext' }}
run: |
sudo apt-get update
sudo apt --fix-broken install
sudo apt-get install -y libcurl4-openssl-dev
sudo mkdir -p /tmp/pear/temp
Expand Down Expand Up @@ -122,6 +123,7 @@ jobs:
- name: "Install scoutapm extension"
if: matrix.scout-ext == 'with-scout-ext'
run: |
sudo apt-get update
sudo apt --fix-broken install
sudo apt-get install -y libcurl4-openssl-dev
sudo mkdir -p /tmp/pear/temp
Expand Down
22 changes: 16 additions & 6 deletions src/Errors/ErrorEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

use function array_key_exists;
use function array_map;
use function array_values;
use function assert;
use function explode;
use function get_class;
Expand Down Expand Up @@ -76,9 +75,20 @@ public static function fromThrowable(?Request $request, Throwable $throwable): s
$request,
get_class($throwable),
$throwable->getMessage(),
array_values(array_map(
/** @psalm-param array{function: string, line?: int, file?: string, class?: string, type?: '->'|'::'} $trace */
array_map(
/**
* @psalm-param array{
* args?: array,
* class?: class-string,
* file?: string,
* function?: string,
* line?: int,
* type?: '->'|'::'
* } $trace
*/
static function (array $trace): string {
$function = array_key_exists('function', $trace) ? $trace['function'] : 'unknown_function';

return sprintf(
'%s:%d:in `%s`',
array_key_exists('file', $trace) ? $trace['file'] : 'unknown file',
Expand All @@ -88,13 +98,13 @@ static function (array $trace): string {
'%s%s%s',
$trace['class'],
str_replace($trace['type'], '::', '#'),
$trace['function']
$function
)
: $trace['function']
: $function
);
},
$throwable->getTrace()
))
)
);
}

Expand Down

0 comments on commit a94a4fe

Please sign in to comment.