Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow PHP 7.4 #1

Merged
merged 4 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/run-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.1, 8.2, 8.3, 8.4]
laravel: [9.*, 10.*, 11.*]
php: [7.4, 8.0]
laravel: [8.*]
dependency-version: [prefer-stable]
exclude:
- laravel: 11.*
Expand All @@ -44,7 +44,6 @@ jobs:

- name: Install dependencies
run: |
composer remove phpro/grumphp --no-update --dev
composer require "laravel/framework:${{ matrix.laravel }}" --no-update --no-progress
composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.1, 8.2, 8.3, 8.4]
laravel: ['9.*', '10.*', '11.*']
php: [7.4, 8.0]
laravel: ['8.*']
dependency-version: [prefer-lowest, prefer-stable]
exclude:
- laravel: 11.*
Expand Down
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Base image with PHP 7.4
FROM php:7.4-cli

# Arguments to capture UID and GID
ARG HOSTUID
ARG HOSTGID

# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

# Install necessary tools
RUN apt-get update && apt-get install -y \
sudo \
git \
unzip \
&& apt-get clean

# Create a group and user with matching UID/GID
RUN groupadd -g ${HOSTGID} developer \
&& useradd -m -u ${HOSTUID} -g ${HOSTGID} -s /bin/bash developer \
&& usermod -aG sudo developer \
&& echo "developer ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

# Set permissions for the working directory
WORKDIR /app
RUN chown -R developer:developer /app

# Switch to the new user
USER developer

# Default shell command
CMD ["/bin/bash"]
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
],
"require": {
"php": "^8.1",
"php": "7.4.* | 8.0.*",
"dompdf/dompdf": "^3.0",
"illuminate/support": "^9|^10|^11"
"illuminate/support": "^8|^9|^10|^11"
},
"require-dev": {
"orchestra/testbench": "^7|^8|^9",
"orchestra/testbench": "^6|^7|^8|^9",
"squizlabs/php_codesniffer": "^3.5",
"phpro/grumphp": "^2.5",
"larastan/larastan": "^2.7.0"
"phpstan/phpstan": "^2.1"

},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -52,7 +52,7 @@
"test": "phpunit",
"check-style": "phpcs -p --standard=psr12 src/",
"fix-style": "phpcbf -p --standard=psr12 src/",
"phpstan": "phpstan analyze --memory-limit=-1"
"phpstan": "./vendor/bin/phpstan analyze --memory-limit=-1"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

services:
php:
build:
context: .
dockerfile: Dockerfile
args:
HOSTUID: "${HOSTUID:-1001}"
HOSTGID: "${HOSTGID:-1001}"
container_name: php74-dev
volumes:
- .:/app
working_dir: /app
tty: true
stdin_open: true
5 changes: 4 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
includes:
- vendor/larastan/larastan/extension.neon

parameters:
reportUnmatchedIgnoredErrors: false
Expand All @@ -11,3 +10,7 @@ parameters:
# This is a global alias that cannot be detected by Larastan.
- '#Call to static method loadHTML\(\) on an unknown class PDF\.#'
- '#Call to static method loadHTML\(\) on an unknown class Pdf\.#'
- '#Class Barryvdh\\DomPDF\\PDF has PHPDoc tag @method for method \S+\(\) parameter \#\d \$\S+ with no value type specified in iterable type array\.#'
- '#Class Barryvdh\\DomPDF\\PDF has PHPDoc tag @method for method \S+\(\) return type with no value type specified in iterable type array\.#'
- '#Class Barryvdh\\DomPDF\\Facade\\Pdf has PHPDoc tag @method for method \S+\(\) parameter \#\d \$\S+ with no value type specified in iterable type array\.#'
- '#Call to an undefined static method Illuminate\\Support\\Facades\\View::addLocation\(\)\.#'
Loading