Compare commits

..

9 Commits

Author SHA1 Message Date
Clemens Schwaighofer
254635b023 Merge branch 'phpstan-strict' of github-omc:TBWA-EGPlus-Japan/Client-Projects.php-core-libraries into phpstan-strict 2025-05-15 21:45:06 +09:00
Clemens Schwaighofer
b4a193a6bd Merge branch 'development' into phpstan-strict 2025-05-15 21:42:47 +09:00
Clemens Schwaighofer
074d5bed4c class test login logging update 2025-05-15 15:37:06 +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
3 changed files with 24 additions and 3 deletions

View File

@@ -17,6 +17,20 @@ parameters:
# phpVersion: # phpVersion:
# min: 80200 # PHP 8.2.0 # min: 80200 # PHP 8.2.0
# max: 80300 # PHP latest # max: 80300 # PHP latest
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:
@@ -46,6 +60,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

View File

@@ -31,6 +31,7 @@ $log = new CoreLibs\Logging\Logging([
'log_per_date' => true, 'log_per_date' => true,
]); ]);
$db = new CoreLibs\DB\IO(DB_CONFIG, $log); $db = new CoreLibs\DB\IO(DB_CONFIG, $log);
$log->setLogFileId('classTest-login-override');
$login = new CoreLibs\ACL\Login( $login = new CoreLibs\ACL\Login(
$db, $db,
$log, $log,
@@ -45,6 +46,7 @@ $login = new CoreLibs\ACL\Login(
'locale_path' => BASE . INCLUDES . LOCALE, 'locale_path' => BASE . INCLUDES . LOCALE,
] ]
); );
$log->setLogFileId($LOG_FILE_ID);
ob_end_flush(); ob_end_flush();
$login->loginMainCall(); $login->loginMainCall();
@@ -158,5 +160,6 @@ if (is_string($edit_access_cuid)) {
print "EA ID: " . $edit_access_id . "<br>"; print "EA ID: " . $edit_access_id . "<br>";
print "EA CUID: " . $log->prAr($edit_access_cuid) . "<br>"; print "EA CUID: " . $log->prAr($edit_access_cuid) . "<br>";
print "REV EA CUID: " . $log->prAr($edit_access_id_rev) . "<br>"; print "REV EA CUID: " . $log->prAr($edit_access_id_rev) . "<br>";
$log->info('This is a test');
print "</body></html>"; print "</body></html>";

View File

@@ -163,11 +163,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;
} }