Skip to content
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
42 changes: 39 additions & 3 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,44 @@
FROM splitbrain/phpfarm:jessie
FROM debian:trixie-slim

RUN apt-get update && apt-get install -y git zip
# Prevent interactive prompts
ENV DEBIAN_FRONTEND=noninteractive

# Install dependencies
RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
git \
lsb-release \
unzip \
zip \
&& curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list \
&& apt-get update

# Supported PHP Versions
ENV PHP_VERSIONS="7.4 8.0 8.1 8.2 8.3 8.4 8.5"

# Install all PHP versions using a loop
RUN for ver in $PHP_VERSIONS; do \
apt-get install -y \
php${ver}-cli php${ver}-xml php${ver}-mbstring php${ver}-soap; \
done \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Create symlinks (php-X.Y) using the same list
RUN for ver in $PHP_VERSIONS; do \
ln -s /usr/bin/php${ver} /usr/bin/php-${ver}; \
done

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

# Set working directory
WORKDIR /var/www

# Copy project files
COPY . /var/www/

WORKDIR /var/www/
# Default command
CMD ["bash"]
26 changes: 21 additions & 5 deletions .github/workflows/sonarcloud.yml → .github/workflows/sonars.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
name: SonarCloud
name: Sonars
on:
push:
branches:
- develop
- feature/*
- feat/*
- release/*
pull_request:
types: [ opened, synchronize, reopened ]
concurrency: sonars
jobs:
sonarcloud:
name: SonarCloud
name: Sonars
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
statuses: write
steps:
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -25,13 +32,22 @@ jobs:
- name: Install dependencies with composer
run: composer update --no-ansi --no-interaction --no-progress

- name: Generate coverage report with phpunit/phpunit
- name: Generate coverage report with phpunit
run: vendor/bin/phpunit --coverage-clover coverage.xml --log-junit report.xml

- name: Monitor coverage
uses: slavcodev/coverage-monitor-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
coverage_path: coverage.xml
threshold_alert: 95
threshold_warning: 90

- name: Fix phpunit files paths
run: sed -i 's@'$GITHUB_WORKSPACE/'@''@g' coverage.xml report.xml

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
uses: SonarSource/sonarqube-scan-action@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".docker"]
path = .docker
url = git@github.com:WsdlToPhp/DockerCommonImage.git
4 changes: 4 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@
->setUsingCache(false)
->setRules(array(
'@PhpCsFixer' => true,
'phpdoc_separation' => false,
'single_line_empty_body' => false,
'phpdoc_align' => false,
'php_unit_test_class_requires_covers' => false,
))
->setFinder($finder);
37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
PHP_VERSION ?= php-7.4
CONTAINER_NAME ?= dom_handler
COMPOSER ?= /usr/bin/composer
DOCKER_COMPOSE ?= docker compose
DOCKER_EXEC_CONTAINER ?= docker exec -t $(CONTAINER_NAME)

.PHONY: bash build cs-fixer down install phpstan phpunit rector up update

bash:
$(DOCKER_EXEC_CONTAINER) bash

build:
$(DOCKER_COMPOSE) build

cs-fixer:
$(DOCKER_EXEC_CONTAINER) $(PHP_VERSION) vendor/bin/php-cs-fixer fix --ansi --diff --verbose

down:
$(DOCKER_COMPOSE) down

install:
$(DOCKER_EXEC_CONTAINER) $(PHP_VERSION) $(COMPOSER) install

phpstan:
$(DOCKER_EXEC_CONTAINER) $(PHP_VERSION) vendor/bin/phpstan analyze src --level=2

phpunit:
$(DOCKER_EXEC_CONTAINER) $(PHP_VERSION) vendor/bin/phpunit --stop-on-failure --stop-on-error $(ARGS)

rector:
$(DOCKER_EXEC_CONTAINER) $(PHP_VERSION) vendor/bin/rector process

up:
$(DOCKER_COMPOSE) up -d

update:
$(DOCKER_EXEC_CONTAINER) $(PHP_VERSION) $(COMPOSER) update
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Developers who helped on this project are listed in the [composer.json](composer.json#L8) file as `Contributor` and are:
- [phordijk](https://github.com/phordijk)
- [AndreasA](https://github.com/AndreasA)

## FAQ

Expand Down
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
{
"name": "phordijk",
"role": "Contributor"
},
{
"name": "Andreas Allacher",
"role": "Contributor"
}
],
"require": {
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.4'

services:
php:
build:
Expand All @@ -8,3 +6,4 @@ services:
volumes:
- .:/var/www:rw
container_name: dom_handler
tty: true
2 changes: 0 additions & 2 deletions tests/AttributeHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

/**
* @internal
*
* @coversDefaultClass \WsdlToPhp\DomHandler\AttributeHandler
*/
final class AttributeHandlerTest extends TestCase
{
Expand Down
2 changes: 0 additions & 2 deletions tests/DomDocumentHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

/**
* @internal
*
* @coversDefaultClass \WsdlToPhp\DomHandler\DomDocumentHandler
*/
final class DomDocumentHandlerTest extends TestCase
{
Expand Down
2 changes: 0 additions & 2 deletions tests/ElementHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

/**
* @internal
*
* @coversDefaultClass \WsdlToPhp\DomHandler\ElementHandler
*/
final class ElementHandlerTest extends TestCase
{
Expand Down
2 changes: 0 additions & 2 deletions tests/NameSpaceHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

/**
* @internal
*
* @coversDefaultClass \WsdlToPhp\DomHandler\NameSpaceHandler
*/
final class NameSpaceHandlerTest extends TestCase
{
Expand Down
2 changes: 0 additions & 2 deletions tests/NodeHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

/**
* @internal
*
* @coversDefaultClass \WsdlToPhp\DomHandler\NodeHandler
*/
final class NodeHandlerTest extends TestCase
{
Expand Down
Loading