{"id":15813515,"url":"https://github.com/ybelenko/petstore-server-slim4","last_synced_at":"2025-10-05T08:48:04.230Z","repository":{"id":200276769,"uuid":"469936781","full_name":"ybelenko/petstore-server-slim4","owner":"ybelenko","description":null,"archived":false,"fork":false,"pushed_at":"2022-03-14T23:57:05.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-12T06:37:36.164Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ybelenko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-03-14T23:24:15.000Z","updated_at":"2022-03-14T23:52:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"781d5a53-cca5-40b7-82f3-20525b9dbce4","html_url":"https://github.com/ybelenko/petstore-server-slim4","commit_stats":null,"previous_names":["ybelenko/petstore-server-slim4"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ybelenko/petstore-server-slim4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybelenko%2Fpetstore-server-slim4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybelenko%2Fpetstore-server-slim4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybelenko%2Fpetstore-server-slim4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybelenko%2Fpetstore-server-slim4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ybelenko","download_url":"https://codeload.github.com/ybelenko/petstore-server-slim4/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybelenko%2Fpetstore-server-slim4/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278431490,"owners_count":25985679,"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-05T02:00:06.059Z","response_time":54,"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":[],"created_at":"2024-10-05T04:02:48.365Z","updated_at":"2025-10-05T08:48:04.196Z","avatar_url":"https://github.com/ybelenko.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-base - PHP Slim 4 Server library for OpenAPI Petstore\n\n* [OpenAPI Generator](https://openapi-generator.tech)\n* [Slim 4 Documentation](https://www.slimframework.com/docs/v4/)\n\nThis server has been generated with [Slim PSR-7](https://github.com/slimphp/Slim-Psr7) implementation.\n[PHP-DI](https://php-di.org/doc/frameworks/slim.html) package used as dependency container.\n\n## Requirements\n\n* Web server with URL rewriting\n* PHP 7.4 or newer\n\nThis package contains `.htaccess` for Apache configuration.\nIf you use another server(Nginx, HHVM, IIS, lighttpd) check out [Web Servers](https://www.slimframework.com/docs/v3/start/web-servers.html) doc.\n\n## Installation via [Composer](https://getcomposer.org/)\n\nNavigate into your project's root directory and execute the bash command shown below.\nThis command downloads the Slim Framework and its third-party dependencies into your project's `vendor/` directory.\n```bash\n$ composer install\n```\n\n## Add configs\n\n[PHP-DI package](https://php-di.org/doc/getting-started.html) helps to decouple configuration from implementation. App loads configuration files in straight order(`$env` can be `prod` or `dev`):\n1. `config/$env/default.inc.php` (contains safe values, can be committed to vcs)\n2. `config/$env/config.inc.php` (user config, excluded from vcs, can contain sensitive values, passwords etc.)\n3. `lib/App/RegisterDependencies.php`\n\n## Start devserver\n\nRun the following command in terminal to start localhost web server, assuming `./php-slim-server/public/` is public-accessible directory with `index.php` file:\n```bash\n$ php -S localhost:8888 -t php-slim-server/public\n```\n\u003e **Warning** This web server was designed to aid application development.\n\u003e It may also be useful for testing purposes or for application demonstrations that are run in controlled environments.\n\u003e It is not intended to be a full-featured web server. It should not be used on a public network.\n\n## Tests\n\n### PHPUnit\n\nThis package uses PHPUnit 8 or 9(depends from your PHP version) for unit testing.\n[Test folder](tests) contains templates which you can fill with real test assertions.\nHow to write tests read at [2. Writing Tests for PHPUnit - PHPUnit 8.5 Manual](https://phpunit.readthedocs.io/en/8.5/writing-tests-for-phpunit.html).\n\n#### Run\n\nCommand | Target\n---- | ----\n`$ composer test` | All tests\n`$ composer test-apis` | Apis tests\n`$ composer test-models` | Models tests\n\n#### Config\n\nPackage contains fully functional config `./phpunit.xml.dist` file. Create `./phpunit.xml` in root folder to override it.\n\nQuote from [3. The Command-Line Test Runner — PHPUnit 8.5 Manual](https://phpunit.readthedocs.io/en/8.5/textui.html#command-line-options):\n\n\u003e If phpunit.xml or phpunit.xml.dist (in that order) exist in the current working directory and --configuration is not used, the configuration will be automatically read from that file.\n\n### PHP CodeSniffer\n\n[PHP CodeSniffer Documentation](https://github.com/squizlabs/PHP_CodeSniffer/wiki). This tool helps to follow coding style and avoid common PHP coding mistakes.\n\n#### Run\n\n```bash\n$ composer phpcs\n```\n\n#### Config\n\nPackage contains fully functional config `./phpcs.xml.dist` file. It checks source code against PSR-1 and PSR-2 coding standards.\nCreate `./phpcs.xml` in root folder to override it. More info at [Using a Default Configuration File](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file)\n\n### PHPLint\n\n[PHPLint Documentation](https://github.com/overtrue/phplint). Checks PHP syntax only.\n\n#### Run\n\n```bash\n$ composer phplint\n```\n\n## Show errors\n\nSwitch your app environment to development in `public/.htaccess` file:\n```ini\n## .htaccess\n\u003cIfModule mod_env.c\u003e\n    SetEnv APP_ENV 'development'\n\u003c/IfModule\u003e\n```\n\n## API Endpoints\n\nAll URIs are relative to *http://petstore.swagger.io/v2*\n\n\u003e Important! Do not modify abstract API controllers directly! Instead extend them by implementation classes like:\n\n```php\n// src/Api/PetApi.php\n\nnamespace OpenAPIServer\\Api;\n\nuse OpenAPIServer\\Api\\AbstractPetApi;\nuse Psr\\Http\\Message\\ServerRequestInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\nclass PetApi extends AbstractPetApi\n{\n    public function addPet(\n        ServerRequestInterface $request,\n        ResponseInterface $response\n    ): ResponseInterface {\n        // your implementation of addPet method here\n    }\n}\n```\n\nWhen you need to inject dependencies into API controller check [PHP-DI - Controllers as services](https://github.com/PHP-DI/Slim-Bridge#controllers-as-services) guide.\n\nPlace all your implementation classes in `./src` folder accordingly.\nFor instance, when abstract class located at `./lib/Api/AbstractPetApi.php` you need to create implementation class at `./src/Api/PetApi.php`.\n\nClass | Method | HTTP request | Description\n------------ | ------------- | ------------- | -------------\n*AbstractPetApi* | **addPet** | **POST** /pet | Add a new pet to the store\n*AbstractPetApi* | **findPetsByStatus** | **GET** /pet/findByStatus | Finds Pets by status\n*AbstractPetApi* | **findPetsByTags** | **GET** /pet/findByTags | Finds Pets by tags\n*AbstractPetApi* | **updatePet** | **PUT** /pet | Update an existing pet\n*AbstractPetApi* | **deletePet** | **DELETE** /pet/{petId} | Deletes a pet\n*AbstractPetApi* | **getPetById** | **GET** /pet/{petId} | Find pet by ID\n*AbstractPetApi* | **updatePetWithForm** | **POST** /pet/{petId} | Updates a pet in the store with form data\n*AbstractPetApi* | **uploadFile** | **POST** /pet/{petId}/uploadImage | uploads an image\n*AbstractStoreApi* | **getInventory** | **GET** /store/inventory | Returns pet inventories by status\n*AbstractStoreApi* | **placeOrder** | **POST** /store/order | Place an order for a pet\n*AbstractStoreApi* | **deleteOrder** | **DELETE** /store/order/{orderId} | Delete purchase order by ID\n*AbstractStoreApi* | **getOrderById** | **GET** /store/order/{orderId} | Find purchase order by ID\n*AbstractUserApi* | **createUser** | **POST** /user | Create user\n*AbstractUserApi* | **createUsersWithArrayInput** | **POST** /user/createWithArray | Creates list of users with given input array\n*AbstractUserApi* | **createUsersWithListInput** | **POST** /user/createWithList | Creates list of users with given input array\n*AbstractUserApi* | **loginUser** | **GET** /user/login | Logs user into the system\n*AbstractUserApi* | **logoutUser** | **GET** /user/logout | Logs out current logged in user session\n*AbstractUserApi* | **deleteUser** | **DELETE** /user/{username} | Delete user\n*AbstractUserApi* | **getUserByName** | **GET** /user/{username} | Get user by user name\n*AbstractUserApi* | **updateUser** | **PUT** /user/{username} | Updated user\n\n\n## Models\n\n* OpenAPIServer\\Model\\ApiResponse\n* OpenAPIServer\\Model\\Category\n* OpenAPIServer\\Model\\Order\n* OpenAPIServer\\Model\\Pet\n* OpenAPIServer\\Model\\Tag\n* OpenAPIServer\\Model\\User\n\n\n## Authentication\n\n### Security schema `api_key`\n\u003e Important! To make ApiKey authentication work you need to extend [\\OpenAPIServer\\Auth\\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\\OpenAPIServer\\Auth\\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class.\n\n### Security schema `petstore_auth`\n\u003e Important! To make OAuth authentication work you need to extend [\\OpenAPIServer\\Auth\\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\\OpenAPIServer\\Auth\\OAuthAuthenticator](./src/Auth/OAuthAuthenticator.php) class.\n\nScope list:\n* `write:pets` - modify pets in your account\n* `read:pets` - read your pets\n\n### Advanced middleware configuration\nRef to used Slim Token Middleware [dyorg/slim-token-authentication](https://github.com/dyorg/slim-token-authentication/tree/1.x#readme)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fybelenko%2Fpetstore-server-slim4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fybelenko%2Fpetstore-server-slim4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fybelenko%2Fpetstore-server-slim4/lists"}