Skip to content

Commit

Permalink
Merge branch 'master' into fix-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess authored Dec 22, 2024
2 parents 58c4a45 + f43b810 commit 564cff5
Show file tree
Hide file tree
Showing 204 changed files with 4,591 additions and 12,079 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:
run-on-linux:
name: Run on Linux
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:

- name: Create ADMIN_DIR
run: |
sudo apt-fast install -y sharutils
sudo apt install -y sharutils
echo "ADMIN_DIR=$(head -c 10 < /dev/random | uuencode -m - | tail -n 2 |head -n 1 | sed 's,[/+],_,g' | head -c10)/" >> $GITHUB_ENV
- name: Setup to EC-CUBE
Expand All @@ -88,7 +88,7 @@ jobs:
HTTP_URL: http://127.0.0.1:8085/
HTTPS_URL: http://127.0.0.1:8085/
run: |
sudo apt-fast install -y mysql-client postgresql-client
sudo apt install -y mysql-client postgresql-client
./eccube_install.sh ${DB}
- name: Run to PHPUnit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
deploy:
name: Deploy
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: PREVIOUS_TAG_NAME
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dockerbuild-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ env:
jobs:
dockerbuild:
name: dockerbuild
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4-rc' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]

steps:
- name: downcase REPO
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dockerbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ env:
jobs:
dockerbuild:
name: dockerbuild
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4-rc' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]

steps:
- name: Checkout
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
jobs:
run-on-linux:
name: Run on Linux
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand All @@ -30,7 +30,7 @@ jobs:
- 'test/front_login'
- 'test/front_guest'
- 'test/admin'
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4-rc' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
db: [ mysql, pgsql ]
steps:
- name: Checkout
Expand All @@ -43,7 +43,7 @@ jobs:

# - name: Create ADMIN_DIR
# run: |
# sudo apt-fast install -y sharutils
# sudo apt install -y sharutils
# echo "ADMIN_DIR=$(head -c 10 < /dev/random | uuencode -m - | tail -n 2 |head -n 1 | sed 's,[/+],_,g' | head -c10)/" >> $GITHUB_ENV

- name: Setup environment
Expand Down Expand Up @@ -127,12 +127,12 @@ jobs:
path: data/logs
installer:
name: Installer test
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
db: [ 'pgsql', 'mysql' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4-rc' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
include:
- db: mysql
dbport: '3306'
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,37 @@ jobs:
with:
event_name: ${{ github.event_name }}
uses: ./.github/workflows/dockerbuild.yml
phpstan:
php-cs-fixer:
with:
ref_name: ${{ github.ref_name }}
base_ref: ${{ github.base_ref }}
event_name: ${{ github.event_name }}
owner: ${{ github.repository_owner }}
needs: [ dockerbuild ]
uses: ./.github/workflows/php-cs-fixer.yml
phpstan:
with:
ref_name: ${{ github.ref_name }}
base_ref: ${{ github.base_ref }}
event_name: ${{ github.event_name }}
owner: ${{ github.repository_owner }}
needs: [ php-cs-fixer ]
uses: ./.github/workflows/phpstan.yml
unit-tests:
with:
ref_name: ${{ github.ref_name }}
base_ref: ${{ github.base_ref }}
event_name: ${{ github.event_name }}
owner: ${{ github.repository_owner }}
needs: [ dockerbuild ]
needs: [ php-cs-fixer ]
uses: ./.github/workflows/unit-tests.yml
e2e-tests:
with:
ref_name: ${{ github.ref_name }}
base_ref: ${{ github.base_ref }}
event_name: ${{ github.event_name }}
owner: ${{ github.repository_owner }}
needs: [ dockerbuild ]
needs: [ php-cs-fixer ]
uses: ./.github/workflows/e2e-tests.yml
success:
needs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/penetration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
PenetrationTest:
name: Penetration testing
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand All @@ -25,7 +25,7 @@ jobs:

# - name: Create ADMIN_DIR
# run: |
# sudo apt-fast install -y sharutils
# sudo apt install -y sharutils
# echo "ADMIN_DIR=$(head -c 10 < /dev/random | uuencode -m - | tail -n 2 |head -n 1 | sed 's,[/+],_,g' | head -c10)/" >> $GITHUB_ENV

- name: Apply patchs
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: php-cs-fixer dry-run
run-name: php-cs-fixer

on:
workflow_call:
inputs:
ref_name:
required: false
type: string
base_ref:
required: false
type: string
event_name:
required: true
type: string
owner:
required: true
type: string
jobs:
php-cs-fixer:
name: php-cs-fixer
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: Build docker image
uses: ./.github/actions/dockerbuild
with:
php-version: '8.4'

- name: Setup environment
env:
REF_NAME: ${{ inputs.ref_name }}
BASE_REF: ${{ inputs.base_ref }}
EVENT_NAME: ${{ inputs.event_name }}
OWNER: ${{ inputs.owner }}
run: |
echo "COMPOSE_FILE=docker-compose.yml:docker-compose.pgsql.yml:docker-compose.dev.yml" >> $GITHUB_ENV
echo "IMAGE_NAME=${OWNER,,}/ec-cube2-php" >> $GITHUB_ENV
if [ $EVENT_NAME = "pull_request" ]; then
if [ -n $DOCKER_METADATA_OUTPUT_VERSION ]; then
echo "TAG=${DOCKER_METADATA_OUTPUT_VERSION}" >> $GITHUB_ENV
else
echo "TAG=8.4-apache-${BASE_REF}" >> $GITHUB_ENV
fi
else
echo "TAG=8.4-apache-${REF_NAME}" >> $GITHUB_ENV
fi
- run: |
docker compose up -d --wait
docker compose exec -T ec-cube composer install
- run: docker compose exec -T -e PHP_CS_FIXER_IGNORE_ENV=1 ec-cube php data/vendor/bin/php-cs-fixer fix --diff --dry-run --allow-risky=yes
6 changes: 3 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-22.04 ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4-rc' ]
operating-system: [ ubuntu-24.04 ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
db: [ mysql, pgsql ]

steps:
Expand All @@ -38,7 +38,7 @@ jobs:

- name: Create ADMIN_DIR
run: |
sudo apt-fast install -y sharutils
sudo apt install -y sharutils
echo "ADMIN_DIR=$(head -c 10 < /dev/random | uuencode -m - | tail -n 2 |head -n 1 | sed 's,[/+],_,g' | head -c10)/" >> $GITHUB_ENV
- name: Setup environment
Expand Down
5 changes: 5 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
'no_superfluous_phpdoc_tags' => false, // 副作用があるため
'increment_style' => false, // 強制しなくて良い
'yoda_style' => false, // 強制しなくて良い
'blank_line_after_opening_tag' => false, // 強制しなくて良い
'fully_qualified_strict_types' => false, // 強制しなくて良い
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays']], // elements で arrays 以外を指定するとPHP7.4でエラーになる

// @Symfony:risky のうち、以下のルールを無効化
'psr_autoloading' => false, // PSR-4 に準拠していないため
'is_null' => false, // 副作用があるため
'native_constant_invocation' => false, // namespace を使用していないため不要
'string_length_to_empty' => false, // 副作用があるため
'ternary_to_elvis_operator' => false, // 副作用があるため
'get_class_to_class_keyword' => false, // 副作用があるため
];

$finder = \PhpCsFixer\Finder::create()
Expand All @@ -31,6 +35,7 @@
->in(__DIR__.'/data/module')
->in(__DIR__.'/data/smarty_extends')
->in(__DIR__.'/tests')
->exclude('SOAP')
->name('*.php')
;
$config = new \PhpCsFixer\Config();
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ Pull requestを送信する際は、EC-CUBEのコピーライトポリシーに

#### システム要件

| 分類 | ソフトウェア | Version |
|-----------|----------------------|-------------------------------------------------------------------------|
| WebServer | Apache | 2.4.x or higher<br> (mod_rewrite / mod_ssl 必須) |
| PHP | PHP | 7.4.33 or higher |
| Database | PostgreSQL | 9.x or higher |
| Database | MySQL | 5.x / 8.x or higher<br> (InnoDBエンジン 必須) |
| 分類 | ソフトウェア | Version |
|-----------|--------------|---------------------------------------------------------|
| WebServer | Apache | 2.4.x or higher<br> (mod_rewrite / mod_ssl 必須) |
| PHP | PHP | 7.4.33 or higher |
| Database | PostgreSQL | 9.x or higher |
| Database | MySQL | 5.x / 8.0.x / 8.4.x or higher<br> (InnoDBエンジン 必須) |


##### 必要な PHP Extensions

Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"nanasess/ec-cube2-class-extends-stubs": "^1.0",
"nanasess/eccube2-fixture-generator": "^2.0",
"phpdocumentor/reflection-docblock": "~5.5.1",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^9.6",
"symfony/yaml": "^5.4 || ^6.4"
},
Expand All @@ -39,15 +39,19 @@
"mobiledetect/mobiledetectlib": "^3.74",
"nanasess/mdb2": "^2.5",
"nanasess/php8-compat": "^1.0",
"nobuhiko/calendar": "^1.0",
"pear/archive_tar": "^1.4.3",
"pear/mail": "*",
"pear/net_smtp": "^1.12",
"pear/net_socket": "^1.2",
"pear/pear-core-minimal": "^1.10",
"pear/xml_parser": "*",
"pear/xml_serializer": "*",
"pear/xml_util": "*",
"setasign/fpdf": "^1.8",
"setasign/fpdi": "^2.6",
"smarty/smarty": "^5.0.2"
"smarty/smarty": "^5.0.2",
"symfony/polyfill-php80": "^1.31"
},
"autoload": {
"classmap": [
Expand Down
Loading

0 comments on commit 564cff5

Please sign in to comment.