Skip to content

Commit

Permalink
Release version 3 (cakephp 5 support) (#536)
Browse files Browse the repository at this point in the history
* initial version 3 branch

* Remove deprecated code (#426)

Removes all methods, properties etc. and related documentation that was marked deprecated in 2.x

* WIP

* convert attribute properties to readonly where possible + phpstan fixes

* add constant

* doc updates

* update docs

* Move openapi build logic out of constructor (#469)

* Move openapi build logic out of constructor #454

* set phptsan to version ^1.8.5 to resolve false-positives

* update readme

* Conditional pretty print #472

* Resolve deprecations and notices (#470)

* Resolves notices
* Reduce cyclomatic compexity
* Remove non-executed code and increase coverage for Commands
* Replace depreacted Router::scope with RouteBuilder->scope
* Update github action descriptions

* merge v2.5 into v3 (#483)

* add php 8.2 ci matrix

* Fixture Upgrade for cake 5 compat.

* cleanup test bootstrap file

* fixes broken tests

* debug

* debug

* debug

* debug

* debug

* Support CakePHP 5 dev branch (#516)

Adds support for cakephp 5 and other necessary dependencies.

* Require CakePHP 5 for version 3 (#530)

* Merge master to v3 (#532)

Merge v2.5.8 changes

* update deps and fix static analysis warnings (#535)

* small readme updates

* upgrade to latest swaggerui and redocly

---------

Co-authored-by: Chris Nizzardini <[email protected]>
  • Loading branch information
cnizzardini and Chris Nizzardini authored Jan 11, 2024
1 parent 3950322 commit 3f803da
Show file tree
Hide file tree
Showing 160 changed files with 1,536 additions and 3,092 deletions.
50 changes: 29 additions & 21 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@ on:

jobs:
build:
name: PHP ${{ matrix.php-versions }} Test
name: PHP 8.3 Test / Analysis
runs-on: ubuntu-latest
strategy:
matrix:
operating-system: [ ubuntu-20.04 ]
php-versions: ['8.0', '8.1', '8.2']
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: 8.3
extensions: mbstring, intl, xdebug

- name: PHP Version
Expand All @@ -31,37 +27,48 @@ jobs:
composer validate
composer install --prefer-dist --no-progress
- name: Test Suite (8.0 only)
if: ${{ matrix.php-versions != '8.2' }}
- name: Test Suite + Static Analysis
run: |
composer test
composer analyze
echo ${{ matrix.php-versions }}
- name: Test Suite + Static Analysis (8.1 only)
if: ${{ matrix.php-versions == '8.2' }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
coverage:
name: PHP 8.1 Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, intl

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer analyze
echo ${{ matrix.php-versions }}
composer self-update
composer validate
composer install --prefer-dist --no-progress
- name: Upload coverage results to Coveralls (8.1 only)
if: ${{ matrix.php-versions == '8.2' }}
- name: Code Coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
export CODECOVERAGE=1 && vendor/bin/phpunit --verbose --coverage-clover=clover.xml
php-coveralls --coverage_clover=clover.xml -v
export CODECOVERAGE=1 && vendor/bin/phpunit --coverage-clover=clover.xml
php-coveralls --coverage_clover=clover.xml -v
#
# CakePHP version compatability
#
compatibility:
cakephp_version_compatibility:
name: CakePHP ${{ matrix.version }} Test
runs-on: ubuntu-latest
strategy:
matrix:
version: ['~4.2.0', '~4.3.0', '~4.4', '~4.5']
version: ['~5.0']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -82,3 +89,4 @@ jobs:
composer require cakephp/cakephp:${{matrix.version}} --no-update
composer install --prefer-dist --no-progress
composer test
9 changes: 2 additions & 7 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,16 @@ on:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
operating-system: [ ubuntu-20.04 ]
php-versions: ['8.1']

name: Upload coverage report
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: 8.1
extensions: mbstring, intl, xdebug

- name: Install dependencies
Expand Down
90 changes: 38 additions & 52 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/swagger_bake.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
'json' => '/webroot/swagger.json',
'webPath' => '/swagger.json',
'hotReload' => Configure::read('debug'),
'jsonOptions' => JSON_PRETTY_PRINT,
'jsonOptions' => Configure::read('debug') ? JSON_PRETTY_PRINT : JSON_UNESCAPED_UNICODE,
/*
'editActionMethods' => ['PATCH'],
'requestAccepts' => [
Expand Down
37 changes: 22 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
{
"name": "cnizzardini/cakephp-swagger-bake",
"description": "Automatically generate OpenApi, Swagger, and Redoc documentation from your existing code",
"description": "Automatically generate OpenApi, Swagger, and Redoc documentation from your existing cakephp project",
"type": "cakephp-plugin",
"license": "MIT",
"keywords": ["cakephp swagger","cakephp4 swagger","cake swagger"],
"keywords": [
"cakephp swagger",
"cakephp5 swagger",
"cake swagger",
"cakephp openapi",
"cakephp5 openapi",
"cake openapi"
],
"require": {
"php": "^8.0",
"cakephp/cakephp": "^4.2",
"php": "^8.1",
"cakephp/cakephp": "^5.0",
"symfony/yaml": "^5.0",
"phpdocumentor/reflection-docblock": "^5.1",
"thecodingmachine/class-explorer": "^1.1",
"mixerapi/core": "^1.1.2"
"mixerapi/core": "^2.0"
},
"suggest": {
"cakephp/authentication": "Used by SwaggerBake #[OpenApiSecurity]",
"cakephp/bake": "Used by SwaggerBake bake templates",
"friendsofcake/search": "Required by SwaggerBake #[OpenApiSearch]"
"friendsofcake/search": "Required by SwaggerBake #[OpenApiSearch]",
"mixerapi/mixerapi": "Streamline development of your API with MixerAPI"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"friendsofcake/search": "^6.0",
"cakephp/authentication": "^2.0",
"cakephp/cakephp-codesniffer": "^4.2",
"phpstan/phpstan": "^0.12.32",
"phpunit/phpunit": "^10.0",
"friendsofcake/search": "^7.0",
"cakephp/authentication": "^3.0",
"cakephp/cakephp-codesniffer": "^5.0",
"phpstan/phpstan": "^1.8.5",
"phpmd/phpmd": "^2.10",
"cakephp/bake": "^2.1",
"cakephp/debug_kit": "^4.4"
"cakephp/bake": "^3.0",
"cakephp/debug_kit": "^5.0",
"cakephp/migrations": "^4.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 3f803da

Please sign in to comment.