Skip to content

Commit

Permalink
v2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
bupy7 committed Dec 20, 2024
1 parent 005702c commit e6df90a
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/.gitignore export-ignore
/.gitattributes export-ignore
/phpunit.xml export-ignore
/phpunit.legacy.xml export-ignore
/workenv export-ignore
/tests export-ignore
/.github export-ignore
/phpcs.php export-ignore
/.php-cs-fixer.php export-ignore
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- 8.1
- 8.2
- 8.3
- 8.4
include:
- phpunit: phpunit.xml
- php: 5.6
Expand Down
8 changes: 6 additions & 2 deletions phpcs.php → .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/**
* Configuration of code style fixer and checker for this library.
* This configuration compatible with friendsofphp/php-cs-fixer "^3.43.0".
* This configuration compatible with friendsofphp/php-cs-fixer "^3.65.0".
*/

use PhpCsFixer\Finder;
Expand All @@ -16,7 +16,11 @@

$config = new Config();
$config->setRules([
'@PSR12' => true,
'@PER-CS' => true,
'cast_spaces' => [
'space' => 'none',
],
'single_line_empty_body' => false,
]);
$config->setFinder($finder);

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
xml-constrcutor
===

v2.0.4 [2024-12-21]
---

- Supporting of PHP 8.4.
- Code style fixes.

v2.0.3 [2023-12-29]
---

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023, Vasily Belosloodcev
Copyright (c) 2024, Vasily Belosloodcev
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ xml-constructor

The array-like constructor of XML document structure.

Supporting PHP from 5.6 up to 8.3.
Supporting PHP from 5.6 up to newest.

Install
---
Expand Down Expand Up @@ -125,7 +125,7 @@ Code style
To fix code style, run:

```
~/.composer/vendor/bin/php-cs-fixer fix --config=./phpcs.php --verbose
~/.composer/vendor/bin/php-cs-fixer fix --verbose
```

You have to install [PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) at first, if you
Expand Down
2 changes: 0 additions & 2 deletions workenv/50_xdebug.ini

This file was deleted.

40 changes: 32 additions & 8 deletions workenv/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,42 @@
FROM php:8.3-cli-alpine
FROM php:8.4-cli-alpine

ARG GITHUB_OAUTH_TOKEN=""
ARG USER_UID=""
ARG USER_GID=""

# common
# ---
RUN apk add --no-cache $PHPIZE_DEPS && apk add --update --no-cache linux-headers

RUN pecl install xdebug && docker-php-ext-enable xdebug
RUN rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
COPY 50_xdebug.ini /usr/local/etc/php/conf.d/

RUN curl -sS https://getcomposer.org/installer | php -- --2 --install-dir=/usr/bin --filename=composer
ARG GITHUB_OAUTH_TOKEN=false
RUN if [ ${GITHUB_OAUTH_TOKEN} != false ]; then \
COPY xdebug.ini /usr/local/etc/php/conf.d/zxy-50_xdebug.ini

# new user
# ---
RUN addgroup -g $USER_GID php-cli \
&& adduser -u $USER_UID -G php-cli -s /bin/sh -D php-cli

# login as new user
# ---
USER php-cli

# env's
# ---
ENV PATH="/home/php-cli/.local/bin:/home/php-cli/.composer/vendor/bin:${PATH}"

RUN mkdir -p /home/php-cli/.local/bin && \
curl -sS https://getcomposer.org/installer | \
/usr/local/bin/php -- --2 --install-dir=/home/php-cli/.local/bin --filename=composer

# composer
# ---
RUN if [ -n ${GITHUB_OAUTH_TOKEN} ]; then \
composer config -g github-oauth.github.com ${GITHUB_OAUTH_TOKEN} \
;fi
RUN export COMPOSER_DISABLE_XDEBUG_WARN=1

RUN composer global require friendsofphp/php-cs-fixer "^3.43.1"
# other tools
# ---
RUN composer global require --dev friendsofphp/php-cs-fixer "^3.65.0"

CMD ["php", "-a"]
8 changes: 5 additions & 3 deletions workenv/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
version: '3'

services:
php-cli:
build:
context: workenv
args:
- GITHUB_OAUTH_TOKEN=<YOUR_TOKEN>
- "GITHUB_OAUTH_TOKEN="
# If you are don't using Docker Desktop, but Docker Engine with Compose plugin, you should uncomment lines
# below and set-up "uid" and "gid" of your system user (see man of "id"). Try run command "id -u" and "id -g".
# - "USER_UID=1000"
# - "USER_GID=1000"
working_dir: /app
tty: true
volumes:
Expand Down
2 changes: 2 additions & 0 deletions workenv/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
xdebug.mode=debug,develop
xdebug.log=/home/php-cli/php-xdebug.log

0 comments on commit e6df90a

Please sign in to comment.