Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
basic setup
Browse files Browse the repository at this point in the history
  • Loading branch information
cebe committed Nov 28, 2018
1 parent 26cf66e commit 7a7335c
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/vendor
/composer.lock


/.php_cs.cache
17 changes: 17 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'general_phpdoc_annotation_remove' => ['annotations' => ['author']],
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => <<<COMMENT
@copyright Copyright (c) 2018 Carsten Brandt <mail@cebe.cc> and contributors
@license https://github.com/cebe/yii2-openapi/blob/master/LICENSE
COMMENT
]
])
;

12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: php

php:
- '7.1'
- '7.2'
- '7.3'
- nightly

install: make install
script:
- make test
- if [[ $TRAVIS_PHP_VERSION = "7.3" || $TRAVIS_PHP_VERSION = "nightly" ]]; then true; else make check-style; fi
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Carsten Brandt
Copyright (c) 2018 Carsten Brandt <mail@cebe.cc> and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

all:

check-style:
vendor/bin/php-cs-fixer fix src/ --diff --dry-run

fix-style:
vendor/bin/indent --tabs composer.json
vendor/bin/indent --spaces .php_cs.dist
vendor/bin/php-cs-fixer fix src/ --diff

install:
composer install --prefer-dist --no-interaction

test:
vendor/bin/phpunit

.PHONY: all check-style fix-style install test

22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,38 @@
REST API application generator for Yii2, openapi 3.0 YAML -> Yii2

[![Latest Stable Version](https://poser.pugx.org/cebe/yii2-openapi/v/stable)](https://packagist.org/packages/cebe/yii2-openapi)
[![License](https://poser.pugx.org/cebe/yii2-openapi/license)](https://packagist.org/packages/cebe/yii2-openapi)

## what should this do?

Input: [OpenAPI 3.0 YAML](https://github.com/OAI/OpenAPI-Specification#the-openapi-specification)

Output: Controllers, Models, database schema

## Features

This library is currently work in progress, current features are checked here when ready:

- [ ] generate Controllers + Actions
- [ ] generate Models
- [ ] generate Database migration

- [ ] update Database and models when API schema changes

## Install

composer require cebe/php-openapi:~0.9@beta

## Requirements

- PHP 7.1 or higher


# Support

Professional support, consulting as well as software development services are available:

https://www.cebe.cc/en/contact

Development of this library is sponsored by [cebe.cloud "Your Professional Deployment Platform"](https://cebe.cloud).
45 changes: 45 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "cebe/yii2-openapi",
"description": "Generate full REST API application from OpenAPI 3 specification.",
"keywords": ["yii2", "rest", "openapi"],
"homepage": "https://github.com/cebe/yii2-openapi#readme",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Carsten Brandt",
"email": "mail@cebe.cc",
"homepage": "https://cebe.cc/",
"role": "Creator"
}
],
"support": {
"issues": "https://github.com/cebe/yii2-openapi/issues",
"source": "https://github.com/cebe/yii2-openapi"
},
"require": {
"php": ">=7.1.0",
"cebe/php-openapi": "0.9@dev",
"yiisoft/yii2-gii": "~2.0.0"
},
"require-dev": {
"cebe/indent": "*",
"friendsofphp/php-cs-fixer": "~2.13.1",
"phpunit/phpunit": "^6.5"
},
"autoload": {
"psr-4": {
"cebe\\yii2openapi\\": "src/"
}
},
"config": {
"platform": {
"php": "7.1.3"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}

0 comments on commit 7a7335c

Please sign in to comment.