Skip to content

Commit

Permalink
Darcy/worm 246/improve clarity around $errstr param (#159)
Browse files Browse the repository at this point in the history
* Update RaygunClient.php

* Update composer.json

* Update composer.json

* Update composer.json

* Update composer.json

* Update SymfonyInstructions.md

* Update UsageExampleV2.md
  • Loading branch information
darcythomas authored Aug 21, 2023
1 parent 7574c2b commit eacf4d8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
13 changes: 9 additions & 4 deletions SymfonyInstructions.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
## Raygun4PHP Symfony installation instructions

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

### Step 2: Create the file: `src/AppBundle/EventListener/RaygunExceptionListener` with the following content:
### Step 2: Create the file: `src/AppBundle/EventListener/RaygunExceptionListener`

Populate with the following:

```php
<?php
Expand Down Expand Up @@ -32,15 +34,18 @@ class RaygunExceptionListener

?>
```

**Important:** Make sure you change *apiKey* to your Raygun API key.

### Step 3: Register the hook service in `app/config/services.yml`
```

```yaml
app.exception_listener:
class: AppBundle\EventListener\RaygunExceptionListener
tags:
- { name: kernel.event_listener, event: kernel.exception }
```
## Further Information:
## Further Information
Information about the [Symfony Event Listeners can be located here](http://symfony.com/doc/current/cookbook/event_dispatcher/event_listener.html).
4 changes: 2 additions & 2 deletions UsageExampleV2.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ $client = new Raygun4php\RaygunClient($transport);
// Create and register error handlers
function error_handler($errno, $errstr, $errfile, $errline )
{
global $client;
$client->SendError($errno, $errstr, $errfile, $errline);
global $client;
$client->SendError($errno, $errstr, $errfile, $errline);
}

function exception_handler($exception)
Expand Down
17 changes: 12 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@
"exceptions",
"logging"
],
"homepage": "http://raygun.com",
"homepage": "https://raygun.com",
"license": "MIT",
"authors": [
{
"name": "Mindscape",
"email": "[email protected]",
"homepage": "http://www.mindscapehq.com"
"name": "Raygun",
"homepage": "https://raygun.com"
}
],
"support": {
"issues": "https://github.com/MindscapeHQ/raygun4php/issues",
"source": "https://github.com/MindscapeHQ/raygun4php",
"docs": "https://raygun.com/documentation/language-guides/php/crash-reporting/",
"chat": "https://raygun.com/about/contact"
},
"require": {
"php": "^7.2|^8.0",
"ext-json": "*",
Expand Down Expand Up @@ -46,6 +51,8 @@
"preferred-install": "dist"
},
"scripts": {
"test": ["phpunit"]
"test": [
"phpunit"
]
}
}
2 changes: 1 addition & 1 deletion src/Raygun4php/RaygunClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function getDisableUserTracking()
* Transmits an error to the Raygun API
*
* @param int $errno The error number
* @param string $errstr The error string
* @param string $errstr The error string (Used for error grouping. So don't include identifiers in $errstr. Use $userCustomData for, per instance, unique values)
* @param string $errfile The file the error occurred in
* @param int $errline The line the error occurred on
* @param array $tags An optional array of string tags used to provide metadata for the message
Expand Down

0 comments on commit eacf4d8

Please sign in to comment.