Skip to content

Commit eacf4d8

Browse files
authored
Darcy/worm 246/improve clarity around $errstr param (#159)
* Update RaygunClient.php * Update composer.json * Update composer.json * Update composer.json * Update composer.json * Update SymfonyInstructions.md * Update UsageExampleV2.md
1 parent 7574c2b commit eacf4d8

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

SymfonyInstructions.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
## Raygun4PHP Symfony installation instructions
22

3-
### Step 1: Install Raygun4PHP with Composer (see README.md)
3+
### Step 1: Install Raygun4PHP with Composer (see [README.md](README.md))
44

5-
### Step 2: Create the file: `src/AppBundle/EventListener/RaygunExceptionListener` with the following content:
5+
### Step 2: Create the file: `src/AppBundle/EventListener/RaygunExceptionListener`
6+
7+
Populate with the following:
68

79
```php
810
<?php
@@ -32,15 +34,18 @@ class RaygunExceptionListener
3234

3335
?>
3436
```
37+
3538
**Important:** Make sure you change *apiKey* to your Raygun API key.
3639

3740
### Step 3: Register the hook service in `app/config/services.yml`
38-
```
41+
42+
```yaml
3943
app.exception_listener:
4044
class: AppBundle\EventListener\RaygunExceptionListener
4145
tags:
4246
- { name: kernel.event_listener, event: kernel.exception }
4347
```
4448
45-
## Further Information:
49+
## Further Information
50+
4651
Information about the [Symfony Event Listeners can be located here](http://symfony.com/doc/current/cookbook/event_dispatcher/event_listener.html).

UsageExampleV2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ $client = new Raygun4php\RaygunClient($transport);
2121
// Create and register error handlers
2222
function error_handler($errno, $errstr, $errfile, $errline )
2323
{
24-
global $client;
25-
$client->SendError($errno, $errstr, $errfile, $errline);
24+
global $client;
25+
$client->SendError($errno, $errstr, $errfile, $errline);
2626
}
2727

2828
function exception_handler($exception)

composer.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,20 @@
88
"exceptions",
99
"logging"
1010
],
11-
"homepage": "http://raygun.com",
11+
"homepage": "https://raygun.com",
1212
"license": "MIT",
1313
"authors": [
1414
{
15-
"name": "Mindscape",
16-
"email": "contact@mindscape.co.nz",
17-
"homepage": "http://www.mindscapehq.com"
15+
"name": "Raygun",
16+
"homepage": "https://raygun.com"
1817
}
1918
],
19+
"support": {
20+
"issues": "https://github.com/MindscapeHQ/raygun4php/issues",
21+
"source": "https://github.com/MindscapeHQ/raygun4php",
22+
"docs": "https://raygun.com/documentation/language-guides/php/crash-reporting/",
23+
"chat": "https://raygun.com/about/contact"
24+
},
2025
"require": {
2126
"php": "^7.2|^8.0",
2227
"ext-json": "*",
@@ -46,6 +51,8 @@
4651
"preferred-install": "dist"
4752
},
4853
"scripts": {
49-
"test": ["phpunit"]
54+
"test": [
55+
"phpunit"
56+
]
5057
}
5158
}

src/Raygun4php/RaygunClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function getDisableUserTracking()
8181
* Transmits an error to the Raygun API
8282
*
8383
* @param int $errno The error number
84-
* @param string $errstr The error string
84+
* @param string $errstr The error string (Used for error grouping. So don't include identifiers in $errstr. Use $userCustomData for, per instance, unique values)
8585
* @param string $errfile The file the error occurred in
8686
* @param int $errline The line the error occurred on
8787
* @param array $tags An optional array of string tags used to provide metadata for the message

0 commit comments

Comments
 (0)