{"id":19144386,"url":"https://github.com/piotrpress/singleton","last_synced_at":"2026-02-13T15:32:40.471Z","repository":{"id":57041807,"uuid":"427702460","full_name":"PiotrPress/singleton","owner":"PiotrPress","description":"This library is a Singleton (anti)pattern implementation using a Traits with a support for an Object Inheritance and passing parameters to the constructor.","archived":false,"fork":false,"pushed_at":"2024-09-15T20:35:54.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-13T03:57:34.626Z","etag":null,"topics":["antipattern","inheritance","object-inheritance","pattern","singleton","singleton-pattern","singletonpattern","singletons","trait","traits"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PiotrPress.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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}},"created_at":"2021-11-13T15:31:41.000Z","updated_at":"2024-09-15T20:35:33.000Z","dependencies_parsed_at":"2025-01-03T15:49:28.206Z","dependency_job_id":"9f492720-86cb-4d13-a888-c7d03917c031","html_url":"https://github.com/PiotrPress/singleton","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"bd9054bf04c056e935a6b5fde33241233214d1fb"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/PiotrPress/singleton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiotrPress%2Fsingleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiotrPress%2Fsingleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiotrPress%2Fsingleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiotrPress%2Fsingleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PiotrPress","download_url":"https://codeload.github.com/PiotrPress/singleton/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiotrPress%2Fsingleton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273372583,"owners_count":25093711,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["antipattern","inheritance","object-inheritance","pattern","singleton","singleton-pattern","singletonpattern","singletons","trait","traits"],"created_at":"2024-11-09T07:34:43.942Z","updated_at":"2026-02-13T15:32:40.415Z","avatar_url":"https://github.com/PiotrPress.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Singleton\n\nThis library is a [Singleton](https://en.wikipedia.org/wiki/Singleton_pattern) (anti)pattern implementation using a [Traits](https://www.php.net/manual/en/language.oop5.traits.php) with a support for an [Object Inheritance](https://www.php.net/manual/en/language.oop5.inheritance.php) and passing parameters to the constructor.\n\n## Installation\n\n```console\ncomposer require piotrpress/singleton\n```\n\n## Usage\n\n```php\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse PiotrPress\\Singleton;\n\nclass ExampleParent {\n    use Singleton;\n}\n\nclass Example extends ExampleParent {\n    protected function __construct( $arg ) {}\n}\n\nExample::getInstance( 'arg' );\n```\n\n## Requirements\n\nPHP \u003e= `7.4` version.\n\n## License\n\n[GPL3.0](license.txt)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotrpress%2Fsingleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiotrpress%2Fsingleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotrpress%2Fsingleton/lists"}