{"id":33990715,"url":"https://github.com/phpnomad/facade","last_synced_at":"2026-06-09T07:31:51.326Z","repository":{"id":244274145,"uuid":"704504243","full_name":"phpnomad/facade","owner":"phpnomad","description":"Static-bound method support for building cleaner SDK-style APIs","archived":false,"fork":false,"pushed_at":"2026-04-10T02:09:50.000Z","size":212,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-10T04:11:58.235Z","etag":null,"topics":["design-pattern","facade","framework","php","phpnomad","platform-agnostic","sdk"],"latest_commit_sha":null,"homepage":"https://phpnomad.com","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/phpnomad.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-13T11:59:13.000Z","updated_at":"2026-04-10T02:09:54.000Z","dependencies_parsed_at":"2024-06-13T19:56:10.209Z","dependency_job_id":"82e6c349-92ef-4a4d-909d-a7516d66452a","html_url":"https://github.com/phpnomad/facade","commit_stats":null,"previous_names":["phpnomad/facade"],"tags_count":1,"template":false,"template_full_name":"phpnomad/repository-template","purl":"pkg:github/phpnomad/facade","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Ffacade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Ffacade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Ffacade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Ffacade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpnomad","download_url":"https://codeload.github.com/phpnomad/facade/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Ffacade/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34096950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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":["design-pattern","facade","framework","php","phpnomad","platform-agnostic","sdk"],"created_at":"2025-12-13T06:27:02.569Z","updated_at":"2026-06-09T07:31:51.321Z","avatar_url":"https://github.com/phpnomad.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phpnomad/facade\n\n[![Latest Version](https://img.shields.io/packagist/v/phpnomad/facade.svg)](https://packagist.org/packages/phpnomad/facade)\n[![Total Downloads](https://img.shields.io/packagist/dt/phpnomad/facade.svg)](https://packagist.org/packages/phpnomad/facade)\n[![PHP Version](https://img.shields.io/packagist/php-v/phpnomad/facade.svg)](https://packagist.org/packages/phpnomad/facade)\n[![License](https://img.shields.io/packagist/l/phpnomad/facade.svg)](https://packagist.org/packages/phpnomad/facade)\n\n`phpnomad/facade` provides the base classes and interfaces for building static-bound service facades in PHPNomad. The abstract `Facade` class resolves its target through the DI container on demand, and the `HasFacades` interface lets an initializer register its facades with the framework during bootstrap. The pattern is how you end up calling `Cache::get($key)` or `Logger::error($message)` from anywhere in your code without wiring up the container at each call site.\n\n## Installation\n\n```bash\ncomposer require phpnomad/facade\n```\n\nMost applications pull this in as a transitive dependency of `phpnomad/core`, which ships concrete facades for cache, events, logging, templates, and URL and path resolution.\n\n## Overview\n\n- `PHPNomad\\Facade\\Abstracts\\Facade` is a generic, container-aware base class. A concrete subclass implements `abstractInstance()` to name the bound interface, and the base pulls the resolved implementation from the DI container when a facade method is called.\n- `PHPNomad\\Facade\\Interfaces\\HasFacades` is the contract initializers implement to advertise their facades. Return an array of facade instances from `getFacades()` and the framework hands each one a container reference during the loader phase.\n- Resolution is lazy. The container is queried when a facade method fires, not when the facade is registered, so services with expensive dependencies stay cheap until something actually calls them.\n- When container resolution throws a `DiException`, the base attempts to log a critical error through `LoggerStrategy` with the failing abstraction and the container reference before rethrowing, so you get a breadcrumb instead of a bare stack trace.\n\nFor working examples of concrete facades built on this base, see the `Facades/` directory in `phpnomad/core` (Cache, Event, Logger, Template, UrlResolver, PathResolver, InstanceProvider).\n\n## Documentation\n\nFull framework documentation lives at [phpnomad.com](https://phpnomad.com).\n\n## License\n\nMIT. See [LICENSE.txt](LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpnomad%2Ffacade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpnomad%2Ffacade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpnomad%2Ffacade/lists"}