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

Add Laravel 11 support #17

Merged
merged 11 commits into from
Aug 22, 2024
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
22 changes: 11 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs: # Docs: <https://git.io/JvxXE>
strategy:
fail-fast: false
matrix:
setup: [basic, lowest]
php: ['7.3', '7.4', '8.0']
setup: [ 'basic', 'lowest' ]
eldario marked this conversation as resolved.
Show resolved Hide resolved
php: [ '8.0','8.1','8.2','8.3' ]
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 # Action page: <https://github.com/shivammathur/setup-php>
Expand All @@ -32,22 +32,22 @@ jobs: # Docs: <https://git.io/JvxXE>

- name: Get Composer Cache Directory # Docs: <https://git.io/JfAKn#php---composer>
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "output_dir=dir::$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies # Docs: <https://git.io/JfAKn#php---composer>
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ steps.composer-cache.outputs.output_dir }}
key: ${{ runner.os }}-composer-${{ matrix.setup }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install lowest Composer dependencies
if: matrix.setup == 'lowest'
run: composer update --prefer-dist --no-suggest --prefer-lowest --ansi
run: composer update --prefer-dist --prefer-lowest --ansi

- name: Install basic Composer dependencies
if: matrix.setup == 'basic'
run: composer update --prefer-dist --no-suggest --ansi
run: composer update --prefer-dist --ansi

- name: Show most important packages versions
run: composer info | grep -e illuminate -e phpunit -e phpstan
Expand All @@ -57,7 +57,7 @@ jobs: # Docs: <https://git.io/JvxXE>
XDEBUG_MODE: coverage
run: composer test-cover

- uses: codecov/codecov-action@v1 # Docs: <https://github.com/codecov/codecov-action>
- uses: codecov/codecov-action@v4 # Docs: <https://github.com/codecov/codecov-action>
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./sdk/php/coverage/clover.xml
Expand All @@ -69,7 +69,7 @@ jobs: # Docs: <https://git.io/JvxXE>
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup NodeJS
uses: actions/setup-node@v1 # Action page: <https://github.com/actions/setup-node>
Expand All @@ -88,7 +88,7 @@ jobs: # Docs: <https://git.io/JvxXE>
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Lint changelog file
uses: docker://avtodev/markdown-lint:v1 # Action page: <https://github.com/avto-dev/markdown-lint>
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ 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].

## Unreleased

### Added

- Support Laravel versions `10.x` and `11.x`

### Changed

- Minimal require PHP version now is `8.0`
- Minimal Laravel version now is `9.0`
- Version of `composer` in docker container updated up to `2.7`

## v2.9.1

### Changed
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM php:8.0-alpine
FROM php:8.1-alpine

ENV COMPOSER_HOME="/tmp/composer"

COPY --from=composer:2.0.7 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2.7 /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 \
&& apk add --no-cache --virtual .build-deps autoconf linux-headers pkgconf make g++ gcc 1>/dev/null \
# install xdebug (for testing with code coverage), but do not enable it
&& pecl install xdebug-3.0.0 1>/dev/null \
&& pecl install xdebug-3.3.0 1>/dev/null \
&& apk del .build-deps \
&& mkdir --parents --mode=777 /src ${COMPOSER_HOME}/cache/repo ${COMPOSER_HOME}/cache/files \
&& ln -s /usr/bin/composer /usr/bin/c \
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
}
],
"require": {
"php": "^7.3 || ^8.0",
"illuminate/support": "~6.0 || ~7.0 || ~8.0 || ~9.0",
"php": "^8.0",
"illuminate/support": "~9.0 || ~10.0 || ~11.0",
"ext-json": "*"
},
"require-dev": {
"ext-mbstring": "*",
"phpstan/phpstan": "^0.12.36",
"phpunit/phpunit": "^9.3"
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.6 || ^10.0"
},
"autoload": {
"psr-4": {
Expand Down
55 changes: 23 additions & 32 deletions sdk/php/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
forceCoversAnnotation="true"
stopOnFailure="false">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>

<coverage includeUncoveredFiles="false" processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
</exclude>
<report>
<clover outputFile="./coverage/clover.xml"/>
<html outputDirectory="./coverage/html"/>
<text outputFile="php://stdout" showUncoveredFiles="false"/>
<xml outputDirectory="./coverage/xml"/>
</report>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" cacheDirectory=".phpunit.cache" backupStaticProperties="false" requireCoverageMetadata="true">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<coverage includeUncoveredFiles="false">
<report>
<clover outputFile="./coverage/clover.xml"/>
<html outputDirectory="./coverage/html"/>
<text outputFile="php://stdout" showUncoveredFiles="false"/>
<xml outputDirectory="./coverage/xml"/>
</report>
</coverage>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
</exclude>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion sdk/php/src/VehicleLogotypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class VehicleLogotypes extends \Illuminate\Support\Collection
public static function create(): self
{
return new self(
\json_decode((string) \file_get_contents(__DIR__ . '/../../../src/vehicle-logotypes.json'), true, 512, JSON_THROW_ON_ERROR)
(array) \json_decode((string) \file_get_contents(__DIR__ . '/../../../src/vehicle-logotypes.json'), true, 512, JSON_THROW_ON_ERROR)
);
}
}
2 changes: 1 addition & 1 deletion sdk/php/tests/VehicleLogotypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use AvtoDev\VehicleLogotypes\VehicleLogotypes;

/**
* @covers \AvtoDev\VehicleLogotypes\VehicleLogotypes<extended>
* @covers \AvtoDev\VehicleLogotypes\VehicleLogotypes
*/
class VehicleLogotypesTest extends TestCase
{
Expand Down
Loading