{"id":18887995,"url":"https://github.com/codex-team/hawk.symfony","last_synced_at":"2026-02-07T21:32:47.798Z","repository":{"id":257451772,"uuid":"856945236","full_name":"codex-team/hawk.symfony","owner":"codex-team","description":"Symfony errors Catcher module for Hawk.so","archived":false,"fork":false,"pushed_at":"2025-09-25T11:35:52.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-22T10:22:37.925Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codex-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-13T14:04:13.000Z","updated_at":"2025-09-25T11:35:35.000Z","dependencies_parsed_at":"2025-04-14T23:07:56.926Z","dependency_job_id":"7937252b-83da-47e7-abce-4493653254a1","html_url":"https://github.com/codex-team/hawk.symfony","commit_stats":null,"previous_names":["codex-team/hawk.symfony"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/codex-team/hawk.symfony","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fhawk.symfony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fhawk.symfony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fhawk.symfony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fhawk.symfony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codex-team","download_url":"https://codeload.github.com/codex-team/hawk.symfony/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fhawk.symfony/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29208712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T20:33:12.493Z","status":"ssl_error","status_checked_at":"2026-02-07T20:30:47.381Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T07:41:07.297Z","updated_at":"2026-02-07T21:32:47.783Z","avatar_url":"https://github.com/codex-team.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hawk Symfony\n\nSymfony errors Catcher for [Hawk.so](https://hawk.so).\n\n## Setup\n\n1. [Register](https://garage.hawk.so/sign-up) an account, create a Project and get an Integration Token.\n\n2. Install SDK via [composer](https://getcomposer.org) to install the Catcher\n\nCatcher provides support for PHP 7.2 or later\n\n```bash\n$ composer require codex-team/hawk.symfony\n```\n\n### Configuration\n\nAdd the following authorization information to your `.env` file:\n\n```env\nHAWK_TOKEN=\u003cyour_token_from_the_control_panel\u003e\n```\n\nCreate a configuration file at `config/packages/hawk.yaml` with the following content:\n\n```yaml\nhawk:\n  integration_token: '%env(HAWK_TOKEN)%'\n\n  # Optional: Configure a custom beforeSend service\n  before_send_service: 'App\\Hawk\\BeforeSendService'\n```\n\nIn the `config/packages/monolog.yaml` file, specify the handler settings under the appropriate section (`dev` or `prod`):\n\n```yaml\nhawk:\n  type: service\n  id: HawkBundle\\Monolog\\Handler\n  level: error\n```\n\n### Adding User Information to Error Reports:\n\n```php\n$this-\u003ecatcher-\u003esetUser([\n    'name' =\u003e 'user name',\n    'photo' =\u003e 'user photo',\n]);\n\n$this-\u003ecatcher-\u003esetContext([\n    // Additional context information\n]);\n```\n\n### Sending Exceptions Manually:\nTo manually send exceptions, initialize `__construct(\\HawkBundle\\Catcher $catcher)` class via dependency injection (DI), and use the following method:\n\n```php\n$this-\u003ecatcher-\u003esendException($exception);\n```\n\n### Sending Custom Messages:\n\nYou can also send custom messages using the `-\u003esendMessage(...)` method:\n\n```php\n$this-\u003ecatcher-\u003esendMessage(\n    'your message', \n    [\n        // Additional context information\n    ]\n);\n```\n\n### Example: Sending Manually\n\n```php\nprivate $catcher;\n\npublic function __construct(\\HawkBundle\\Catcher $catcher) \n{\n    $this-\u003ecatcher = $catcher;\n}\n\npublic function test()\n{\n    try {\n        // The code where you need to catch the error\n    } catch (\\Exception $exception) {\n        $this-\u003ecatcher-\u003esendException($exception);\n    }\n}\n```\n\n### Example: BeforeSendService Class\n\nIf you want to process or modify error data before sending it to Hawk, you can define a custom service by implementing the `BeforeSendServiceInterface`.\n\n```php\n\u003c?php\n\nnamespace App\\Hawk;\n\nuse Hawk\\EventPayload;\nuse HawkBundle\\Service\\BeforeSendServiceInterface;\n\nclass BeforeSendService implements BeforeSendServiceInterface\n{\n    public function __invoke(EventPayload $eventPayload): ?EventPayload\n    {\n        $user = $eventPayload-\u003egetUser();\n        \n        // Modify or add additional data to the error report\n        if (!empty($user['email'])){\n            unset($user['email']);\n        \n            $eventPayload-\u003esetUser($user);\n        }\n        \n        // Return null to prevent the event from being sent to Hawk\n        if ($eventPayload-\u003egetContext()['skip_sending'] ?? false) {\n            return null;\n        }\n\n        return $eventPayload;\n    }\n}\n```\n\n## Issues and improvements\n\nFeel free to ask questions or improve the project.\n\n## Links\n\nRepository: https://github.com/codex-team/hawk.symfony\n\nReport a bug: https://github.com/codex-team/hawk.symfony/issues\n\nComposer Package: https://packagist.org/packages/codex-team/hawk.symfony\n\nCodeX Team: https://codex.so\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fhawk.symfony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodex-team%2Fhawk.symfony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fhawk.symfony/lists"}