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 6 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
16 changes: 8 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ 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
eldario marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -32,12 +32,12 @@ 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@v3
eldario marked this conversation as resolved.
Show resolved Hide resolved
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-

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@v3 # Docs: <https://github.com/codecov/codecov-action>
eldario marked this conversation as resolved.
Show resolved Hide resolved
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ 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 `PHP` version now is `^8.0`
eldario marked this conversation as resolved.
Show resolved Hide resolved

## v2.9.1

### Changed
Expand Down
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
FROM php:8.0-alpine
FROM php:8.1-alpine

ENV COMPOSER_HOME="/tmp/composer"
ENV \
COMPOSER_ALLOW_SUPERUSER="1" \
COMPOSER_HOME="/tmp/composer"
eldario marked this conversation as resolved.
Show resolved Hide resolved

COPY --from=composer:2.0.7 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2.6.6 /usr/bin/composer /usr/bin/composer

eldario marked this conversation as resolved.
Show resolved Hide resolved
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 \
&& mkdir /src ${COMPOSER_HOME} \
&& ln -s /usr/bin/composer /usr/bin/c \
&& chmod -R 777 ${COMPOSER_HOME} \
&& composer --version \
&& php -v \
&& php -m
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.2",
eldario marked this conversation as resolved.
Show resolved Hide resolved
"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>
34 changes: 34 additions & 0 deletions sdk/php/phpunit.xml.dist.bak
eldario marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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>
7 changes: 4 additions & 3 deletions sdk/php/src/VehicleLogotypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ 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)
);
/** @var array<string, mixed> $data */
$data = \json_decode((string) \file_get_contents(__DIR__ . '/../../../src/vehicle-logotypes.json'), true, 512, JSON_THROW_ON_ERROR);
eldario marked this conversation as resolved.
Show resolved Hide resolved

return new self($data);
}
}
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