{"id":13409110,"url":"https://github.com/wikimedia/at-ease","last_synced_at":"2025-04-06T12:10:37.025Z","repository":{"id":33349546,"uuid":"36994348","full_name":"wikimedia/at-ease","owner":"wikimedia","description":"Safe alternative to PHP's \"@\" error control operator. Mirror from https://gerrit.wikimedia.org/g/at-ease. See https://www.mediawiki.org/wiki/Developer_access for contributing.","archived":false,"fork":false,"pushed_at":"2025-02-17T21:47:45.000Z","size":100,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-30T11:08:32.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.mediawiki.org/wiki/At-ease","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wikimedia.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2015-06-06T20:35:03.000Z","updated_at":"2025-02-17T21:47:48.000Z","dependencies_parsed_at":"2024-03-17T14:28:48.850Z","dependency_job_id":"843fca71-adaa-4b49-90c2-33814529ceaf","html_url":"https://github.com/wikimedia/at-ease","commit_stats":{"total_commits":85,"total_committers":14,"mean_commits":6.071428571428571,"dds":0.5764705882352941,"last_synced_commit":"5641fd79d5c6a6695abd478199bfe71d2458cdf2"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wikimedia%2Fat-ease","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wikimedia%2Fat-ease/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wikimedia%2Fat-ease/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wikimedia%2Fat-ease/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wikimedia","download_url":"https://codeload.github.com/wikimedia/at-ease/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478324,"owners_count":20945266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-07-30T20:00:58.071Z","updated_at":"2025-04-06T12:10:36.998Z","avatar_url":"https://github.com/wikimedia.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"[![Latest Stable Version]](https://packagist.org/packages/wikimedia/at-ease) [![License]](https://packagist.org/packages/wikimedia/at-ease)\n\nat-ease\n=======\n\nat-ease is a PHP library that provides a safe alternative to PHP's\n[@ error control operator][].\n\n`@` is broken when `E_STRICT` is enabled and it causes an unlogged,\nunexplained error if there is a fatal, which is hard to support. The proper\nmethod of handling errors is to actually handle the errors. For example, if\nyou are thinking of using an error suppression operator to suppress an invalid\narray index warning, you should instead perform an `isset()` check on the\narray index before trying to access it. When possible, always prevent PHP\nerrors rather than catching and handling them afterward. It makes the code\nmore understandable and avoids dealing with slow error suppression methods.\n\nHowever, there are some cases where warnings are inevitable, even if you check\nbeforehand, like when accessing files. You can check that the file exists by\nusing `file_exists()` and `is_readable()`, but the file could have been\ndeleted by the time you go to read it. In that case, you can use this library\nto suppress the warnings and prevent PHP from being noisy.\n\n\nUsage\n-----\n\n```php\nuse Wikimedia\\AtEase\\AtEase;\n\n// Suppress warnings in a block of code:\nAtEase::suppressWarnings();\n$content = file_get_contents( 'foobar.txt' );\nAtEase::restoreWarnings();\n\n\n// ..or in a callback function:\nAtEase::quietCall( 'file_get_contents', 'foobar.txt' );\n```\n\nRunning tests\n-------------\n\n    composer install --prefer-dist\n    composer test\n\n\nHistory\n-------\n\nThis library was first introduced in [MediaWiki 1.3][] ([r4261][]). It was\nsplit out of the MediaWiki codebase and published as an independent library\nduring the [MediaWiki 1.26][] development cycle.\n\n\n---\n[@ error control operator]: https://php.net/manual/en/language.operators.errorcontrol.php\n[MediaWiki 1.3]: https://www.mediawiki.org/wiki/MediaWiki_1.3\n[r4261]: https://phabricator.wikimedia.org/rSVN4261\n[MediaWiki 1.26]: https://www.mediawiki.org/wiki/MediaWiki_1.26\n[Latest Stable Version]: https://poser.pugx.org/wikimedia/at-ease/v/stable.svg\n[License]: https://poser.pugx.org/wikimedia/at-ease/license.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwikimedia%2Fat-ease","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwikimedia%2Fat-ease","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwikimedia%2Fat-ease/lists"}