{"id":37012972,"url":"https://github.com/conceptbyte/null-object","last_synced_at":"2026-01-14T01:15:32.241Z","repository":{"id":56957147,"uuid":"64120182","full_name":"conceptbyte/null-object","owner":"conceptbyte","description":"A silent null object for PHP","archived":false,"fork":false,"pushed_at":"2016-07-25T09:22:15.000Z","size":4,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-09T21:14:36.352Z","etag":null,"topics":["null","nullobject","php"],"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/conceptbyte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-25T09:09:09.000Z","updated_at":"2018-04-02T18:18:17.000Z","dependencies_parsed_at":"2022-08-21T08:50:55.076Z","dependency_job_id":null,"html_url":"https://github.com/conceptbyte/null-object","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/conceptbyte/null-object","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conceptbyte%2Fnull-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conceptbyte%2Fnull-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conceptbyte%2Fnull-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conceptbyte%2Fnull-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/conceptbyte","download_url":"https://codeload.github.com/conceptbyte/null-object/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conceptbyte%2Fnull-object/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"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":["null","nullobject","php"],"created_at":"2026-01-14T01:15:31.637Z","updated_at":"2026-01-14T01:15:32.233Z","avatar_url":"https://github.com/conceptbyte.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Null Object for PHP\n\nAllows the user to call the null object which handles all calls silently and returns sensible defaults.\nThe returned object can be type cast to return the following values:\n\n- String - \"\"\n- Integer - 0\n- Float or Real - 0.0\n- Array - []\n- Boolean  - False\n\n## Installation\n\nRun the following to install:\n\n```composer require conceptbyte/null-object```\n\n## Usage\nThe null object can be created in one of the following methods:\n- Named constructor: ```NullObject::create()```\n- Helper function: ```no()```\n\nBoth will return an instance of the class.\nCalls to any methods or members on this class will return\nthe defaults as mentioned in the section above.\n\n## Example\n```php\n(string) NullObject::create()-\u003exyz; // \"\"\n(bool) NullObject::create()-\u003eabc(); // false\n(int) no()-\u003exyz; // 0\n(float) no()-\u003eabc(); // 0.0\n```\n\n## Quirks\nPHP does not allow modifying the behaviour of casting a class to boolean.\nA simple hack is to use the SimpleXMLElement class which can return false when passed\nan empty XML tag.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconceptbyte%2Fnull-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconceptbyte%2Fnull-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconceptbyte%2Fnull-object/lists"}