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

Feature/phpstan level3 bugfixes #16

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
5173db2
PHPStan Doctrine プラグイン追加後に発生した問題を修正
chrisL-meier Oct 27, 2023
9a2c7bd
PHPStanバッチ機能の作成
sai-gillingham Oct 27, 2023
a2b7f96
PHPSTAN bugfixes
chrisL-meier Oct 20, 2023
c652aca
PHPSTAN BUGFIX (2)
chrisL-meier Oct 23, 2023
3c7e049
PHPSTAN BUGFIX (3)
chrisL-meier Oct 23, 2023
a0559b7
PHPSTAN BUGFIX E2Eテスト・単体テストの追加
chrisL-meier Oct 24, 2023
813ff1e
PHPSTAN BUGFIX E2Eテスト・単体テストの追加
chrisL-meier Oct 25, 2023
828c36e
PHPStan修正
chrisL-meier Oct 30, 2023
a5f5c9b
Symfony ServiceのLevel 0定義ミスの修正
sai-gillingham Nov 6, 2023
73a9b86
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
0fd9f4f
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
39430dc
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
f202f22
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
b8f9ab4
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
4b0f2ce
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
2f9311e
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
3eaa920
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
e92359b
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
e07e05b
PHPStan Doctrine プラグイン追加後に発生した問題を修正
chrisL-meier Oct 27, 2023
ff1b7eb
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
0d247c0
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
9909a12
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
bf9081b
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
a17f574
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
d14f1f8
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
70985f7
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
3f7d6ff
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
b716c40
ゲッター・セッターのタイプヒント修正。
sai-gillingham Nov 6, 2023
471bce0
PHPStanLevel2修正
chrisL-meier Nov 6, 2023
7f881e5
PHPStan レベル2の修正
sai-gillingham Nov 7, 2023
8101d50
Merge branch 'feature/level_0_fixes' into feature/phpstan_level2_bugf…
sai-gillingham Nov 7, 2023
5b14324
PHPStan レベル2の修正
sai-gillingham Nov 7, 2023
ce45407
Merge pull request #1 from sai-gillingham/feature/pg_phpstan_level2_b…
chrisL-meier Nov 8, 2023
cb6a3e8
PHPStan LEVEL 3 問題を修正
chrisL-meier Oct 30, 2023
db17b01
PHPStan LEVEL 3 問題を修正(PointProcessorの修正)
chrisL-meier Oct 30, 2023
100af1a
PHPStan レベル2の修正
sai-gillingham Nov 8, 2023
2f25088
PHPStan レベル2の修正
sai-gillingham Nov 8, 2023
023f6b0
PHPStan レベル2の修正
sai-gillingham Nov 8, 2023
a4ddc03
PHPStan Level 3 問題の修正
chrisL-meier Nov 8, 2023
5c34018
不要useの削除
sai-gillingham Nov 8, 2023
9bd048e
不要useの削除
sai-gillingham Nov 8, 2023
ce6d184
不要useの削除
sai-gillingham Nov 8, 2023
ca8ca31
EditControllerのPHPDoc内容の修正。
sai-gillingham Nov 8, 2023
0275c9f
CsvImportControllerのPHPDoc内容の修正。
sai-gillingham Nov 8, 2023
7e945ae
不要useの削除
sai-gillingham Nov 8, 2023
585839f
不要のコードを消す。
sai-gillingham Nov 8, 2023
6ff2106
不要のコードを消す。
sai-gillingham Nov 8, 2023
b1cf074
不要のコードを消す。
sai-gillingham Nov 8, 2023
8fe4263
不要useの削除
sai-gillingham Nov 8, 2023
0961f85
不要useの削除
sai-gillingham Nov 8, 2023
05bbeeb
要らない修正を元の状態に戻す。
sai-gillingham Nov 8, 2023
c1691ff
要らない修正を元の状態に戻す。
sai-gillingham Nov 8, 2023
b3d2458
要らないuseを消す。
sai-gillingham Nov 8, 2023
c3ae762
要らないuseを消す。
sai-gillingham Nov 8, 2023
ddaa057
PHPDocタイプヒントの修正
sai-gillingham Nov 8, 2023
44e6b17
不要useの削除
sai-gillingham Nov 8, 2023
47533b6
不要useの削除
sai-gillingham Nov 8, 2023
694997c
不要useの削除
sai-gillingham Nov 8, 2023
871db60
不要useの削除
sai-gillingham Nov 8, 2023
4cd07a0
phpDocの修正。
sai-gillingham Nov 8, 2023
7bbeb11
不要useの削除
sai-gillingham Nov 8, 2023
bca5d06
不要useの削除
sai-gillingham Nov 8, 2023
47e7136
phpdocの修正
sai-gillingham Nov 8, 2023
646cd3d
不要useを消す。
sai-gillingham Nov 8, 2023
566ab51
不要useを消す。
sai-gillingham Nov 8, 2023
b2da2fe
不要useを消す。
sai-gillingham Nov 8, 2023
479ef8f
不要useを消す。
sai-gillingham Nov 8, 2023
4c05672
不要useを消す。
sai-gillingham Nov 8, 2023
a617ad1
不要useを消す。
sai-gillingham Nov 8, 2023
95f18ee
不要useを消す。
sai-gillingham Nov 8, 2023
381bdab
不要useを消す。
sai-gillingham Nov 8, 2023
460017a
PHPDoc の修正
sai-gillingham Nov 8, 2023
6cc5eec
PHPDoc の修正
sai-gillingham Nov 8, 2023
749cd84
PHPDocジェネリックスの修正
sai-gillingham Nov 8, 2023
5e8e364
不要useの削除
sai-gillingham Nov 8, 2023
58e6b96
不要useの削除
sai-gillingham Nov 8, 2023
3fc6811
緊急修正 AddPointProcessor
chrisL-meier Nov 8, 2023
6703271
不要useの削除
sai-gillingham Nov 8, 2023
3c34e0b
null戻り値の作成。
sai-gillingham Nov 8, 2023
31e9eb4
不要useを消す。
sai-gillingham Nov 8, 2023
7b53d7a
不要useを消す。
sai-gillingham Nov 8, 2023
e2627c8
不要useを消す。
sai-gillingham Nov 8, 2023
89a1e3a
不要useを消す。
sai-gillingham Nov 8, 2023
90f0817
PurchaseContextの修正を元の状態に戻す。
sai-gillingham Nov 8, 2023
c001291
不要useの削除。
sai-gillingham Nov 8, 2023
acf549e
不要useの削除。
sai-gillingham Nov 8, 2023
4a2073a
Merge pull request #17 from chrisL-meier/feature/phpstan_level2_bugfixes
sai-gillingham Nov 8, 2023
9c3b4cc
.gitkeepの復元
sai-gillingham Nov 8, 2023
d0dcc80
緊急修正 SameSiteNoneCompatSessionHandler.php
chrisL-meier Nov 8, 2023
b388053
: boolを削除
chrisL-meier Nov 8, 2023
8394a45
Merge pull request #18 from chrisL-meier/feature/phpstan_level2_bugfixes
sai-gillingham Nov 8, 2023
38f8c25
Merge branch 'feature/phpstan_level3_bugfixes' into feature/pg_phpsta…
chrisL-meier Nov 9, 2023
8928dba
Merge pull request #2 from sai-gillingham/feature/pg_phpstan_level2_b…
chrisL-meier Nov 9, 2023
cbf10f3
GitHubコメントに対応
chrisL-meier Nov 13, 2023
a3fd9d9
CsvImportController.phpの修正
chrisL-meier Nov 13, 2023
293cb2b
単体テストの追加(レベル3)
chrisL-meier Nov 13, 2023
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
8 changes: 4 additions & 4 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
###> symfony/framework-bundle ###
# For production servers, use: "APP_ENV=prod" and "APP_DEBUG=0"
# For local development, use: "APP_ENV=dev" and "APP_DEBUG=1"
APP_ENV=prod
APP_DEBUG=0
APP_ENV=dev
APP_DEBUG=1
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS=^localhost$,^example\.com$
###< symfony/framework-bundle ###
Expand All @@ -15,8 +15,8 @@ APP_DEBUG=0
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
DATABASE_URL=sqlite:///var/eccube.db
# DATABASE_URL=mysql://dbuser:secret@mysql/eccubedb
# DATABASE_URL=sqlite:///var/eccube.db
DATABASE_URL=mysql://dbuser:secret@mysql/eccubedb
# DATABASE_URL=postgresql://postgres/eccubedb?user=dbuser&password=secret

# The version of your database engine
Expand Down
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG TAG=7.4-apache-bullseye
ARG TAG=8.1-apache-bullseye
FROM php:${TAG}

ENV APACHE_DOCUMENT_ROOT /var/www/html
Expand Down Expand Up @@ -32,10 +32,13 @@ RUN apt update \
&& echo "en_US.UTF-8 UTF-8" >/etc/locale.gen \
&& locale-gen \
;
RUN pecl search xdebug-3.1.6\
&& pecl install xdebug-3.1.6

RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j$(nproc) zip gd mysqli pdo_mysql opcache intl pgsql pdo_pgsql \
# && docker-php-ext-enable xdebug \
;

RUN pecl install apcu && echo "extension=apcu.so" > /usr/local/etc/php/conf.d/apc.ini
Expand Down Expand Up @@ -73,10 +76,10 @@ RUN composer config -g repos.packagist composer https://packagist.jp
COPY . ${APACHE_DOCUMENT_ROOT}
WORKDIR ${APACHE_DOCUMENT_ROOT}

RUN find ${APACHE_DOCUMENT_ROOT} \( -path ${APACHE_DOCUMENT_ROOT}/vendor -prune \) -or -print0 \
| xargs -0 chown www-data:www-data \
&& find ${APACHE_DOCUMENT_ROOT} \( -path ${APACHE_DOCUMENT_ROOT}/vendor -prune \) -or \( -type d -print0 \) \
| xargs -0 chmod g+s \
;
#RUN find ${APACHE_DOCUMENT_ROOT} \( -path ${APACHE_DOCUMENT_ROOT}/vendor -prune \) -or -print0 \
# | xargs -0 chown www-data:www-data \
# && find ${APACHE_DOCUMENT_ROOT} \( -path ${APACHE_DOCUMENT_ROOT}/vendor -prune \) -or \( -type d -print0 \) \
# | xargs -0 chmod g+s \
# ;

HEALTHCHECK --interval=10s --timeout=5s --retries=30 CMD pgrep apache
1 change: 1 addition & 0 deletions app/config/eccube/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ doctrine:
types:
datetime: 'Eccube\Doctrine\DBAL\Types\UTCDateTimeType'
datetimetz: 'Eccube\Doctrine\DBAL\Types\UTCDateTimeTzType'
default_connection: 'default'
orm:
auto_generate_proxy_classes: '%kernel.debug%'
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
Expand Down
Empty file removed app/template/plugin/.gitkeep
Empty file.
4 changes: 4 additions & 0 deletions codeception/docker/docker-php-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

while ! nc -z ec-cube 80; do sleep 1; done; while ! nc -z chrome 4444; do sleep 1; done; ls -la && php bin/console cache:clear --no-warmup && /var/www/html/vendor/bin/codecept run -d acceptance --env chrome-headless,local -g customer

20 changes: 17 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"minimum-stability": "stable",
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.1",
"ext-curl": "*",
"ext-intl": "*",
"ext-json": "*",
Expand Down Expand Up @@ -115,7 +115,9 @@
"dama/doctrine-test-bundle": "^6.6",
"fakerphp/faker": "^1.16",
"mikey179/vfsstream": "^1.6",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.7",
"phpstan/phpstan-doctrine": "^1.3",
"symfony/browser-kit": "^5.4",
"symfony/phpunit-bridge": "^5.4"
},
Expand Down Expand Up @@ -186,7 +188,7 @@
},
"config": {
"platform": {
"php": "7.4.0"
"php": "8.1.18"
},
"preferred-install": {
"*": "dist"
Expand All @@ -197,7 +199,19 @@
"composer/*": true,
"kylekatarnls/update-helper": true,
"ec-cube/plugin-installer": true,
"symfony/flex": true
"symfony/flex": true,
"phpstan/extension-installer": true
}
},
"repositories": {
"eccube": {
"type": "composer",
"url": "https://package-api-c2.ec-cube.net/v42",
"options": {
"http": {
"header": ["X-ECCUBE-KEY: d285840e84bb5ab7c5650250818a75970877c761"]
}
}
}
}
}
106 changes: 106 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ services:
### ローカルでビルドする場合は以下のコマンドを使用します
## docker build -t ec-cube --no-cache --pull --build-arg TAG=8.1-apache .
## docker tag ec-cube ghcr.io/ec-cube/ec-cube-php:8.1-apache
image: ${REGISTRY:-ghcr.io}/${IMAGE_NAME:-ec-cube/ec-cube-php}:${TAG:-8.1-apache}
# image: ${REGISTRY:-ghcr.io}/${IMAGE_NAME:-ec-cube/ec-cube-php}:${TAG:-8.1-apache}
build:
context: .
ports:
- 8080:80
- 4430:443
volumes:
### 同期対象からコストの重いフォルダを除外 #####################
- "var:/var/www/html/var"
- "vendor:/var/www/html/vendor"
- "node_modules:/var/www/html/node_modules"
- ".:/var/www/html"
# - "./var/coverage:/opt/coverage"
environment:
# EC-CUBE environments
APP_ENV: "dev"
Expand All @@ -57,6 +58,8 @@ services:
# ECCUBE_ADMIN_PASS: "password"
networks:
- backend
extra_hosts:
- host.docker.internal:host-gateway

### Mailcatcher ##################################
mailcatcher:
Expand Down
6 changes: 6 additions & 0 deletions dockerbuild/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ opcache.memory_consumption=256
realpath_cache_size = 4096K
realpath_cache_ttl = 600
memory_limit = 786M

[xdebug]
zend_extension=xdebug.so
xdebug.log =/var/www/html/var/log/xdebug.log
xdebug.mode=debug
xdebug.client_host=host.docker.internal
8 changes: 8 additions & 0 deletions phpdoc_result_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#bin/bash

for level in {0..3}
do
docker exec ec-cube-ec-cube-1 bash -c "vendor/bin/phpstan analyse src --level ${level} > tests/results/level_${level}.json"
done

php tests/results/convert.php
13 changes: 9 additions & 4 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
parameters:
level: 1
level: 0
ignoreErrors:
-
message: "#^Function twig_include not found\\.$#"
path: src/Eccube/Twig/Extension/IgnoreTwigSandboxErrorExtension.php
- '#Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition::children\(\).#'
excludePaths:
- 'var/*'
- 'vendor/*'
doctrine:
objectManagerLoader: tests/object-manager.php
ormRepositoryClass: Eccube\Repository\AbstractRepository
errorFormat: json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
]);
$question = new ConfirmationQuestion($message);
if (!$this->io->askQuestion($question)) {
return;
return 0;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Command/GenerateDummyDataCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class GenerateDummyDataCommand extends Command
protected $generator;

/**
* @var EntityManager
* @var EntityManagerInterface
*/
protected $entityManager;

Expand Down
22 changes: 16 additions & 6 deletions src/Eccube/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class AbstractController extends Controller
protected $eventDispatcher;

/**
* @var Session
* @var SessionInterface
*/
protected $session;

Expand Down Expand Up @@ -174,7 +174,9 @@ public function addRequestErrorOnce($message, $namespace = 'front')

public function clearMessage()
{
$this->session->getFlashBag()->clear();
/** @var Session $session */
$session = $this->session;
$session->getFlashBag()->clear();
}

public function deleteMessage()
Expand All @@ -185,7 +187,9 @@ public function deleteMessage()

public function hasMessage(string $type): bool
{
return $this->session->getFlashBag()->has($type);
/** @var Session $session */
$session = $this->session;
return $session->getFlashBag()->has($type);
}

public function addFlashOnce(string $type, $message): void
Expand All @@ -204,7 +208,9 @@ protected function addFlash(string $type, $message): void
parent::addFlash($type, $message);
} catch (\LogicException $e) {
// fallback session
$this->session->getFlashBag()->add($type, $message);
/** @var Session $session */
$session = $this->session;
$session->getFlashBag()->add($type, $message);
}
}

Expand All @@ -214,9 +220,13 @@ protected function addFlash(string $type, $message): void
public function setLoginTargetPath($targetPath, $namespace = null)
{
if (is_null($namespace)) {
$this->session->getFlashBag()->set('eccube.login.target.path', $targetPath);
/** @var Session $session */
$session = $this->session;
$session->getFlashBag()->set('eccube.login.target.path', $targetPath);
} else {
$this->session->getFlashBag()->set('eccube.'.$namespace.'.login.target.path', $targetPath);
/** @var Session $session */
$session = $this->session;
$session->getFlashBag()->set('eccube.'.$namespace.'.login.target.path', $targetPath);
}
}

Expand Down
Loading
Loading