{"id":20463820,"url":"https://github.com/lorddashme/php-static-class-interface","last_synced_at":"2025-10-25T04:48:26.083Z","repository":{"id":62519031,"uuid":"143983283","full_name":"LordDashMe/php-static-class-interface","owner":"LordDashMe","description":"A simple package that convert a service class into a static-like class.","archived":false,"fork":false,"pushed_at":"2023-04-01T16:10:17.000Z","size":84,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T03:47:10.708Z","etag":null,"topics":["facade","oop","php","static"],"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/LordDashMe.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":"2018-08-08T08:22:07.000Z","updated_at":"2023-04-01T16:10:22.000Z","dependencies_parsed_at":"2025-04-13T08:48:17.223Z","dependency_job_id":null,"html_url":"https://github.com/LordDashMe/php-static-class-interface","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/LordDashMe/php-static-class-interface","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordDashMe%2Fphp-static-class-interface","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordDashMe%2Fphp-static-class-interface/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordDashMe%2Fphp-static-class-interface/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordDashMe%2Fphp-static-class-interface/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LordDashMe","download_url":"https://codeload.github.com/LordDashMe/php-static-class-interface/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordDashMe%2Fphp-static-class-interface/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280906496,"owners_count":26411413,"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-10-25T02:00:06.499Z","response_time":81,"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":["facade","oop","php","static"],"created_at":"2024-11-15T13:13:12.773Z","updated_at":"2025-10-25T04:48:26.051Z","avatar_url":"https://github.com/LordDashMe.png","language":"PHP","readme":"# PHP Static Class Interface \n\nA simple package that convert a service class into a static-like class.\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/LordDashMe/php-static-class-interface.svg?style=flat-square)](https://packagist.org/packages/LordDashMe/php-static-class-interface) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.0-8892BF.svg?style=flat-square)](https://php.net/) [![Coverage Status](https://img.shields.io/coveralls/LordDashMe/php-static-class-interface/master.svg?style=flat-square)](https://coveralls.io/github/LordDashMe/php-static-class-interface?branch=master)\n\n## Requirement(s)\n\n- PHP version from 7.0.* up to latest.\n\n## Install\n\n### via Composer\n\n- Use the command below to install the package via composer:\n\n```txt\ncomposer require lorddashme/php-static-class-interface\n```\n\n### via Native Way\n\n- You can also use this package without composer, just clone this repository and import all the important class:\n\n```php\n\u003c?php\n\ninclude __DIR__ . '/src/Exception/FacadeException.php';\ninclude __DIR__ . '/src/Exception/ClassNamespaceResolver.php';\ninclude __DIR__ . '/src/Exception/StaticClassAccessor.php';\ninclude __DIR__ . '/src/Facade.php';\n\nuse LordDashMe\\StaticClassInterface\\Facade;\n\nclass ServiceClassFacade extends Facade \n{\n    protected static function getStaticClassAccessor()\n    {\n        return '\\Namespace\\ServiceClass';\n    }\n}\n```\n\n## Usage\n\n- You can start using the package without any configuration. Assuming the package was installed via Composer.\n\n- Create a new class that will represent as the Static class of the Service class. \n\n- Override the ```getStaticClassAccessor()``` and set the namespace of the target Service class.\n\n- Below are the simple implementation of the package:\n\n```php\n\u003c?php\n\ninclude __DIR__  . '/vendor/autoload.php';\n\nnamespace Demo\\MyClass;\n\n// Import the main class of the package.\nuse LordDashMe\\StaticClassInterface\\Facade;\n\n// This is the original service class.\nclass ServiceClass\n{\n    public function testService($context)\n    {\n        echo 'Hello World ' . $context . '!';\n    }\n}\n\n// This is the mimic service class that can now access like static class.\nclass ServiceClassFacade extends Facade\n{\n    protected static function getStaticClassAccessor()\n    {\n        // The namespace of the Service Class that will convert\n        // into a \"static\" like class.\n        return '\\Demo\\MyClass\\ServiceClass';\n    }\n}\n\n// This is the Service Class.\n$service = new ServiceClass();\n$service-\u003etestService('ServiceClass'); // echo Hello World ServiceClass!\n\n// And we can now use the Service Class like a \"static\" class implementation.\nServiceClassFacade::testService('ServiceFacadeClass'); // echo Hello World ServiceFacadeClass!\n```\n\n## License\n\nThis package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florddashme%2Fphp-static-class-interface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Florddashme%2Fphp-static-class-interface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florddashme%2Fphp-static-class-interface/lists"}