{"id":20980628,"url":"https://github.com/php-api-clients/resource-generator","last_synced_at":"2025-05-14T15:30:48.106Z","repository":{"id":52422280,"uuid":"64303957","full_name":"php-api-clients/resource-generator","owner":"php-api-clients","description":":factory: Resource from YAML generation tool","archived":false,"fork":false,"pushed_at":"2023-12-15T05:58:08.000Z","size":618,"stargazers_count":2,"open_issues_count":6,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-22T04:06:17.849Z","etag":null,"topics":["hacktoberfest","php","reactphp"],"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/php-api-clients.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2016-07-27T11:44:23.000Z","updated_at":"2020-10-04T20:12:09.000Z","dependencies_parsed_at":"2023-12-15T06:54:42.705Z","dependency_job_id":null,"html_url":"https://github.com/php-api-clients/resource-generator","commit_stats":{"total_commits":264,"total_committers":7,"mean_commits":"37.714285714285715","dds":0.2272727272727273,"last_synced_commit":"f28611d1359978c8bf21595b120b4d0404e85a2c"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-api-clients%2Fresource-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-api-clients%2Fresource-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-api-clients%2Fresource-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-api-clients%2Fresource-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-api-clients","download_url":"https://codeload.github.com/php-api-clients/resource-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254171586,"owners_count":22026467,"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":["hacktoberfest","php","reactphp"],"created_at":"2024-11-19T05:29:24.346Z","updated_at":"2025-05-14T15:30:45.986Z","avatar_url":"https://github.com/php-api-clients.png","language":"PHP","readme":"# API Client Foundation for PHP 7\n\n[![Linux Build Status](https://travis-ci.org/php-api-clients/resource-generator.svg?branch=master)](https://travis-ci.org/php-api-clients/resource-generator)\n[![Windows Build status](https://ci.appveyor.com/api/projects/status/dvcu9l8rm6shy7t3?svg=true)](https://ci.appveyor.com/project/php-api-clients/resource-generator)\n[![Latest Stable Version](https://poser.pugx.org/api-clients/resource-generator/v/stable.png)](https://packagist.org/packages/api-clients/resource-generator)\n[![Total Downloads](https://poser.pugx.org/api-clients/resource-generator/downloads.png)](https://packagist.org/packages/api-clients/resource-generator)\n[![Code Coverage](https://scrutinizer-ci.com/g/php-api-clients/resource-generator/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/php-api-clients/resource-generator/?branch=master)\n[![License](https://poser.pugx.org/api-clients/resource-generator/license.png)](https://packagist.org/packages/api-clients/resource-generator)\n[![PHP 7 ready](http://php7ready.timesplinter.ch/php-api-clients/resource-generator/badge.svg)](https://appveyor-ci.org/php-api-clients/resource-generator)\n\n# Goals\n\n* Tool for easy wireframing of resources for `wyrihaximus/api-client` based API clients\n\n# Installation\n\nTo install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.\n\n```\ncomposer require api-clients/resource-generator \n```\n\n# Usage\n\nPas a `definition` [`YAML`](#YAML) file.\n\n```\n./vendor/bin/api-client-resource-generator [definition]\n```\n\nFor example: \n\n```\n./vendor/bin/api-client-resource-generator ./yaml/project.yml\n```\n\n# YAML\n\nThe [`YAML`](https://en.wikipedia.org/wiki/YAML) format allows for quick and easy generation of resources, empty resources, and resource tests. The spec consists out of two or more files. \n\n## `resource.yaml`\n\nFirst there is the `resource.yml` file with the meta data regarding all resources:\n\n```YAML\nyaml_location: yaml                        # The location where the YAML files for the Resources are \napi_settings: Example\\Client\\ApiSettings   # API Settings file location\nsrc:                                       # SRC \n  path: src/Resources                      # Path where the resources should be placed\n  namespace: Example\\Client\\Resource       # The namespace for the resources\ntests:                                     # TESTS\n  path: tests/Resources                    # Path where the resources tests should be placed\n  namespace: Example\\Tests\\Client\\Resource # The namespace for the tests\n```\n\n## `yaml/project.yaml`\n\nThe following `YAML` is an example resource file:\n\n```YAML\nclass: Project                             # Resource classname\nproperties:                                # The resource's properties\n  id: int                                  # Simple id field with type int\n  name: string                             # Any scalar types or classes work\n  plugins: SplObjectStorage                #\n  builds:                                  # But differet types `special` properties are supported.\n    type: array                            # For example the collection expects the type to be an array\n    annotations:                           # and it uses an annotation name `collection` to     \n      collection: Project\\Build            # transform all items in the array to the specified resource.\n  latestBuild:                             # Another supported annotation is `nested`, `nested` allows you to\n    type: Project\\Build                    # turn a properties that would otherwise be an array into a\n    annotations:                           # resource. With it's own properties and methods\n      nested: Project\\Build                #\n  updated:                                 # Normally all methods are generated to their camelCase property name\n    method: updatedAt                      # but with `method` you can specify a custom method\n    type: DateTimeInterface                # When for example dealing with time, you can specify to return an interface\n    wrap: DateTimeImmutable                # while wrapping the value in a concrete class\n```\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Cees-Jan Kiewiet\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-api-clients%2Fresource-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-api-clients%2Fresource-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-api-clients%2Fresource-generator/lists"}