{"id":41477867,"url":"https://github.com/memran/marwa-error-handler","last_synced_at":"2026-04-02T18:00:17.751Z","repository":{"id":311006889,"uuid":"1042057371","full_name":"memran/marwa-error-handler","owner":"memran","description":"PHP error/exception/shutdown handler with optional PSR-3 logger, optional Debugbar, and a professional fallback UI.","archived":false,"fork":false,"pushed_at":"2026-03-29T11:51:29.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-29T14:28:17.002Z","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/memran.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-21T12:21:51.000Z","updated_at":"2026-03-29T11:51:34.000Z","dependencies_parsed_at":"2026-03-16T07:03:56.091Z","dependency_job_id":null,"html_url":"https://github.com/memran/marwa-error-handler","commit_stats":null,"previous_names":["memran/marwa-error-handler"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/memran/marwa-error-handler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memran%2Fmarwa-error-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memran%2Fmarwa-error-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memran%2Fmarwa-error-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memran%2Fmarwa-error-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/memran","download_url":"https://codeload.github.com/memran/marwa-error-handler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memran%2Fmarwa-error-handler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31312744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"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":"2026-01-23T17:11:17.080Z","updated_at":"2026-04-02T18:00:17.729Z","avatar_url":"https://github.com/memran.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# marwa-error-handler\n\n[![Latest Version](https://img.shields.io/packagist/v/memran/marwa-error-handler.svg)](https://packagist.org/packages/memran/marwa-error-handler)\n[![Total Downloads](https://img.shields.io/packagist/dt/memran/marwa-error-handler.svg)](https://packagist.org/packages/memran/marwa-error-handler)\n[![License](https://img.shields.io/packagist/l/memran/marwa-error-handler.svg)](LICENSE)\n[![PHP Version](https://img.shields.io/packagist/php-v/memran/marwa-error-handler.svg)](https://packagist.org/packages/memran/marwa-error-handler)\n[![CI](https://github.com/memran/marwa-error-handler/actions/workflows/ci.yml/badge.svg)](https://github.com/memran/marwa-error-handler/actions/workflows/ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/github/memran/marwa-error-handler.svg)](https://codecov.io/gh/memran/marwa-error-handler)\n[![PHPStan](https://img.shields.io/badge/PHPStan-level%20max-brightgreen.svg)](https://phpstan.org/)\n\nProduction-focused, framework-agnostic PHP error handling with PSR-3 logging, optional debug reporting, and safe fallback rendering for HTTP and CLI applications.\n\n## Requirements\n\n- PHP 8.1 or newer\n- Composer\n- Optional: a PSR-3 compatible logger such as Monolog\n\n## Installation\n\n```bash\ncomposer require memran/marwa-error-handler\n```\n\n## Usage\n\n```php\nuse Marwa\\ErrorHandler\\ErrorHandler;\n\nErrorHandler::bootstrap(\n    appName: 'MyApp',\n    env: 'production',\n    logger: $logger,\n    debugbar: $debugReporter, // optional callable/object reporter\n);\n```\n\nFor manual wiring:\n\n```php\n$handler = new ErrorHandler(appName: 'MyApp', env: 'development');\n$handler-\u003esetLogger($logger);\n$handler-\u003esetDebugbar($debugReporter);\n$handler-\u003eregister();\n```\n\n## Configuration\n\n- `appName`: used in logs and fallback pages.\n- `env`: `development`, `dev`, `local`, and `debug` enable detailed dev output.\n- `logger`: any `Psr\\Log\\LoggerInterface`; logger failures are safely ignored.\n- `debugbar`: optional callable or object with `addThrowable()`, `addException()`, or `addMessage()`.\n- `renderer`: optional custom `RendererInterface` implementation for full control over output.\n\nSafe defaults:\n\n- Production never renders exception details in HTML.\n- CLI output stays concise in production.\n- Request IDs from headers are validated before being echoed.\n\n## Testing\n\n```bash\ncomposer install\ncomposer test\ncomposer test:coverage\n```\n\n## Static Analysis\n\n```bash\ncomposer analyse\ncomposer lint\ncomposer fix\n```\n\nPHPStan runs at max level against `src/`. PHP-CS-Fixer enforces PSR-12-oriented formatting.\n\n## CI/CD\n\nGitHub Actions runs the package on PHP 8.1, 8.2, and 8.3 using the workflow in `.github/workflows/ci.yml`. The pipeline executes formatting checks, static analysis, and PHPUnit.\n\n## Contributing\n\nOpen a focused pull request with a clear summary, test evidence, and notes about any behavior changes. Follow the repository conventions in `AGENTS.md`, keep examples framework-agnostic, and avoid introducing optional integrations as hard runtime dependencies.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemran%2Fmarwa-error-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmemran%2Fmarwa-error-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemran%2Fmarwa-error-handler/lists"}