#!/bin/sh

wget -O api-docs.json https://finance-api.aio.test/docs/api-docs.json 
docker run --user $(id -u):$(id -g) --rm -w /local/ -v ${PWD}:/local openapitools/openapi-generator-cli generate -v -i api-docs.json -g php -o /local/ -c /local/config.json --template-dir /local/templates 
if [ ! -f vendor/bin/php-cs-fixer ] ; then
	composer install --ignore-platform-reqs --no-plugins --no-scripts
fi
phpcbf .
vendor/bin/php-cs-fixer fix --allow-risky yes
