From 0df383dace9d310fdfc48c68020841d45a21b9ba Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Wed, 2 Mar 2022 15:40:38 +0100 Subject: [PATCH] Support Laravel 9 --- .gitattributes | 2 -- .styleci.yml | 4 ---- .travis.yml | 19 ------------------- CHANGELOG.md | 6 ++++++ Dockerfile | 21 +++++++++++++++------ Makefile | 4 ++-- README.md | 4 ---- composer.json | 6 +++--- docker-compose.yml | 7 ++++--- 9 files changed, 30 insertions(+), 43 deletions(-) delete mode 100644 .styleci.yml delete mode 100644 .travis.yml diff --git a/.gitattributes b/.gitattributes index 3e90c2b..34f888e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,8 +4,6 @@ .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore -.styleci.yml export-ignore -.travis.yml export-ignore docker-compose.yml export-ignore Dockerfile export-ignore Makefile export-ignore diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index 062602b..0000000 --- a/.styleci.yml +++ /dev/null @@ -1,4 +0,0 @@ -preset: laravel -enabled: - - no_superfluous_phpdoc_tags -risky: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 23f7d11..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: php - -php: - - 7.3 - - 7.4 - - 8.0 - -install: - - composer install --prefer-dist --no-interaction --no-suggest - -before_script: - - if [ $TRAVIS_PHP_VERSION = "8.0" ]; then pecl install pcov; fi - -script: - - vendor/bin/phpstan analyse - - vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/CHANGELOG.md b/CHANGELOG.md index 281db8f..2c2dd14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## v1.5.0 + +### Added + +- Support Laravel 9 + ## v1.4.0 ### Added diff --git a/Dockerfile b/Dockerfile index 6a56b35..5e6f280 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,9 @@ -FROM php:7.4-cli +FROM php:8.0-cli WORKDIR /var/www +COPY --from=composer /usr/bin/composer /usr/bin/composer + RUN apt-get update && apt-get install -y \ git \ libzip-dev \ @@ -9,10 +11,17 @@ RUN apt-get update && apt-get install -y \ && docker-php-ext-configure zip \ && docker-php-ext-install \ zip \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* \ + && pecl install xdebug \ + && docker-php-ext-enable xdebug -RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer -ENV COMPOSER_ALLOW_SUPERUSER=1 +ARG USER +ARG USER_ID +ARG GROUP_ID -RUN pecl install xdebug \ - && docker-php-ext-enable xdebug +RUN if [ ${USER_ID:-0} -ne 0 ] && [ ${GROUP_ID:-0} -ne 0 ]; then \ + groupadd --force --gid ${GROUP_ID} ${USER} &&\ + useradd --no-log-init --uid ${USER_ID} --gid ${GROUP_ID} ${USER} \ +;fi + +USER ${USER} diff --git a/Makefile b/Makefile index 0a81aa0..5a08b41 100644 --- a/Makefile +++ b/Makefile @@ -5,14 +5,14 @@ it: vendor stan test ## Run all quality tools .PHONY: help help: ## Displays this list of targets with descriptions - @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ": .*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' .PHONY: setup setup: dc-build vendor ## Setup the local environment .PHONY: dc-build dc-build: ## Build the local dev image - docker-compose build --pull --build-arg USER_ID=$(shell id -u) --build-arg GROUP_ID=$(shell id -g) + docker-compose build --build-arg USER_ID=$(shell id -u) --build-arg GROUP_ID=$(shell id -g) .PHONY: up up: ## Bring up the containers diff --git a/README.md b/README.md index 713b5fc..a75d7e6 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,6 @@ Strictly typed replacements for the default Laravel generator stubs -[![Build Status](https://travis-ci.com/mll-lab/laravel-strict-stubs.svg?branch=master)](https://travis-ci.com/mll-lab/laravel-strict-stubs) -[![codecov](https://codecov.io/gh/mll-lab/laravel-strict-stubs/branch/master/graph/badge.svg)](https://codecov.io/gh/mll-lab/laravel-strict-stubs) -[![StyleCI](https://github.styleci.io/repos/332712264/shield?branch=master)](https://github.styleci.io/repos/332712264) - [![GitHub license](https://img.shields.io/github/license/mll-lab/laravel-strict-stubs.svg)](https://github.com/mll-lab/laravel-strict-stubs/blob/master/LICENSE) [![Packagist](https://img.shields.io/packagist/v/mll-lab/laravel-strict-stubs.svg)](https://packagist.org/packages/mll-lab/laravel-strict-stubs) [![Packagist](https://img.shields.io/packagist/dt/mll-lab/laravel-strict-stubs.svg)](https://packagist.org/packages/mll-lab/laravel-strict-stubs) diff --git a/composer.json b/composer.json index f7367c3..0a83bf2 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,11 @@ ], "require": { "php": "^7.2 || ^8", - "illuminate/contracts": "^6 || ^7 || ^8" + "illuminate/contracts": "^6 || ^7 || ^8 || ^9" }, "require-dev": { - "orchestra/testbench": "^4 || ^5 || ^6", - "nunomaduro/larastan": "^0.6" + "orchestra/testbench": "^4 || ^5 || ^6 || ^7", + "nunomaduro/larastan": "^0.6 || ^1" }, "autoload": { "psr-4": { diff --git a/docker-compose.yml b/docker-compose.yml index b32b3dc..168be2e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,9 @@ -version: '3.7' - services: php: - build: . + build: + context: . + args: + USER: $USER volumes: - ./:/var/www environment: