{"id":25228939,"url":"https://github.com/ajthinking/anything","last_synced_at":"2025-10-26T06:31:19.434Z","repository":{"id":57680736,"uuid":"494776113","full_name":"ajthinking/anything","owner":"ajthinking","description":"tinkerwell driven development | schrödingers public API | True TDD","archived":false,"fork":false,"pushed_at":"2023-09-11T05:39:41.000Z","size":43,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-13T23:51:39.361Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/ajthinking.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-05-21T12:24:12.000Z","updated_at":"2023-04-06T11:48:46.000Z","dependencies_parsed_at":"2023-02-16T04:16:14.599Z","dependency_job_id":null,"html_url":"https://github.com/ajthinking/anything","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":"spatie/package-skeleton-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajthinking%2Fanything","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajthinking%2Fanything/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajthinking%2Fanything/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajthinking%2Fanything/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajthinking","download_url":"https://codeload.github.com/ajthinking/anything/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238281140,"owners_count":19446078,"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":"2025-02-11T10:46:27.707Z","updated_at":"2025-10-26T06:31:19.139Z","avatar_url":"https://github.com/ajthinking.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# *Anything!* 💫\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/ajthinking/anything.svg?style=flat-square)](https://packagist.org/packages/ajthinking/anything)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/ajthinking/anything/run-tests?label=tests)](https://github.com/ajthinking/anything/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/ajthinking/anything/Check%20\u0026%20fix%20styling?label=code%20style)](https://github.com/ajthinking/anything/actions?query=workflow%3A\"Check+%26+fix+styling\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/ajthinking/anything.svg?style=flat-square)](https://packagist.org/packages/ajthinking/anything)\n\nImagine public API:s and make it so - a TDD and sketch toy for Laravel projects :star_struck:\n\n![github_readme_gif](https://user-images.githubusercontent.com/3457668/171365478-c621c14b-1d98-4ede-ad93-a92723e6ff31.gif)\n\n## Getting started\n\nInstall and enable like so:\n```bash\ncomposer require ajthinking/anything --dev\nphp artisan anything:on\n```\n\nThen, flesh out your idea and execute it in a console context. Lets say we want to build a git client:\n```php\n// This class does not exist, yet\nApp\\Support\\Git::client()\n  -\u003epull()\n  -\u003eadd('*')\n  -\u003enah()\n  -\u003ewip()\n  -\u003eunwip()\n  -\u003ecommit('message')\n  -\u003epush()\n  -\u003ebuild() // \u003c-- creates the class!\n```\nThe last method call `-\u003ebuild()` will create this class for you along with all the method stubs:\n\n```php\n\u003c?php\n\nnamespace App\\Support;\n\nclass Git\n{\n    public static function client()\n    {\n        return new static();\n    }\n    \n    public function pull()\n    {\n        return $this;\n    }\n    \n    public function add()\n    {\n        return $this;\n    }\n\n\t// ...\n}\n```\n\nWhen referenced statically like above the first call will typically spawn a static method. However, if the class name contains `Facades\\` lets say `App\\Facades\\Zonda` we will instead make it an instance method and create a facade next to it:\n\n```php\n\u003c?php\n\nnamespace App\\Support\\Facades;\n\nuse Illuminate\\Support\\Facades\\Facade;\n\nclass Zonda extends Facade\n{\n    protected static function getFacadeAccessor()\n    {\n        return 'App\\\\Zonda';\n    }\n}\n```\n\nFinally, make sure to clean up by discarding the change in `bootstrap/app.php` with git, or by running\n`php artisan anything:off`\n\n## Gotchas\nThis experiment comes with some limitations. \n\n* `anything:on/off` commands it makes a little intrusion in your `bootstrap/app.php` to temporary swap out the console kernel. It assumes you have not made any major modifications to this file.\n* it will only work for classes in the `App` namespace\n* method arguments are currently ignored\n* assumes everything returns `$this`\n* when using in tests, make sure your test case uses `CreatesApplication`. This might not always be the case for unit test setups\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajthinking%2Fanything","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajthinking%2Fanything","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajthinking%2Fanything/lists"}