Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Laravel 8.x is supported now (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarampampam authored Sep 9, 2020
1 parent bd1a644 commit 9cd5b7f
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 44 deletions.
35 changes: 21 additions & 14 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,32 @@ assignees: tarampampam

> Tell us what happens instead.
### Steps to reproduce the behavior:

> Put some code example:
>
> ```php
> $some = new \stdClass();
> echo $some;
>
> PHP Catchable fatal error: Object of class stdClass could not be converted to string in Command line code on line 2
> PHP Stack trace:
> PHP 1. {main}() Command line code:0
> ```
### Steps to reproduce

> Describe steps to behavior reproducing.
## System information

> Please, complete the following information:
- PHP version(s): [e.g. `7.2.6`]
- Package version(s): [e.g. `3.3.0`]
Key | Value
----------------------- | ----
PHP version | <!-- e.g. `7.2.6` -->
Current package version | <!-- e.g. `3.6.0` -->
RoadRunner version | <!-- e.g. `1.8.3` -->
Environment | <!-- e.g. `docker`, `local`, `aws` -->

### RoadRunner configuration file content

```yaml
# Paste here your `.rr.yaml` file content
```

### Package configuration file content

```php
# Paste here your `config/roadrunner.php` file content
```

## Additional context

Expand Down
5 changes: 0 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
| Q | A
| ------------- | ---
| Bug fix? | Yes or No
| New feature? | Yes or No

## Description

<!--
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].

## v3.6.0

### Changed

- Laravel `8.x` is supported now
- Minimal Laravel version now is `6.0` (Laravel `5.5` LTS got last security update August 30th, 2020)
- Minimal `spiral/roadrunner` package version now is `1.8`

## v3.5.0

### Added
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM php:7.2.5-alpine
FROM php:7.3.5-alpine

ENV \
COMPOSER_ALLOW_SUPERUSER="1" \
COMPOSER_HOME="/tmp/composer"

COPY --from=composer:1.10.7 /usr/bin/composer /usr/bin/composer
COPY --from=composer:1.10.10 /usr/bin/composer /usr/bin/composer

RUN set -x \
&& apk add --no-cache binutils git \
&& apk add --no-cache --virtual .build-deps autoconf pkgconf make g++ gcc 1>/dev/null \
# install xdebug (for testing with code coverage), but do not enable it
&& pecl install xdebug-2.9.1 1>/dev/null \
&& pecl install xdebug-2.9.6 1>/dev/null \
&& apk del .build-deps \
&& mkdir /src ${COMPOSER_HOME} \
&& composer global require 'hirak/prestissimo' --no-interaction --no-suggest --prefer-dist \
Expand Down
18 changes: 8 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
# Makefile readme (ru): <http://linux.yaroslavl.ru/docs/prog/gnu_make_3-79_russian_manual.html>
# Makefile readme (en): <https://www.gnu.org/software/make/manual/html_node/index.html#SEC_Contents>

dc_bin := $(shell command -v docker-compose 2> /dev/null)

SHELL = /bin/sh
RUN_APP_ARGS = --rm --user "$(shell id -u):$(shell id -g)" app
RUN_APP_ARGS = --rm --user "$(shell id -u):$(shell id -g)"

.PHONY : help build latest install lowest test test-cover clean
.DEFAULT_GOAL : help
Expand All @@ -16,25 +14,25 @@ help: ## Show this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[32m%-14s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

build: ## Build docker images, required for current package environment
$(dc_bin) build
docker-compose build

latest: clean ## Install latest php dependencies
$(dc_bin) run $(RUN_APP_ARGS) composer update -n --ansi --no-suggest --prefer-dist --prefer-stable
docker-compose run $(RUN_APP_ARGS) app composer update -n --ansi --no-suggest --prefer-dist --prefer-stable

install: clean ## Install regular php dependencies
$(dc_bin) run $(RUN_APP_ARGS) composer update -n --prefer-dist --no-interaction --no-suggest
docker-compose run $(RUN_APP_ARGS) app composer update -n --prefer-dist --no-interaction --no-suggest

lowest: clean ## Install lowest php dependencies
$(dc_bin) run $(RUN_APP_ARGS) composer update -n --ansi --no-suggest --prefer-dist --prefer-lowest
docker-compose run $(RUN_APP_ARGS) app composer update -n --ansi --no-suggest --prefer-dist --prefer-lowest

test: ## Execute php tests and linters
$(dc_bin) run $(RUN_APP_ARGS) composer test
docker-compose run $(RUN_APP_ARGS) app composer test

test-cover: ## Execute php tests with coverage
$(dc_bin) run --rm --user "0:0" app sh -c 'docker-php-ext-enable xdebug && su $(shell whoami) -s /bin/sh -c "composer phpunit-cover"'
docker-compose run --rm --user "0:0" app sh -c 'docker-php-ext-enable xdebug && su $(shell whoami) -s /bin/sh -c "composer phpunit-cover"'

shell: ## Start shell into container with php
$(dc_bin) run -e "PS1=\[\033[1;32m\]\[\033[1;36m\][\u@docker] \[\033[1;34m\]\w\[\033[0;35m\] \[\033[1;36m\]# \[\033[0m\]" $(RUN_APP_ARGS) sh
docker-compose run $(RUN_APP_ARGS) app sh

clean: ## Remove all dependencies and unimportant files
-rm -Rf ./composer.lock ./vendor ./coverage
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
"require": {
"php": "^7.2",
"ext-mbstring": "*",
"illuminate/contracts": "^5.5 || ~6.0 || ~7.0",
"illuminate/support": "^5.5 || ~6.0 || ~7.0",
"illuminate/http": "^5.5 || ~6.0 || ~7.0",
"illuminate/routing": "^5.5 || ~6.0 || ~7.0",
"spiral/roadrunner": "~1.7",
"illuminate/contracts": "~6.0 || ~7.0 || ~8.0",
"illuminate/support": "~6.0 || ~7.0 || ~8.0",
"illuminate/http": "~6.0 || ~7.0 || ~8.0",
"illuminate/routing": "~6.0 || ~7.0 || ~8.0",
"spiral/roadrunner": "~1.8",
"symfony/psr-http-message-bridge": "^1.2 || ^2.0",
"laminas/laminas-diactoros": "^2"
},
"require-dev": {
"ext-pdo": "*",
"ext-pdo_sqlite": "*",
"ext-sqlite3": "*",
"laravel/laravel": "^5.5 || ~6.0 || ~7.0",
"mockery/mockery": "^1.3",
"laravel/laravel": "~6.0 || ~7.0 || ~8.0",
"mockery/mockery": "^1.3.1",
"phpstan/phpstan": "~0.12",
"phpunit/phpunit": "^6.4 || ~7.5",
"phpunit/phpunit": "^8.0 || ^9.3",
"spiral/code-style": "^1.0"
},
"autoload": {
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ services:
build:
context: .
dockerfile: Dockerfile
environment:
PS1: '\[\033[1;32m\]\[\033[1;36m\][\u@docker] \[\033[1;34m\]\w\[\033[0;35m\] \[\033[1;36m\]# \[\033[0m\]'
volumes:
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
Expand Down
8 changes: 4 additions & 4 deletions tests/WorkerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public function testWorkerErrorHandling(): void
->shouldReceive('error')
->once()
->withArgs(function ($error_text) use ($exception_message): bool {
$this->assertContains($exception_message, $error_text);
$this->assertStringContainsString($exception_message, $error_text);

return true;
})
Expand Down Expand Up @@ -327,7 +327,7 @@ public function testWorkerErrorHandlingWithMaskedException(): void
->shouldReceive('error')
->once()
->withArgs(function ($error_text): bool {
$this->assertContains('Internal server error', $error_text);
$this->assertStringContainsString('Internal server error', $error_text);

return true;
})
Expand Down Expand Up @@ -434,7 +434,7 @@ public function test404errorResponse(): void
->withArgs(function (ResponseInterface $response): bool {
$this->assertSame(404, $response->getStatusCode());
$this->assertNotEmpty($response->getHeaders());
$this->assertContains('<html', Str::lower((string) $response->getBody()));
$this->assertStringContainsString('<html', Str::lower((string) $response->getBody()));

return true;
})
Expand Down Expand Up @@ -503,7 +503,7 @@ private function getHtmlResponseValidationClosure(): callable
// Validate application response
$this->assertSame(200, $response->getStatusCode());
$this->assertNotEmpty($response->getHeaders());
$this->assertContains('<html', Str::lower((string) $response->getBody()));
$this->assertStringContainsString('<html', Str::lower((string) $response->getBody()));

return true;
};
Expand Down

0 comments on commit 9cd5b7f

Please sign in to comment.