Compare commits

..

7 Commits

Author SHA1 Message Date
Clemens Schwaighofer
201b495e30 README update 2026-03-06 16:44:44 +09:00
Clemens Schwaighofer
5c461a6fea core composer settings update 2024-10-18 09:29:44 +09:00
Clemens Schwaighofer
2e59e50df8 Set phpstan to max level for update testing 2024-10-18 09:22:02 +09:00
Clemens Schwaighofer
4b45f8d556 Update and fix composer json file, phars file 2024-10-18 09:20:53 +09:00
Clemens Schwaighofer
4b4e655374 Merge branch 'NewFeatures' into phpstan-strict 2024-10-18 09:16:16 +09:00
Clemens Schwaighofer
da0d939068 First phpstan strict check 2023-02-28 06:54:20 +09:00
Clemens Schwaighofer
537bc0a477 add phpstan strict 2023-02-28 06:39:36 +09:00
6 changed files with 36 additions and 29 deletions

5
.gitignore vendored
View File

@@ -1,5 +1,6 @@
.libs .libs
node_modules/ node_modules/
composer.lock **/composer.lock
vendor/ **/vendor/
tools/ tools/
**/.env

View File

@@ -3,7 +3,7 @@
<phar name="phpunit" version="^9.6" installed="9.6.21" location="./tools/phpunit" copy="false"/> <phar name="phpunit" version="^9.6" installed="9.6.21" location="./tools/phpunit" copy="false"/>
<phar name="phpcbf" version="^3.7.2" installed="3.10.3" location="./tools/phpcbf" copy="false"/> <phar name="phpcbf" version="^3.7.2" installed="3.10.3" location="./tools/phpcbf" copy="false"/>
<phar name="phpcs" version="^3.7.2" installed="3.10.3" location="./tools/phpcs" copy="false"/> <phar name="phpcs" version="^3.7.2" installed="3.10.3" location="./tools/phpcs" copy="false"/>
<phar name="phpstan" version="^1.10.37" installed="1.12.4" location="./tools/phpstan" copy="false"/> <phar name="phpstan" version="^1.10.37" installed="1.12.6" location="./tools/phpstan" copy="false"/>
<phar name="phan" version="^5.4.2" installed="5.4.3" location="./tools/phan" copy="false"/> <phar name="phan" version="^5.4.2" installed="5.4.3" location="./tools/phan" copy="false"/>
<phar name="psalm" version="^5.15.0" installed="5.24.0" location="./tools/psalm" copy="false"/> <phar name="psalm" version="^5.15.0" installed="5.24.0" location="./tools/psalm" copy="false"/>
<phar name="phpdox" version="^0.12.0" installed="0.12.0" location="./tools/phpdox" copy="false"/> <phar name="phpdox" version="^0.12.0" installed="0.12.0" location="./tools/phpdox" copy="false"/>

View File

@@ -4,16 +4,14 @@
"description": "CoreLibs: Development package", "description": "CoreLibs: Development package",
"type": "library", "type": "library",
"require": { "require": {
"php": ">=8.3" "php": ">=8.1"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "^1.12", "phpstan/phpstan": "^1.10",
"phan/phan": "^5.4", "phan/phan": "^5.4",
"phpstan/extension-installer": "^1.4", "phpstan/extension-installer": "^1.2",
"phpstan/phpstan-strict-rules": "^1.6", "phpstan/phpstan-strict-rules": "^1.6",
"phpunit/phpunit": "^9", "phpunit/phpunit": "^9"
"phpstan/phpstan-deprecation-rules": "^1.2",
"yamadashy/phpstan-friendly-formatter": "^1.1"
}, },
"config": { "config": {
"allow-plugins": { "allow-plugins": {

View File

@@ -1,18 +1,25 @@
# PHP Stan Config # PHP Stan Config
includes: includes:
- phpstan-conditional.php - phpstan-conditional.php
- ./vendor/yamadashy/phpstan-friendly-formatter/extension.neon
parameters: parameters:
tmpDir: %currentWorkingDirectory%/tmp/phpstan-corelibs tmpDir: %currentWorkingDirectory%/tmp/phpstan-corelibs
errorFormat: friendly level: 9 # max is now 9
friendly:
lineBefore: 5
lineAfter: 3
level: 8 # max is now 9
# strictRules:
# allRules: true
checkMissingCallableSignature: true checkMissingCallableSignature: true
treatPhpDocTypesAsCertain: false treatPhpDocTypesAsCertain: false
strictRules:
allRules: false
disallowedLooseComparison: false
booleansInConditions: false
uselessCast: true
requireParentConstructorCall: false
disallowedConstructs: false
overwriteVariablesWithLoop: false
closureUsesThis: false
matchingInheritedMethodNames: false
numericOperandsInArithmeticOperators: false
strictCalls: false
switchConditionsMatchingType: false
noVariableVariables: false
paths: paths:
- %currentWorkingDirectory%/www - %currentWorkingDirectory%/www
bootstrapFiles: bootstrapFiles:
@@ -42,6 +49,8 @@ parameters:
- www/log - www/log
- www/media - www/media
- www/tmp - www/tmp
# File uploader
- www/lib/FileUpload
# ignore composer # ignore composer
- www/vendor - www/vendor
# ignore errores with # ignore errores with
@@ -60,6 +69,6 @@ parameters:
# paths: # paths:
# - ... # - ...
# - ... # - ...
- #-
message: "#^Call to deprecated method #" # message: "#^Call to deprecated method #"
path: www/admin/class_test*.php # path: www/admin/class_test*.php

View File

@@ -205,11 +205,13 @@ if (
} }
// set SSL on // set SSL on
$is_secure = false; $is_secure = false;
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {
$is_secure = true; $is_secure = true;
} elseif ( } elseif (
!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
!empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on' $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' ||
!empty($_SERVER['HTTP_X_FORWARDED_SSL']) &&
$_SERVER['HTTP_X_FORWARDED_SSL'] === 'on'
) { ) {
$is_secure = true; $is_secure = true;
} }

View File

@@ -14,12 +14,9 @@ For local install only
Setup from gitea internal servers Setup from gitea internal servers
```sh ```sh
composer config repositories.git.egplusww.jp.Composer composer https://git.egplusww.jp/api/packages/Composer/composer composer config repositories.packages.omnicomproduction.jp.Composer composer https://packages.omnicomproduction.jp/api/packages/Composer/composer
``` ```
Alternative setup composer local zip file repot:
`composer config repositories.composer.egplusww.jp composer http://composer.egplusww.jp`
## Install package ## Install package
`composer require egrajp/smarty-extended:^4.3` `composer require egrajp/smarty-extended:^4.3`
@@ -28,8 +25,8 @@ Alternative setup composer local zip file repot:
1) update the original composer for ^4.3 1) update the original composer for ^4.3
2) copy over the src/sysplugins and all base files in src/ 2) copy over the src/sysplugins and all base files in src/
3) check either function.html_checkboxes.php and function.html_options.php have changed 3) check either `function_checkboxes.php` and `function_options.php` have changed
4) copy src/plugins except the above two files, be sure to keep the block.t.php and function_popup*.php 4) copy src/plugins except the above two files, be sure to keep the `block.t.php` and `function_popup*.php`
5) Create new release version as official relase number 5) Create new release version as official relase number
## Updated files (different from master) ## Updated files (different from master)