Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dfdfcf87f2 | ||
|
|
6218e0a6a8 | ||
|
|
a84a745be2 | ||
|
|
312762e92e | ||
|
|
fa4c1f0597 | ||
|
|
438a75af23 | ||
|
|
afd8ff3e31 | ||
|
|
4343af7937 | ||
|
|
d06769c48b | ||
|
|
4c0390f082 | ||
|
|
95bee3dc8c | ||
|
|
65132d8a4a | ||
|
|
b2243cd06d | ||
|
|
8f09b67d86 | ||
|
|
fe459aec80 | ||
|
|
de0ed058ca |
@@ -44,6 +44,11 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'str' => 'INFO',
|
'str' => 'INFO',
|
||||||
'expected' => 'info',
|
'expected' => 'info',
|
||||||
],
|
],
|
||||||
|
'notice' => [
|
||||||
|
'level' => 'notice',
|
||||||
|
'str' => 'NOTICE',
|
||||||
|
'expected' => 'notice',
|
||||||
|
],
|
||||||
'warn' => [
|
'warn' => [
|
||||||
'level' => 'warn',
|
'level' => 'warn',
|
||||||
'str' => 'WARN',
|
'str' => 'WARN',
|
||||||
@@ -91,9 +96,9 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
public function testErrorMessageLevelOk(string $level, string $str, string $expected): void
|
public function testErrorMessageLevelOk(string $level, string $str, string $expected): void
|
||||||
{
|
{
|
||||||
$log = new \CoreLibs\Logging\Logging([
|
$log = new \CoreLibs\Logging\Logging([
|
||||||
'log_file_id' => 'testErrorMessages',
|
'log_file_id' => 'testErrorMessagesLevelOk',
|
||||||
'log_folder' => self::LOG_FOLDER,
|
'log_folder' => self::LOG_FOLDER,
|
||||||
'log_level' => Level::Debug,
|
'log_level' => Level::Error,
|
||||||
]);
|
]);
|
||||||
$em = new \CoreLibs\Logging\ErrorMessage($log);
|
$em = new \CoreLibs\Logging\ErrorMessage($log);
|
||||||
$em->setMessage(
|
$em->setMessage(
|
||||||
@@ -106,6 +111,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'str' => $str,
|
'str' => $str,
|
||||||
'id' => '',
|
'id' => '',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
],
|
],
|
||||||
$em->getLastErrorMsg()
|
$em->getLastErrorMsg()
|
||||||
@@ -122,9 +128,9 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
public function testErrorMessageOk(): void
|
public function testErrorMessageOk(): void
|
||||||
{
|
{
|
||||||
$log = new \CoreLibs\Logging\Logging([
|
$log = new \CoreLibs\Logging\Logging([
|
||||||
'log_file_id' => 'testErrorMessages',
|
'log_file_id' => 'testErrorMessagesOk',
|
||||||
'log_folder' => self::LOG_FOLDER,
|
'log_folder' => self::LOG_FOLDER,
|
||||||
'log_level' => Level::Debug
|
'log_level' => Level::Error
|
||||||
]);
|
]);
|
||||||
$em = new \CoreLibs\Logging\ErrorMessage($log);
|
$em = new \CoreLibs\Logging\ErrorMessage($log);
|
||||||
$em->setErrorMsg(
|
$em->setErrorMsg(
|
||||||
@@ -139,6 +145,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'info',
|
'level' => 'info',
|
||||||
'str' => 'INFO MESSAGE',
|
'str' => 'INFO MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
],
|
],
|
||||||
$em->getLastErrorMsg()
|
$em->getLastErrorMsg()
|
||||||
@@ -154,6 +161,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'info',
|
'level' => 'info',
|
||||||
'str' => 'INFO MESSAGE',
|
'str' => 'INFO MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -171,6 +179,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'error',
|
'level' => 'error',
|
||||||
'str' => 'ERROR MESSAGE',
|
'str' => 'ERROR MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
],
|
],
|
||||||
$em->getLastErrorMsg()
|
$em->getLastErrorMsg()
|
||||||
@@ -186,6 +195,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'info',
|
'level' => 'info',
|
||||||
'str' => 'INFO MESSAGE',
|
'str' => 'INFO MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -193,6 +203,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'error',
|
'level' => 'error',
|
||||||
'str' => 'ERROR MESSAGE',
|
'str' => 'ERROR MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -200,14 +211,60 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Undocumented function
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function providerErrorMessageLog(): array
|
public function providerErrorMessageLog(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
'error, not logged' => [
|
||||||
|
'id' => '200',
|
||||||
|
'level' => 'error',
|
||||||
|
'str' => 'ERROR MESSAGE',
|
||||||
|
'message' => null,
|
||||||
|
'log_error' => null,
|
||||||
|
'expected' => '<ERROR> ERROR MESSAGE',
|
||||||
|
],
|
||||||
|
'error, logged' => [
|
||||||
|
'id' => '200',
|
||||||
|
'level' => 'error',
|
||||||
|
'str' => 'ERROR MESSAGE',
|
||||||
|
'message' => null,
|
||||||
|
'log_error' => true,
|
||||||
|
'expected' => '<ERROR> ERROR MESSAGE',
|
||||||
|
],
|
||||||
|
'error, logged, message' => [
|
||||||
|
'id' => '200',
|
||||||
|
'level' => 'error',
|
||||||
|
'str' => 'ERROR MESSAGE',
|
||||||
|
'message' => 'OTHER ERROR MESSAGE',
|
||||||
|
'log_error' => true,
|
||||||
|
'expected' => '<ERROR> OTHER ERROR MESSAGE',
|
||||||
|
],
|
||||||
|
'notice' => [
|
||||||
|
'id' => '100',
|
||||||
|
'level' => 'notice',
|
||||||
|
'str' => 'NOTICE MESSAGE',
|
||||||
|
'message' => null,
|
||||||
|
'log_error' => null,
|
||||||
|
'expected' => '<NOTICE> NOTICE MESSAGE',
|
||||||
|
],
|
||||||
|
'notice, message' => [
|
||||||
|
'id' => '100',
|
||||||
|
'level' => 'notice',
|
||||||
|
'str' => 'NOTICE MESSAGE',
|
||||||
|
'message' => 'OTHER NOTICE MESSAGE',
|
||||||
|
'log_error' => null,
|
||||||
|
'expected' => '<NOTICE> OTHER NOTICE MESSAGE',
|
||||||
|
],
|
||||||
'crash' => [
|
'crash' => [
|
||||||
'id' => '300',
|
'id' => '300',
|
||||||
'level' => 'crash',
|
'level' => 'crash',
|
||||||
'str' => 'CRASH MESSAGE',
|
'str' => 'CRASH MESSAGE',
|
||||||
'message' => null,
|
'message' => null,
|
||||||
|
'log_error' => null,
|
||||||
'expected' => '<ALERT> CRASH MESSAGE',
|
'expected' => '<ALERT> CRASH MESSAGE',
|
||||||
],
|
],
|
||||||
'crash, message' => [
|
'crash, message' => [
|
||||||
@@ -215,6 +272,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'crash',
|
'level' => 'crash',
|
||||||
'str' => 'CRASH MESSAGE',
|
'str' => 'CRASH MESSAGE',
|
||||||
'message' => 'OTHER CRASH MESSAGE',
|
'message' => 'OTHER CRASH MESSAGE',
|
||||||
|
'log_error' => null,
|
||||||
'expected' => '<ALERT> OTHER CRASH MESSAGE',
|
'expected' => '<ALERT> OTHER CRASH MESSAGE',
|
||||||
],
|
],
|
||||||
'abort' => [
|
'abort' => [
|
||||||
@@ -222,6 +280,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'abort',
|
'level' => 'abort',
|
||||||
'str' => 'ABORT MESSAGE',
|
'str' => 'ABORT MESSAGE',
|
||||||
'message' => null,
|
'message' => null,
|
||||||
|
'log_error' => null,
|
||||||
'expected' => '<CRITICAL> ABORT MESSAGE',
|
'expected' => '<CRITICAL> ABORT MESSAGE',
|
||||||
],
|
],
|
||||||
'abort, message' => [
|
'abort, message' => [
|
||||||
@@ -229,6 +288,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'abort',
|
'level' => 'abort',
|
||||||
'str' => 'ABORT MESSAGE',
|
'str' => 'ABORT MESSAGE',
|
||||||
'message' => 'OTHER ABORT MESSAGE',
|
'message' => 'OTHER ABORT MESSAGE',
|
||||||
|
'log_error' => null,
|
||||||
'expected' => '<CRITICAL> OTHER ABORT MESSAGE',
|
'expected' => '<CRITICAL> OTHER ABORT MESSAGE',
|
||||||
],
|
],
|
||||||
'unknown' => [
|
'unknown' => [
|
||||||
@@ -236,6 +296,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'wrong level',
|
'level' => 'wrong level',
|
||||||
'str' => 'WRONG LEVEL MESSAGE',
|
'str' => 'WRONG LEVEL MESSAGE',
|
||||||
'message' => null,
|
'message' => null,
|
||||||
|
'log_error' => null,
|
||||||
'expected' => '<EMERGENCY> WRONG LEVEL MESSAGE',
|
'expected' => '<EMERGENCY> WRONG LEVEL MESSAGE',
|
||||||
],
|
],
|
||||||
'unknown, message' => [
|
'unknown, message' => [
|
||||||
@@ -243,6 +304,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'wrong level',
|
'level' => 'wrong level',
|
||||||
'str' => 'WRONG LEVEL MESSAGE',
|
'str' => 'WRONG LEVEL MESSAGE',
|
||||||
'message' => 'OTHER WRONG LEVEL MESSAGE',
|
'message' => 'OTHER WRONG LEVEL MESSAGE',
|
||||||
|
'log_error' => null,
|
||||||
'expected' => '<EMERGENCY> OTHER WRONG LEVEL MESSAGE',
|
'expected' => '<EMERGENCY> OTHER WRONG LEVEL MESSAGE',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
@@ -252,14 +314,82 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
* Undocumented function
|
* Undocumented function
|
||||||
*
|
*
|
||||||
* @dataProvider providerErrorMessageLog
|
* @dataProvider providerErrorMessageLog
|
||||||
* @testdox Test Log writing [$_dataName]
|
* @testdox Test Log writing with log level Error [$_dataName]
|
||||||
*
|
*
|
||||||
|
* @param string $id
|
||||||
|
* @param string $level
|
||||||
|
* @param string $str
|
||||||
|
* @param string|null $message
|
||||||
|
* @param bool|null $log_error
|
||||||
|
* @param string $expected
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testErrorMessageLog(string $id, string $level, string $str, ?string $message, string $expected)
|
public function testErrorMessageLogErrorLevel(
|
||||||
{
|
string $id,
|
||||||
|
string $level,
|
||||||
|
string $str,
|
||||||
|
?string $message,
|
||||||
|
?bool $log_error,
|
||||||
|
string $expected
|
||||||
|
): void {
|
||||||
$log = new \CoreLibs\Logging\Logging([
|
$log = new \CoreLibs\Logging\Logging([
|
||||||
'log_file_id' => 'testErrorMessages',
|
'log_file_id' => 'testErrorMessagesLogError',
|
||||||
|
'log_folder' => self::LOG_FOLDER,
|
||||||
|
'log_level' => Level::Notice,
|
||||||
|
'log_per_run' => true
|
||||||
|
]);
|
||||||
|
$em = new \CoreLibs\Logging\ErrorMessage($log);
|
||||||
|
$em->setErrorMsg(
|
||||||
|
$id,
|
||||||
|
$level,
|
||||||
|
$str,
|
||||||
|
message: $message,
|
||||||
|
log_error: $log_error
|
||||||
|
);
|
||||||
|
$file_content = '';
|
||||||
|
if (is_file($log->getLogFolder() . $log->getLogFile())) {
|
||||||
|
$file_content = file_get_contents(
|
||||||
|
$log->getLogFolder() . $log->getLogFile()
|
||||||
|
) ?: '';
|
||||||
|
}
|
||||||
|
// if error, if null or false, it will not be logged
|
||||||
|
if ($level == 'error' && ($log_error === null || $log_error === false)) {
|
||||||
|
$this->assertStringNotContainsString(
|
||||||
|
$expected,
|
||||||
|
$file_content
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->assertStringContainsString(
|
||||||
|
$expected,
|
||||||
|
$file_content
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Undocumented function
|
||||||
|
*
|
||||||
|
* @dataProvider providerErrorMessageLog
|
||||||
|
* @testdox Test Log writing with log Level Debug [$_dataName]
|
||||||
|
*
|
||||||
|
* @param string $id
|
||||||
|
* @param string $level
|
||||||
|
* @param string $str
|
||||||
|
* @param string|null $message
|
||||||
|
* @param bool|null $log_error
|
||||||
|
* @param string $expected
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testErrorMessageLogErrorDebug(
|
||||||
|
string $id,
|
||||||
|
string $level,
|
||||||
|
string $str,
|
||||||
|
?string $message,
|
||||||
|
?bool $log_error,
|
||||||
|
string $expected
|
||||||
|
): void {
|
||||||
|
$log = new \CoreLibs\Logging\Logging([
|
||||||
|
'log_file_id' => 'testErrorMessagesLogDebug',
|
||||||
'log_folder' => self::LOG_FOLDER,
|
'log_folder' => self::LOG_FOLDER,
|
||||||
'log_level' => Level::Debug,
|
'log_level' => Level::Debug,
|
||||||
'log_per_run' => true
|
'log_per_run' => true
|
||||||
@@ -269,15 +399,27 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
$id,
|
$id,
|
||||||
$level,
|
$level,
|
||||||
$str,
|
$str,
|
||||||
message: $message
|
message: $message,
|
||||||
);
|
log_error: $log_error
|
||||||
$file_content = file_get_contents(
|
|
||||||
$log->getLogFolder() . $log->getLogFile()
|
|
||||||
) ?: '';
|
|
||||||
$this->assertStringContainsString(
|
|
||||||
$expected,
|
|
||||||
$file_content
|
|
||||||
);
|
);
|
||||||
|
$file_content = '';
|
||||||
|
if (is_file($log->getLogFolder() . $log->getLogFile())) {
|
||||||
|
$file_content = file_get_contents(
|
||||||
|
$log->getLogFolder() . $log->getLogFile()
|
||||||
|
) ?: '';
|
||||||
|
}
|
||||||
|
// if error, and log is debug level, only explicit false are not logged
|
||||||
|
if ($level == 'error' && $log_error === false) {
|
||||||
|
$this->assertStringNotContainsString(
|
||||||
|
$expected,
|
||||||
|
$file_content
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->assertStringContainsString(
|
||||||
|
$expected,
|
||||||
|
$file_content
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
46
composer.lock
generated
46
composer.lock
generated
@@ -481,16 +481,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "doctrine/deprecations",
|
"name": "doctrine/deprecations",
|
||||||
"version": "v1.1.1",
|
"version": "1.1.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/doctrine/deprecations.git",
|
"url": "https://github.com/doctrine/deprecations.git",
|
||||||
"reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3"
|
"reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
|
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
|
||||||
"reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
|
"reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -522,9 +522,9 @@
|
|||||||
"homepage": "https://www.doctrine-project.org/",
|
"homepage": "https://www.doctrine-project.org/",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/doctrine/deprecations/issues",
|
"issues": "https://github.com/doctrine/deprecations/issues",
|
||||||
"source": "https://github.com/doctrine/deprecations/tree/v1.1.1"
|
"source": "https://github.com/doctrine/deprecations/tree/1.1.2"
|
||||||
},
|
},
|
||||||
"time": "2023-06-03T09:27:29+00:00"
|
"time": "2023-09-27T20:04:15+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "felixfbecker/advanced-json-rpc",
|
"name": "felixfbecker/advanced-json-rpc",
|
||||||
@@ -1133,16 +1133,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpdoc-parser",
|
"name": "phpstan/phpdoc-parser",
|
||||||
"version": "1.24.0",
|
"version": "1.24.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpdoc-parser.git",
|
"url": "https://github.com/phpstan/phpdoc-parser.git",
|
||||||
"reference": "3510b0a6274cc42f7219367cb3abfc123ffa09d6"
|
"reference": "bcad8d995980440892759db0c32acae7c8e79442"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/3510b0a6274cc42f7219367cb3abfc123ffa09d6",
|
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442",
|
||||||
"reference": "3510b0a6274cc42f7219367cb3abfc123ffa09d6",
|
"reference": "bcad8d995980440892759db0c32acae7c8e79442",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1174,22 +1174,22 @@
|
|||||||
"description": "PHPDoc parser with support for nullable, intersection and generic types",
|
"description": "PHPDoc parser with support for nullable, intersection and generic types",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
|
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
|
||||||
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.0"
|
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2"
|
||||||
},
|
},
|
||||||
"time": "2023-09-07T20:46:32+00:00"
|
"time": "2023-09-26T12:28:12+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan",
|
"name": "phpstan/phpstan",
|
||||||
"version": "1.10.33",
|
"version": "1.10.36",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpstan.git",
|
"url": "https://github.com/phpstan/phpstan.git",
|
||||||
"reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1"
|
"reference": "ffa3089511121a672e62969404e4fddc753f9b15"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1",
|
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/ffa3089511121a672e62969404e4fddc753f9b15",
|
||||||
"reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1",
|
"reference": "ffa3089511121a672e62969404e4fddc753f9b15",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1238,7 +1238,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-09-04T12:20:53+00:00"
|
"time": "2023-09-29T14:07:45+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan-deprecation-rules",
|
"name": "phpstan/phpstan-deprecation-rules",
|
||||||
@@ -2254,16 +2254,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/string",
|
"name": "symfony/string",
|
||||||
"version": "v6.3.2",
|
"version": "v6.3.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/string.git",
|
"url": "https://github.com/symfony/string.git",
|
||||||
"reference": "53d1a83225002635bca3482fcbf963001313fb68"
|
"reference": "13d76d0fb049051ed12a04bef4f9de8715bea339"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/string/zipball/53d1a83225002635bca3482fcbf963001313fb68",
|
"url": "https://api.github.com/repos/symfony/string/zipball/13d76d0fb049051ed12a04bef4f9de8715bea339",
|
||||||
"reference": "53d1a83225002635bca3482fcbf963001313fb68",
|
"reference": "13d76d0fb049051ed12a04bef4f9de8715bea339",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -2320,7 +2320,7 @@
|
|||||||
"utf8"
|
"utf8"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/string/tree/v6.3.2"
|
"source": "https://github.com/symfony/string/tree/v6.3.5"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -2336,7 +2336,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-07-05T08:41:27+00:00"
|
"time": "2023-09-18T10:38:32+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "tysonandre/var_representation_polyfill",
|
"name": "tysonandre/var_representation_polyfill",
|
||||||
|
|||||||
54
vendor/composer/installed.json
vendored
54
vendor/composer/installed.json
vendored
@@ -441,17 +441,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "doctrine/deprecations",
|
"name": "doctrine/deprecations",
|
||||||
"version": "v1.1.1",
|
"version": "1.1.2",
|
||||||
"version_normalized": "1.1.1.0",
|
"version_normalized": "1.1.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/doctrine/deprecations.git",
|
"url": "https://github.com/doctrine/deprecations.git",
|
||||||
"reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3"
|
"reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
|
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
|
||||||
"reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
|
"reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -469,7 +469,7 @@
|
|||||||
"suggest": {
|
"suggest": {
|
||||||
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
|
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
|
||||||
},
|
},
|
||||||
"time": "2023-06-03T09:27:29+00:00",
|
"time": "2023-09-27T20:04:15+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -485,7 +485,7 @@
|
|||||||
"homepage": "https://www.doctrine-project.org/",
|
"homepage": "https://www.doctrine-project.org/",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/doctrine/deprecations/issues",
|
"issues": "https://github.com/doctrine/deprecations/issues",
|
||||||
"source": "https://github.com/doctrine/deprecations/tree/v1.1.1"
|
"source": "https://github.com/doctrine/deprecations/tree/1.1.2"
|
||||||
},
|
},
|
||||||
"install-path": "../doctrine/deprecations"
|
"install-path": "../doctrine/deprecations"
|
||||||
},
|
},
|
||||||
@@ -1129,17 +1129,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpdoc-parser",
|
"name": "phpstan/phpdoc-parser",
|
||||||
"version": "1.24.0",
|
"version": "1.24.2",
|
||||||
"version_normalized": "1.24.0.0",
|
"version_normalized": "1.24.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpdoc-parser.git",
|
"url": "https://github.com/phpstan/phpdoc-parser.git",
|
||||||
"reference": "3510b0a6274cc42f7219367cb3abfc123ffa09d6"
|
"reference": "bcad8d995980440892759db0c32acae7c8e79442"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/3510b0a6274cc42f7219367cb3abfc123ffa09d6",
|
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442",
|
||||||
"reference": "3510b0a6274cc42f7219367cb3abfc123ffa09d6",
|
"reference": "bcad8d995980440892759db0c32acae7c8e79442",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1156,7 +1156,7 @@
|
|||||||
"phpunit/phpunit": "^9.5",
|
"phpunit/phpunit": "^9.5",
|
||||||
"symfony/process": "^5.2"
|
"symfony/process": "^5.2"
|
||||||
},
|
},
|
||||||
"time": "2023-09-07T20:46:32+00:00",
|
"time": "2023-09-26T12:28:12+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -1173,23 +1173,23 @@
|
|||||||
"description": "PHPDoc parser with support for nullable, intersection and generic types",
|
"description": "PHPDoc parser with support for nullable, intersection and generic types",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
|
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
|
||||||
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.0"
|
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2"
|
||||||
},
|
},
|
||||||
"install-path": "../phpstan/phpdoc-parser"
|
"install-path": "../phpstan/phpdoc-parser"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan",
|
"name": "phpstan/phpstan",
|
||||||
"version": "1.10.33",
|
"version": "1.10.36",
|
||||||
"version_normalized": "1.10.33.0",
|
"version_normalized": "1.10.36.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpstan.git",
|
"url": "https://github.com/phpstan/phpstan.git",
|
||||||
"reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1"
|
"reference": "ffa3089511121a672e62969404e4fddc753f9b15"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1",
|
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/ffa3089511121a672e62969404e4fddc753f9b15",
|
||||||
"reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1",
|
"reference": "ffa3089511121a672e62969404e4fddc753f9b15",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1198,7 +1198,7 @@
|
|||||||
"conflict": {
|
"conflict": {
|
||||||
"phpstan/phpstan-shim": "*"
|
"phpstan/phpstan-shim": "*"
|
||||||
},
|
},
|
||||||
"time": "2023-09-04T12:20:53+00:00",
|
"time": "2023-09-29T14:07:45+00:00",
|
||||||
"bin": [
|
"bin": [
|
||||||
"phpstan",
|
"phpstan",
|
||||||
"phpstan.phar"
|
"phpstan.phar"
|
||||||
@@ -2351,17 +2351,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/string",
|
"name": "symfony/string",
|
||||||
"version": "v6.3.2",
|
"version": "v6.3.5",
|
||||||
"version_normalized": "6.3.2.0",
|
"version_normalized": "6.3.5.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/string.git",
|
"url": "https://github.com/symfony/string.git",
|
||||||
"reference": "53d1a83225002635bca3482fcbf963001313fb68"
|
"reference": "13d76d0fb049051ed12a04bef4f9de8715bea339"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/string/zipball/53d1a83225002635bca3482fcbf963001313fb68",
|
"url": "https://api.github.com/repos/symfony/string/zipball/13d76d0fb049051ed12a04bef4f9de8715bea339",
|
||||||
"reference": "53d1a83225002635bca3482fcbf963001313fb68",
|
"reference": "13d76d0fb049051ed12a04bef4f9de8715bea339",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -2381,7 +2381,7 @@
|
|||||||
"symfony/translation-contracts": "^2.5|^3.0",
|
"symfony/translation-contracts": "^2.5|^3.0",
|
||||||
"symfony/var-exporter": "^5.4|^6.0"
|
"symfony/var-exporter": "^5.4|^6.0"
|
||||||
},
|
},
|
||||||
"time": "2023-07-05T08:41:27+00:00",
|
"time": "2023-09-18T10:38:32+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -2420,7 +2420,7 @@
|
|||||||
"utf8"
|
"utf8"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/string/tree/v6.3.2"
|
"source": "https://github.com/symfony/string/tree/v6.3.5"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
|||||||
24
vendor/composer/installed.php
vendored
24
vendor/composer/installed.php
vendored
@@ -65,9 +65,9 @@
|
|||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'doctrine/deprecations' => array(
|
'doctrine/deprecations' => array(
|
||||||
'pretty_version' => 'v1.1.1',
|
'pretty_version' => '1.1.2',
|
||||||
'version' => '1.1.1.0',
|
'version' => '1.1.2.0',
|
||||||
'reference' => '612a3ee5ab0d5dd97b7cf3874a6efe24325efac3',
|
'reference' => '4f2d4f2836e7ec4e7a8625e75c6aa916004db931',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../doctrine/deprecations',
|
'install_path' => __DIR__ . '/../doctrine/deprecations',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@@ -182,18 +182,18 @@
|
|||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'phpstan/phpdoc-parser' => array(
|
'phpstan/phpdoc-parser' => array(
|
||||||
'pretty_version' => '1.24.0',
|
'pretty_version' => '1.24.2',
|
||||||
'version' => '1.24.0.0',
|
'version' => '1.24.2.0',
|
||||||
'reference' => '3510b0a6274cc42f7219367cb3abfc123ffa09d6',
|
'reference' => 'bcad8d995980440892759db0c32acae7c8e79442',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../phpstan/phpdoc-parser',
|
'install_path' => __DIR__ . '/../phpstan/phpdoc-parser',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'phpstan/phpstan' => array(
|
'phpstan/phpstan' => array(
|
||||||
'pretty_version' => '1.10.33',
|
'pretty_version' => '1.10.36',
|
||||||
'version' => '1.10.33.0',
|
'version' => '1.10.36.0',
|
||||||
'reference' => '03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1',
|
'reference' => 'ffa3089511121a672e62969404e4fddc753f9b15',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../phpstan/phpstan',
|
'install_path' => __DIR__ . '/../phpstan/phpstan',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@@ -347,9 +347,9 @@
|
|||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'symfony/string' => array(
|
'symfony/string' => array(
|
||||||
'pretty_version' => 'v6.3.2',
|
'pretty_version' => 'v6.3.5',
|
||||||
'version' => '6.3.2.0',
|
'version' => '6.3.5.0',
|
||||||
'reference' => '53d1a83225002635bca3482fcbf963001313fb68',
|
'reference' => '13d76d0fb049051ed12a04bef4f9de8715bea339',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/string',
|
'install_path' => __DIR__ . '/../symfony/string',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ use function array_reduce;
|
|||||||
use function assert;
|
use function assert;
|
||||||
use function debug_backtrace;
|
use function debug_backtrace;
|
||||||
use function sprintf;
|
use function sprintf;
|
||||||
|
use function str_replace;
|
||||||
use function strpos;
|
use function strpos;
|
||||||
use function strrpos;
|
use function strrpos;
|
||||||
use function substr;
|
use function substr;
|
||||||
@@ -138,7 +139,7 @@ class Deprecation
|
|||||||
|
|
||||||
// first check that the caller is not from a tests folder, in which case we always let deprecations pass
|
// first check that the caller is not from a tests folder, in which case we always let deprecations pass
|
||||||
if (isset($backtrace[1]['file'], $backtrace[0]['file']) && strpos($backtrace[1]['file'], DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR) === false) {
|
if (isset($backtrace[1]['file'], $backtrace[0]['file']) && strpos($backtrace[1]['file'], DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR) === false) {
|
||||||
$path = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR;
|
$path = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $package) . DIRECTORY_SEPARATOR;
|
||||||
|
|
||||||
if (strpos($backtrace[0]['file'], $path) === false) {
|
if (strpos($backtrace[0]['file'], $path) === false) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
22
vendor/doctrine/deprecations/phpcs.xml
vendored
22
vendor/doctrine/deprecations/phpcs.xml
vendored
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<ruleset>
|
|
||||||
<arg name="basepath" value="."/>
|
|
||||||
<arg name="extensions" value="php"/>
|
|
||||||
<arg name="parallel" value="80"/>
|
|
||||||
<arg name="cache" value=".phpcs-cache"/>
|
|
||||||
<arg name="colors"/>
|
|
||||||
|
|
||||||
<!-- Ignore warnings, show progress of the run and show sniff names -->
|
|
||||||
<arg value="nps"/>
|
|
||||||
|
|
||||||
<config name="php_version" value="70100"/>
|
|
||||||
|
|
||||||
<!-- Directories to be checked -->
|
|
||||||
<file>lib</file>
|
|
||||||
<file>tests</file>
|
|
||||||
|
|
||||||
<!-- Include full Doctrine Coding Standard -->
|
|
||||||
<rule ref="Doctrine">
|
|
||||||
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint" />
|
|
||||||
</rule>
|
|
||||||
</ruleset>
|
|
||||||
9
vendor/doctrine/deprecations/phpstan.neon
vendored
9
vendor/doctrine/deprecations/phpstan.neon
vendored
@@ -1,9 +0,0 @@
|
|||||||
parameters:
|
|
||||||
level: 6
|
|
||||||
paths:
|
|
||||||
- lib
|
|
||||||
- tests
|
|
||||||
|
|
||||||
includes:
|
|
||||||
- vendor/phpstan/phpstan-phpunit/extension.neon
|
|
||||||
- vendor/phpstan/phpstan-phpunit/rules.neon
|
|
||||||
30
vendor/doctrine/deprecations/psalm.xml
vendored
30
vendor/doctrine/deprecations/psalm.xml
vendored
@@ -1,30 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<psalm
|
|
||||||
errorLevel="1"
|
|
||||||
resolveFromConfigFile="true"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xmlns="https://getpsalm.org/schema/config"
|
|
||||||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
|
||||||
findUnusedBaselineEntry="true"
|
|
||||||
findUnusedCode="false"
|
|
||||||
>
|
|
||||||
<projectFiles>
|
|
||||||
<directory name="lib/Doctrine/Deprecations" />
|
|
||||||
<directory name="tests/Doctrine/Deprecations" />
|
|
||||||
<ignoreFiles>
|
|
||||||
<directory name="vendor" />
|
|
||||||
</ignoreFiles>
|
|
||||||
</projectFiles>
|
|
||||||
<plugins>
|
|
||||||
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
|
|
||||||
</plugins>
|
|
||||||
<issueHandlers>
|
|
||||||
<DeprecatedMethod>
|
|
||||||
<errorLevel type="suppress">
|
|
||||||
<!-- Remove when dropping support for PHPUnit 9.6 -->
|
|
||||||
<referencedMethod name="PHPUnit\Framework\TestCase::expectDeprecation"/>
|
|
||||||
<referencedMethod name="PHPUnit\Framework\TestCase::expectDeprecationMessage"/>
|
|
||||||
</errorLevel>
|
|
||||||
</DeprecatedMethod>
|
|
||||||
</issueHandlers>
|
|
||||||
</psalm>
|
|
||||||
@@ -10,11 +10,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Ast/NodeTraverser.php
|
path: src/Ast/NodeTraverser.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Strict comparison using \\=\\=\\= between 2 and 2 will always evaluate to true\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: src/Ast/NodeTraverser.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Variable property access on PHPStan\\\\PhpDocParser\\\\Ast\\\\Node\\.$#"
|
message: "#^Variable property access on PHPStan\\\\PhpDocParser\\\\Ast\\\\Node\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
|||||||
@@ -398,42 +398,33 @@ class TypeParser
|
|||||||
public function parseGeneric(TokenIterator $tokens, Ast\Type\IdentifierTypeNode $baseType): Ast\Type\GenericTypeNode
|
public function parseGeneric(TokenIterator $tokens, Ast\Type\IdentifierTypeNode $baseType): Ast\Type\GenericTypeNode
|
||||||
{
|
{
|
||||||
$tokens->consumeTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET);
|
$tokens->consumeTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET);
|
||||||
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
|
||||||
|
|
||||||
|
$startLine = $baseType->getAttribute(Ast\Attribute::START_LINE);
|
||||||
|
$startIndex = $baseType->getAttribute(Ast\Attribute::START_INDEX);
|
||||||
$genericTypes = [];
|
$genericTypes = [];
|
||||||
$variances = [];
|
$variances = [];
|
||||||
|
|
||||||
[$genericTypes[], $variances[]] = $this->parseGenericTypeArgument($tokens);
|
$isFirst = true;
|
||||||
|
while ($isFirst || $tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) {
|
||||||
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
|
||||||
|
|
||||||
while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) {
|
|
||||||
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
||||||
if ($tokens->tryConsumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET)) {
|
|
||||||
// trailing comma case
|
|
||||||
$type = new Ast\Type\GenericTypeNode($baseType, $genericTypes, $variances);
|
|
||||||
$startLine = $baseType->getAttribute(Ast\Attribute::START_LINE);
|
|
||||||
$startIndex = $baseType->getAttribute(Ast\Attribute::START_INDEX);
|
|
||||||
if ($startLine !== null && $startIndex !== null) {
|
|
||||||
$type = $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $type;
|
// trailing comma case
|
||||||
|
if (!$isFirst && $tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET)) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
$isFirst = false;
|
||||||
|
|
||||||
[$genericTypes[], $variances[]] = $this->parseGenericTypeArgument($tokens);
|
[$genericTypes[], $variances[]] = $this->parseGenericTypeArgument($tokens);
|
||||||
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
|
||||||
$tokens->consumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET);
|
|
||||||
|
|
||||||
$type = new Ast\Type\GenericTypeNode($baseType, $genericTypes, $variances);
|
$type = new Ast\Type\GenericTypeNode($baseType, $genericTypes, $variances);
|
||||||
$startLine = $baseType->getAttribute(Ast\Attribute::START_LINE);
|
|
||||||
$startIndex = $baseType->getAttribute(Ast\Attribute::START_INDEX);
|
|
||||||
if ($startLine !== null && $startIndex !== null) {
|
if ($startLine !== null && $startIndex !== null) {
|
||||||
$type = $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex);
|
$type = $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tokens->consumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET);
|
||||||
|
|
||||||
return $type;
|
return $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -533,7 +524,7 @@ class TypeParser
|
|||||||
return $this->parseNullable($tokens);
|
return $this->parseNullable($tokens);
|
||||||
|
|
||||||
} elseif ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) {
|
} elseif ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) {
|
||||||
$type = $this->parse($tokens);
|
$type = $this->subParse($tokens);
|
||||||
$tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES);
|
$tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES);
|
||||||
if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) {
|
if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) {
|
||||||
$type = $this->tryParseArrayOrOffsetAccess($tokens, $type);
|
$type = $this->tryParseArrayOrOffsetAccess($tokens, $type);
|
||||||
|
|||||||
BIN
vendor/phpstan/phpstan/phpstan.phar
vendored
BIN
vendor/phpstan/phpstan/phpstan.phar
vendored
Binary file not shown.
26
vendor/phpstan/phpstan/phpstan.phar.asc
vendored
26
vendor/phpstan/phpstan/phpstan.phar.asc
vendored
@@ -1,16 +1,16 @@
|
|||||||
-----BEGIN PGP SIGNATURE-----
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
|
||||||
iQIzBAABCgAdFiEEynwsejDI6OEnSoR2UcZzBf/C5cAFAmT1y40ACgkQUcZzBf/C
|
iQIzBAABCgAdFiEEynwsejDI6OEnSoR2UcZzBf/C5cAFAmUW2hQACgkQUcZzBf/C
|
||||||
5cDm6Q//VupQizxW3TICxhwzMDz05+nI8d72mn5vd94Niat90L1wPVHSZ9eBQSs3
|
5cAX+g/8DLEpwgjbRjXNPaPoL9y2lbhYuOAkFuTLElmFTNRvmUgOrqI3pGdfWves
|
||||||
xMGVKJufB/3tQp6rviYk0aFnTFsKYkgwQYSDk1P9D7VrcJdpB461P3FT4MGsRk8E
|
tFCRVdzefPnbi8PX7Y0u14bKY/YieSgeXEwqaZfllPdan7TJ7gdu8ZvOxZeiOvT5
|
||||||
SSo55EuMGpiVvgoKbiPXeYV76yEpSMpelbKDNTm7iglLFVQKAnTv17aQv/UdBoYk
|
Ns7Bnn7F+TyK7Z9gFn9pSt4bopLXgoGM3Xw4yg//HWQIb2gYzP/OEUwzF6vj1N88
|
||||||
t/dOS0ovoWmjkj9837EA5o2FAkhA5njlpvRs1l5Jt/tZsZtJTcDjPYfP5kIGbOwp
|
x7GyXKhuNClh8DOYLPdw/Mp5C+Z4wEqUpxFFZ6nMZN239gOC4kxz2IfbMj1Lb1jR
|
||||||
V6xKYW7JYht+O0si3GxGmWGOE4VbOHLpUDpLMmVu53njjeGAIkPgX53TqBRbAbVL
|
5diFq+lAB9IfmqlRqJnlkRDmM3jt6G6+i4YNIdk8iRN3ppMJWT0Ck9cSiRSPhImB
|
||||||
FjpDSZYC08lE4WblqXZEP6aKqVqthQ4LcGfyZDvuWDgPGHf86cTvfHQvtqRY45kU
|
n/fo4AA+fhomI6aXBECmYRud78ul0nm411KVM+a/cCnVD9nYrab6eC3K6KBeuWOw
|
||||||
GhFDz6IfVlwBrfpc4hKfbhF6Q3Txm8ZSSfiVHim8JFjCqO+jn4qmaXGaOqbNUfv9
|
2SNTdKSY+Al5y6mwjwzLCwrOLR7WxCTMkdO8pcbCj62IuKKyxWtS4xI/oxZE+z1S
|
||||||
fLgg7Bbnu1tZdMv6JJP5Kmk0x5wp4m2vFxDd6NGfm7uz9182/LtXOjqQ0MuGfL+j
|
2o4arkHhv103JQiF9NkbRWnUQakt2IhjWDjZmz051jMjijHfSW3j4WpZ8sjwk5mY
|
||||||
Dw53dl+WdUpr4Xk1m1GkYwDF9zLIwBB7dEghz6c4nbiGvh31MUk6N+4N2eGkjtWW
|
GKO/jQMgJ0M/4h46q+pFawMljBgK+7ECHF1nEAuoF2e+5v8VJ+XRJ+VC6rdvjQWC
|
||||||
B1PPORcpxxXSlhtftCwsJVxRFodQu9cmI0qmw4EUEipFrkFuT7a1rNF48NFyfRMh
|
StcsiFDznyRJgosaOePn39mLt6E0wOBc6Ko8OIoBrSDP7l5Wh+H6yIzpCiPLCm9C
|
||||||
PcB/UcUHMCL7owhfQEEuPvqIPJS4saesCdFeJAM0MKuXB1nNGTQ=
|
8sx9U+LB0Jt+BHpWYReQcHrdbek5H7Iu4h8s/F8YYZFEeI0O9tc=
|
||||||
=HpaR
|
=Y8DE
|
||||||
-----END PGP SIGNATURE-----
|
-----END PGP SIGNATURE-----
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
/*
|
/*
|
||||||
* This file has been auto-generated by the Symfony String Component for internal use.
|
* This file has been auto-generated by the Symfony String Component for internal use.
|
||||||
*
|
*
|
||||||
* Unicode version: 15.0.0
|
* Unicode version: 15.1.0
|
||||||
* Date: 2022-10-05T17:16:36+02:00
|
* Date: 2023-09-13T11:47:12+00:00
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@@ -166,7 +166,7 @@ return [
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
12272,
|
12272,
|
||||||
12283,
|
12287,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
12288,
|
12288,
|
||||||
@@ -396,6 +396,10 @@ return [
|
|||||||
12736,
|
12736,
|
||||||
12771,
|
12771,
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
12783,
|
||||||
|
12783,
|
||||||
|
],
|
||||||
[
|
[
|
||||||
12784,
|
12784,
|
||||||
12799,
|
12799,
|
||||||
@@ -1110,6 +1114,14 @@ return [
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
191457,
|
191457,
|
||||||
|
191471,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
191472,
|
||||||
|
192093,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
192094,
|
||||||
194559,
|
194559,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
/*
|
/*
|
||||||
* This file has been auto-generated by the Symfony String Component for internal use.
|
* This file has been auto-generated by the Symfony String Component for internal use.
|
||||||
*
|
*
|
||||||
* Unicode version: 15.0.0
|
* Unicode version: 15.1.0
|
||||||
* Date: 2022-10-05T17:16:37+02:00
|
* Date: 2023-09-13T11:47:13+00:00
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -35,11 +35,16 @@ print '<div><h1>' . $PAGE_NAME . '</h1></div>';
|
|||||||
|
|
||||||
$em = new \CoreLibs\Logging\ErrorMessage($log);
|
$em = new \CoreLibs\Logging\ErrorMessage($log);
|
||||||
|
|
||||||
|
print "Log ERROR: " . $log->prAr($em->getFlagLogError()) . "<br>";
|
||||||
|
|
||||||
print "FN: " . ml::fromName('Affe')->name . "<br>";
|
print "FN: " . ml::fromName('Affe')->name . "<br>";
|
||||||
print "NU: " . ml::fromValue(100)->name . "<br>";
|
print "NU: " . ml::fromValue(100)->name . "<br>";
|
||||||
print "NU: " . ml::fromValue(1000)->name . "<br>";
|
print "NU: " . ml::fromValue(1000)->name . "<br>";
|
||||||
|
|
||||||
$em->setErrorMsg('123', 'error', 'msg this is bad');
|
$em->setErrorMsg('123', 'error', 'msg this is bad, auto logged if debug');
|
||||||
|
$em->setErrorMsg('123', 'error', 'msg this is bad, auto logged if debug', 'target-id', 'other-style');
|
||||||
|
$em->setErrorMsg('123', 'error', 'msg this is bad, logged always', log_error:true);
|
||||||
|
$em->setErrorMsg('123', 'error', 'msg this is bad, never logged', log_error:false);
|
||||||
$em->setErrorMsg('1000', 'info', 'This is good');
|
$em->setErrorMsg('1000', 'info', 'This is good');
|
||||||
$em->setErrorMsg('9999', 'abort', 'BAD: This is critical (abort)');
|
$em->setErrorMsg('9999', 'abort', 'BAD: This is critical (abort)');
|
||||||
$em->setErrorMsg('10-1000', 'wrong', 'Wrong level: This is emergency');
|
$em->setErrorMsg('10-1000', 'wrong', 'Wrong level: This is emergency');
|
||||||
@@ -49,4 +54,6 @@ print "Errors: <pre>" . $log->prAr($em->getErrorMsg()) . "</pre>";
|
|||||||
|
|
||||||
print "</body></html>";
|
print "</body></html>";
|
||||||
|
|
||||||
|
$log->debug('[END]', '==========================================>');
|
||||||
|
|
||||||
// __END__
|
// __END__
|
||||||
|
|||||||
6
www/admin/edit_base_page_test.php
Normal file
6
www/admin/edit_base_page_test.php
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// empty file for add and remove test
|
||||||
|
|
||||||
|
// __END__
|
||||||
|
|
||||||
@@ -42,6 +42,7 @@
|
|||||||
<textarea name="{$element.data.name}"{if $element.data.rows} rows="{$element.data.rows}"{/if}{if $element.data.cols} cols="{$element.data.cols}"{/if}>{$element.data.value}</textarea>
|
<textarea name="{$element.data.name}"{if $element.data.rows} rows="{$element.data.rows}"{/if}{if $element.data.cols} cols="{$element.data.cols}"{/if}>{$element.data.value}</textarea>
|
||||||
{/if}
|
{/if}
|
||||||
{if $element.type == 'drop_down'}
|
{if $element.type == 'drop_down'}
|
||||||
|
{* {$element.data.selected} *}
|
||||||
{html_options name=$element.data.name values=$element.data.value output=$element.data.output selected=$element.data.selected}
|
{html_options name=$element.data.name values=$element.data.value output=$element.data.output selected=$element.data.selected}
|
||||||
{if $drop_down_input}
|
{if $drop_down_input}
|
||||||
<input type="text" name="{$element.data.input_name}" value="{$element.data.input_value}"{if $element.data.input_size} size="{$element.data.input_size}"{/if}{if $element.data.input_length} maxlength="{$element.data.input_length}"{/if}>
|
<input type="text" name="{$element.data.input_name}" value="{$element.data.input_value}"{if $element.data.input_size} size="{$element.data.input_size}"{/if}{if $element.data.input_length} maxlength="{$element.data.input_length}"{/if}>
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ class EditBase
|
|||||||
private \CoreLibs\Output\Form\Generate $form;
|
private \CoreLibs\Output\Form\Generate $form;
|
||||||
/** @var \CoreLibs\Logging\Logging */
|
/** @var \CoreLibs\Logging\Logging */
|
||||||
public \CoreLibs\Logging\Logging $log;
|
public \CoreLibs\Logging\Logging $log;
|
||||||
|
/** @var \CoreLibs\Language\L10n */
|
||||||
|
public \CoreLibs\Language\L10n $l;
|
||||||
/** @var \CoreLibs\ACL\Login */
|
/** @var \CoreLibs\ACL\Login */
|
||||||
public \CoreLibs\ACL\Login $login;
|
public \CoreLibs\ACL\Login $login;
|
||||||
|
|
||||||
@@ -57,6 +59,7 @@ class EditBase
|
|||||||
) {
|
) {
|
||||||
$this->log = $log;
|
$this->log = $log;
|
||||||
$this->login = $login;
|
$this->login = $login;
|
||||||
|
$this->l = $l10n;
|
||||||
// smarty template engine (extended Translation version)
|
// smarty template engine (extended Translation version)
|
||||||
$this->smarty = new \CoreLibs\Template\SmartyExtend(
|
$this->smarty = new \CoreLibs\Template\SmartyExtend(
|
||||||
$l10n,
|
$l10n,
|
||||||
@@ -77,7 +80,7 @@ class EditBase
|
|||||||
echo "I am sorry, but this page cannot be viewed by a mobile phone";
|
echo "I am sorry, but this page cannot be viewed by a mobile phone";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
// $this->form->log->debug('POST', $this->form->log->prAr($_POST));
|
// $this->log->debug('POST', $this->log->prAr($_POST));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -151,7 +154,7 @@ class EditBase
|
|||||||
$q = "UPDATE " . $table_name
|
$q = "UPDATE " . $table_name
|
||||||
. " SET order_number = " . $row_data_order[$i]
|
. " SET order_number = " . $row_data_order[$i]
|
||||||
. " WHERE " . $table_name . "_id = " . $row_data_id[$i];
|
. " WHERE " . $table_name . "_id = " . $row_data_id[$i];
|
||||||
$q = $this->form->dbExec($q);
|
$q = $this->form->dba->dbExec($q);
|
||||||
}
|
}
|
||||||
} // for all article ids ...
|
} // for all article ids ...
|
||||||
} // if write
|
} // if write
|
||||||
@@ -170,7 +173,7 @@ class EditBase
|
|||||||
$options_name = [];
|
$options_name = [];
|
||||||
$options_selected = [];
|
$options_selected = [];
|
||||||
// DB read data for menu
|
// DB read data for menu
|
||||||
while (is_array($res = $this->form->dbReturn($q))) {
|
while (is_array($res = $this->form->dba->dbReturn($q))) {
|
||||||
$row_data[] = [
|
$row_data[] = [
|
||||||
"id" => $res[$table_name . "_id"],
|
"id" => $res[$table_name . "_id"],
|
||||||
"name" => $res["name"],
|
"name" => $res["name"],
|
||||||
@@ -179,7 +182,7 @@ class EditBase
|
|||||||
} // while read data ...
|
} // while read data ...
|
||||||
|
|
||||||
// html title
|
// html title
|
||||||
$this->HEADER['HTML_TITLE'] = $this->form->l->__('Edit Order');
|
$this->HEADER['HTML_TITLE'] = $this->l->__('Edit Order');
|
||||||
|
|
||||||
$messages = [];
|
$messages = [];
|
||||||
$error = $_POST['error'] ?? 0;
|
$error = $_POST['error'] ?? 0;
|
||||||
@@ -428,9 +431,9 @@ class EditBase
|
|||||||
$elements[] = $this->form->formCreateElement('template');
|
$elements[] = $this->form->formCreateElement('template');
|
||||||
break;
|
break;
|
||||||
case 'edit_pages':
|
case 'edit_pages':
|
||||||
if (!isset($this->form->table_array['edit_page_id']['value'])) {
|
if (!isset($this->form->dba->getTableArray()['edit_page_id']['value'])) {
|
||||||
$q = "DELETE FROM temp_files";
|
$q = "DELETE FROM temp_files";
|
||||||
$this->form->dbExec($q);
|
$this->form->dba->dbExec($q);
|
||||||
// gets all files in the current dir and dirs given ending with .php
|
// gets all files in the current dir and dirs given ending with .php
|
||||||
$folders = ['../admin/', '../frontend/'];
|
$folders = ['../admin/', '../frontend/'];
|
||||||
$files = ['*.php'];
|
$files = ['*.php'];
|
||||||
@@ -458,16 +461,16 @@ class EditBase
|
|||||||
if ($t_q) {
|
if ($t_q) {
|
||||||
$t_q .= ', ';
|
$t_q .= ', ';
|
||||||
}
|
}
|
||||||
$t_q .= "('" . $this->form->dbEscapeString($pathinfo['dirname']) . "', '"
|
$t_q .= "('" . $this->form->dba->dbEscapeString($pathinfo['dirname']) . "', '"
|
||||||
. $this->form->dbEscapeString($pathinfo['basename']) . "')";
|
. $this->form->dba->dbEscapeString($pathinfo['basename']) . "')";
|
||||||
}
|
}
|
||||||
$this->form->dbExec($q . $t_q, 'NULL');
|
$this->form->dba->dbExec($q . $t_q, 'NULL');
|
||||||
$elements[] = $this->form->formCreateElement('filename');
|
$elements[] = $this->form->formCreateElement('filename');
|
||||||
} else {
|
} else {
|
||||||
// show file menu
|
// show file menu
|
||||||
// just show name of file ...
|
// just show name of file ...
|
||||||
$this->DATA['filename_exist'] = 1;
|
$this->DATA['filename_exist'] = 1;
|
||||||
$this->DATA['filename'] = $this->form->table_array['filename']['value'];
|
$this->DATA['filename'] = $this->form->dba->getTableArray()['filename']['value'];
|
||||||
} // File Name View IF
|
} // File Name View IF
|
||||||
$elements[] = $this->form->formCreateElement('hostname');
|
$elements[] = $this->form->formCreateElement('hostname');
|
||||||
$elements[] = $this->form->formCreateElement('name');
|
$elements[] = $this->form->formCreateElement('name');
|
||||||
@@ -632,7 +635,7 @@ class EditBase
|
|||||||
'editAdmin_' . $this->smarty->lang
|
'editAdmin_' . $this->smarty->lang
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->form->log->debug('DEBUGEND', '==================================== [Form END]');
|
$this->log->debug('DEBUGEND', '==================================== [Form END]');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
{
|
{
|
||||||
// main calss variables
|
// main calss variables
|
||||||
/** @var array<mixed> */
|
/** @var array<mixed> */
|
||||||
public array $table_array; // the array from the table to work on
|
private array $table_array; // the array from the table to work on
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public string $table_name; // the table_name
|
private string $table_name; // the table_name
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public string $pk_name = ''; // the primary key from this table
|
private string $pk_name = ''; // the primary key from this table
|
||||||
/** @var int|string|null */
|
/** @var int|string|null */
|
||||||
public int|string|null $pk_id; // the PK id
|
private int|string|null $pk_id; // the PK id
|
||||||
// security values
|
// security values
|
||||||
/** @var int base acl for current page */
|
/** @var int base acl for current page */
|
||||||
private int $base_acl_level = 0;
|
private int $base_acl_level = 0;
|
||||||
@@ -74,24 +74,21 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
// instance db_io class
|
// instance db_io class
|
||||||
parent::__construct($db_config, $log);
|
parent::__construct($db_config, $log);
|
||||||
// more error vars for this class
|
// more error vars for this class
|
||||||
$this->error_string['1999'] = 'No table array or table name set';
|
$this->error_string['1998'] = 'No table name set';
|
||||||
|
$this->error_string['1999'] = 'No table array set';
|
||||||
$this->error_string['1021'] = 'No Primary Key given';
|
$this->error_string['1021'] = 'No Primary Key given';
|
||||||
$this->error_string['1022'] = 'Could not run Array Query';
|
$this->error_string['1022'] = 'Could not run Array Query';
|
||||||
|
|
||||||
$this->table_array = $table_array;
|
$this->setTableArray($table_array);
|
||||||
$this->table_name = $table_name;
|
$this->setTableName($table_name);
|
||||||
|
|
||||||
// error abort if no table array or no table name
|
|
||||||
if (empty($table_array) || empty($table_name)) {
|
|
||||||
$this->__dbError(1999, false, 'MAJOR ERROR: Core settings missing');
|
|
||||||
throw new \RuntimeException('MAJOR ERROR: Core settings missing', 1999);
|
|
||||||
}
|
|
||||||
|
|
||||||
// set primary key for given table_array
|
// set primary key for given table_array
|
||||||
foreach ($this->table_array as $key => $value) {
|
foreach ($this->table_array as $key => $value) {
|
||||||
if (!empty($value['pk'])) {
|
if (empty($value['pk'])) {
|
||||||
$this->pk_name = $key;
|
continue;
|
||||||
}
|
}
|
||||||
|
$this->setPkName($key);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
$this->dbArrayIOSetAcl($base_acl_level, $acl_admin);
|
$this->dbArrayIOSetAcl($base_acl_level, $acl_admin);
|
||||||
}
|
}
|
||||||
@@ -104,6 +101,144 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
parent::__destruct();
|
parent::__destruct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the overall table array
|
||||||
|
*
|
||||||
|
* @param array<mixed> $table_array
|
||||||
|
* @return void
|
||||||
|
* @throws \RuntimeException 1999 for empty table array
|
||||||
|
*/
|
||||||
|
public function setTableArray(array $table_array): void
|
||||||
|
{
|
||||||
|
$this->table_array = $table_array;
|
||||||
|
if (empty($this->table_array)) {
|
||||||
|
$this->__dbError(1999, false, 'MAJOR ERROR: Core settings missing: table_arrry');
|
||||||
|
throw new \RuntimeException('MAJOR ERROR: Core settings missing: table_array', 1999);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return full table array, or [] if empty
|
||||||
|
* of reset is set to true, will reset array first
|
||||||
|
*
|
||||||
|
* @param bool $reset [=false] run a reset before returning
|
||||||
|
* @return array<mixed>
|
||||||
|
*/
|
||||||
|
public function getTableArray(bool $reset = false): array
|
||||||
|
{
|
||||||
|
if (!$reset) {
|
||||||
|
return $this->table_array ?? [];
|
||||||
|
}
|
||||||
|
$table_array = $this->table_array ?? [];
|
||||||
|
reset($table_array);
|
||||||
|
return $table_array;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get a table array entry under the key with element pos
|
||||||
|
*
|
||||||
|
* @param string $key
|
||||||
|
* @param string $pos
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function getTableArrayEntry(string $key, string $pos): mixed
|
||||||
|
{
|
||||||
|
return $this->table_array[$key][$pos] ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set a new value at key with pos
|
||||||
|
*
|
||||||
|
* @param mixed $value
|
||||||
|
* @param string $key
|
||||||
|
* @param string $pos
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setTableArrayEntry(mixed $value, string $key, string $pos): void
|
||||||
|
{
|
||||||
|
$this->table_array[$key][$pos] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* unset entry at key with pos
|
||||||
|
*
|
||||||
|
* @param string $key
|
||||||
|
* @param string $pos
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function unsetTableArrayEntry(string $key, string $pos): void
|
||||||
|
{
|
||||||
|
unset($this->table_array[$key][$pos]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set table name
|
||||||
|
*
|
||||||
|
* @param string $table_name
|
||||||
|
* @return void
|
||||||
|
* @throws \RuntimeException 1998 for empty table name
|
||||||
|
*/
|
||||||
|
public function setTableName(string $table_name): void
|
||||||
|
{
|
||||||
|
$this->table_name = $table_name;
|
||||||
|
if (empty($this->table_name)) {
|
||||||
|
$this->__dbError(1998, false, 'MAJOR ERROR: Core settings missing: table_name');
|
||||||
|
throw new \RuntimeException('MAJOR ERROR: Core settings missing: table_name', 1998);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return table name or empty string if not net
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getTableName(): string
|
||||||
|
{
|
||||||
|
return $this->table_name ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set primary key name
|
||||||
|
*
|
||||||
|
* @param string $pk_name
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setPkName(string $pk_name): void
|
||||||
|
{
|
||||||
|
$this->pk_name = $pk_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get primary key name
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getPkName(): string
|
||||||
|
{
|
||||||
|
return $this->pk_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set primary key id, can be null for not yet set
|
||||||
|
*
|
||||||
|
* @param int|string|null $pk_id
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setPkId(int|string|null $pk_id): void
|
||||||
|
{
|
||||||
|
$this->pk_id = $pk_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return primary key id, or null if not set
|
||||||
|
*
|
||||||
|
* @return int|string|null
|
||||||
|
*/
|
||||||
|
public function getPkId(): int|string|null
|
||||||
|
{
|
||||||
|
return $this->pk_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the base acl level and admin acl flag
|
* set the base acl level and admin acl flag
|
||||||
* This is needed for table array ACL checks
|
* This is needed for table array ACL checks
|
||||||
@@ -198,8 +333,8 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
public function dbCheckPkSet(): bool
|
public function dbCheckPkSet(): bool
|
||||||
{
|
{
|
||||||
// if pk_id is set, overrule ...
|
// if pk_id is set, overrule ...
|
||||||
if ($this->pk_id) {
|
if (!empty($this->getPkId())) {
|
||||||
$this->table_array[$this->pk_name]['value'] = $this->pk_id;
|
$this->table_array[$this->pk_name]['value'] = $this->getPkId();
|
||||||
}
|
}
|
||||||
// if not set ... produce error
|
// if not set ... produce error
|
||||||
if (!$this->table_array[$this->pk_name]['value']) {
|
if (!$this->table_array[$this->pk_name]['value']) {
|
||||||
@@ -287,7 +422,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
$q .= ' AND ' . $q_where;
|
$q .= ' AND ' . $q_where;
|
||||||
}
|
}
|
||||||
// if 0, error
|
// if 0, error
|
||||||
$this->pk_id = null;
|
$this->setPkId(null);
|
||||||
if (!$this->dbExec($q)) {
|
if (!$this->dbExec($q)) {
|
||||||
$this->__dbError(1022);
|
$this->__dbError(1022);
|
||||||
}
|
}
|
||||||
@@ -374,7 +509,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// possible dbFetchArray errors ...
|
// possible dbFetchArray errors ...
|
||||||
$this->pk_id = $this->table_array[$this->pk_name]['value'];
|
$this->setPkId($this->table_array[$this->pk_name]['value']);
|
||||||
} else {
|
} else {
|
||||||
$this->__dbError(1022);
|
$this->__dbError(1022);
|
||||||
}
|
}
|
||||||
@@ -397,10 +532,6 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
if (count($table_array)) {
|
if (count($table_array)) {
|
||||||
$this->table_array = $table_array;
|
$this->table_array = $table_array;
|
||||||
}
|
}
|
||||||
// PK ID check
|
|
||||||
// if ($this->pk_id && !$this->table_array[$this->pk_name]["value"]) {
|
|
||||||
// $this->table_array[$this->pk_name]["value"]=$this->pk_id;
|
|
||||||
// }
|
|
||||||
// checken ob PKs gesetzt, wenn alle -> update, wenn keiner -> insert, wenn ein paar -> ERROR!
|
// checken ob PKs gesetzt, wenn alle -> update, wenn keiner -> insert, wenn ein paar -> ERROR!
|
||||||
if (!$this->table_array[$this->pk_name]['value']) {
|
if (!$this->table_array[$this->pk_name]['value']) {
|
||||||
$insert = 1;
|
$insert = 1;
|
||||||
@@ -624,16 +755,11 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
$q .= ' AND ' . $q_where;
|
$q .= ' AND ' . $q_where;
|
||||||
}
|
}
|
||||||
// set pk_id ... if it has changed or so
|
// set pk_id ... if it has changed or so
|
||||||
$this->pk_id = $this->table_array[$this->pk_name]['value'];
|
$this->setPkId($this->table_array[$this->pk_name]['value']);
|
||||||
} else {
|
} else {
|
||||||
$q = 'INSERT INTO ' . $this->table_name . ' ';
|
$q = 'INSERT INTO ' . $this->table_name . ' ';
|
||||||
$q .= '(' . $q_vars . ') ';
|
$q .= '(' . $q_vars . ') ';
|
||||||
$q .= 'VALUES (' . $q_data . ')';
|
$q .= 'VALUES (' . $q_data . ')';
|
||||||
// write primary key too
|
|
||||||
// if ($q_data)
|
|
||||||
// $q .= ", ";
|
|
||||||
// $q .= $this->pk_name." = ".$this->table_array[$this->pk_name]['value']." ";
|
|
||||||
// $this->pk_id = $this->table_array[$this->pk_name]['value'];
|
|
||||||
}
|
}
|
||||||
// return success or not
|
// return success or not
|
||||||
if (!$this->dbExec($q)) {
|
if (!$this->dbExec($q)) {
|
||||||
@@ -646,7 +772,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
$insert_id = 0;
|
$insert_id = 0;
|
||||||
}
|
}
|
||||||
$this->table_array[$this->pk_name]['value'] = $insert_id;
|
$this->table_array[$this->pk_name]['value'] = $insert_id;
|
||||||
$this->pk_id = $insert_id;
|
$this->setPkId($insert_id);
|
||||||
}
|
}
|
||||||
// return the table if needed
|
// return the table if needed
|
||||||
return $this->table_array;
|
return $this->table_array;
|
||||||
|
|||||||
@@ -3232,7 +3232,7 @@ class IO
|
|||||||
*
|
*
|
||||||
* @param array<mixed> $write_array list of elements to write
|
* @param array<mixed> $write_array list of elements to write
|
||||||
* @param array<mixed> $not_write_array list of elements not to write
|
* @param array<mixed> $not_write_array list of elements not to write
|
||||||
* @param int $primary_key id key to decide if we write insert or update
|
* @param int|null $primary_key id key to decide if we write insert or update
|
||||||
* @param string $table name for the target table
|
* @param string $table name for the target table
|
||||||
* @param array<mixed> $data data array to override _POST data
|
* @param array<mixed> $data data array to override _POST data
|
||||||
* @return int|false primary key
|
* @return int|false primary key
|
||||||
@@ -3240,7 +3240,7 @@ class IO
|
|||||||
public function dbWriteData(
|
public function dbWriteData(
|
||||||
array $write_array,
|
array $write_array,
|
||||||
array $not_write_array,
|
array $not_write_array,
|
||||||
int $primary_key,
|
?int $primary_key,
|
||||||
string $table,
|
string $table,
|
||||||
array $data = []
|
array $data = []
|
||||||
): int|false {
|
): int|false {
|
||||||
@@ -3260,19 +3260,19 @@ class IO
|
|||||||
* PARAM INFO: $primary key
|
* PARAM INFO: $primary key
|
||||||
* this can be a plain string/int and will be internal transformed into the array form
|
* this can be a plain string/int and will be internal transformed into the array form
|
||||||
* or it takes the array form of array [row => column, value => pk value]
|
* or it takes the array form of array [row => column, value => pk value]
|
||||||
* @param array<mixed> $write_array list of elements to write
|
* @param array<mixed> $write_array list of elements to write
|
||||||
* @param int|string|array<mixed> $primary_key primary key string or array set
|
* @param null|int|string|array<mixed> $primary_key primary key string or array set
|
||||||
* @param string $table name for the target table
|
* @param string $table name for the target table
|
||||||
* @param array<mixed> $not_write_array list of elements not to write (optional)
|
* @param array<mixed> $not_write_array list of elements not to write (optional)
|
||||||
* @param array<mixed> $not_write_update_array list of elements not
|
* @param array<mixed> $not_write_update_array list of elements not
|
||||||
* to write during update (optional)
|
* to write during update (optional)
|
||||||
* @param array<mixed> $data optional array with data
|
* @param array<mixed> $data optional array with data
|
||||||
* if not _POST vars are used
|
* if not _POST vars are used
|
||||||
* @return int|false primary key
|
* @return int|false primary key
|
||||||
*/
|
*/
|
||||||
public function dbWriteDataExt(
|
public function dbWriteDataExt(
|
||||||
array $write_array,
|
array $write_array,
|
||||||
int|string|array $primary_key,
|
null|int|string|array $primary_key,
|
||||||
string $table,
|
string $table,
|
||||||
array $not_write_array = [],
|
array $not_write_array = [],
|
||||||
array $not_write_update_array = [],
|
array $not_write_update_array = [],
|
||||||
|
|||||||
@@ -15,15 +15,32 @@ use CoreLibs\Logging\Logger\MessageLevel;
|
|||||||
|
|
||||||
class ErrorMessage
|
class ErrorMessage
|
||||||
{
|
{
|
||||||
/** @var array<int,array{id:string,level:string,str:string,target:string,highlight:string[]}> */
|
/** @var array<int,array{id:string,level:string,str:string,target:string,target_style:string,highlight:string[]}> */
|
||||||
private array $error_str = [];
|
private array $error_str = [];
|
||||||
/** @var \CoreLibs\Logging\Logging $log */
|
/** @var \CoreLibs\Logging\Logging $log */
|
||||||
public \CoreLibs\Logging\Logging $log;
|
public \CoreLibs\Logging\Logging $log;
|
||||||
|
|
||||||
|
/** @var bool $log_error global flag to log error level message */
|
||||||
|
private bool $log_error = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* init ErrorMessage
|
||||||
|
*
|
||||||
|
* @param \CoreLibs\Logging\Logging $log
|
||||||
|
* @param null|bool $log_error [=null], defaults to false if log is not level debug
|
||||||
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
\CoreLibs\Logging\Logging $log
|
\CoreLibs\Logging\Logging $log,
|
||||||
|
?bool $log_error = null
|
||||||
) {
|
) {
|
||||||
$this->log = $log;
|
$this->log = $log;
|
||||||
|
// if log default logging is debug then log_error is default set to true
|
||||||
|
if ($this->log->loggingLevelIsDebug() && $log_error === null) {
|
||||||
|
$log_error = true;
|
||||||
|
} else {
|
||||||
|
$log_error = $log_error ?? false;
|
||||||
|
}
|
||||||
|
$this->log_error = $log_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,6 +48,7 @@ class ErrorMessage
|
|||||||
* error_id: internal Error ID (should be unique)
|
* error_id: internal Error ID (should be unique)
|
||||||
* level: error level, can only be ok, info, warn, error, abort, crash
|
* level: error level, can only be ok, info, warn, error, abort, crash
|
||||||
* ok and info are positive response: success
|
* ok and info are positive response: success
|
||||||
|
* notice: a debug message for information only
|
||||||
* warn: success, but there might be some things that are not 100% ok
|
* warn: success, but there might be some things that are not 100% ok
|
||||||
* error: input error or error in executing request
|
* error: input error or error in executing request
|
||||||
* abort: an internal error happened as mandatory information that normally is
|
* abort: an internal error happened as mandatory information that normally is
|
||||||
@@ -41,25 +59,36 @@ class ErrorMessage
|
|||||||
* not set: unkown, will be logged as "emergency"
|
* not set: unkown, will be logged as "emergency"
|
||||||
* target/highlight: id target name for frontend where to attach this message
|
* target/highlight: id target name for frontend where to attach this message
|
||||||
* highlight is a list of other target points to highlight
|
* highlight is a list of other target points to highlight
|
||||||
|
* for highlight targets css names are $level without a prefix and should be
|
||||||
|
* nested in the target element "input .error { ... }"
|
||||||
|
* target_style: if not set uses 'error-' $level as css style. applies to targets or main only
|
||||||
*
|
*
|
||||||
* @param string $error_id Any internal error ID for this error
|
* @param string $error_id Any internal error ID for this error
|
||||||
* @param string $level Error level in ok/info/warn/error
|
* @param string $level Error level in ok/info/warn/error
|
||||||
* @param string $str Error message (out)
|
* @param string $str Error message (out)
|
||||||
* @param string $target alternate attachment point for this error message
|
* @param string $target alternate attachment point for this error message
|
||||||
* @param array<string> $highlight Any additional error data as error OR
|
* @param string $target_style Alternate color style for the error message
|
||||||
* highlight points for field highlights
|
* @param array<string> $highlight Any additional error data as error OR
|
||||||
* @param string|null $message If abort/crash, non localized $str
|
* highlight points for field highlights
|
||||||
* @param array<mixed> $context Additionl info for abort/crash messages
|
* @param string|null $message If abort/crash, non localized $str
|
||||||
|
* @param array<mixed> $context Additionl info for abort/crash messages
|
||||||
|
* @param bool|null $log_error [=null] log level 'error' to error, if null use global,
|
||||||
|
* else set for this call only
|
||||||
*/
|
*/
|
||||||
public function setErrorMsg(
|
public function setErrorMsg(
|
||||||
string $error_id,
|
string $error_id,
|
||||||
string $level,
|
string $level,
|
||||||
string $str,
|
string $str,
|
||||||
string $target = '',
|
string $target = '',
|
||||||
|
string $target_style = '',
|
||||||
array $highlight = [],
|
array $highlight = [],
|
||||||
?string $message = null,
|
?string $message = null,
|
||||||
array $context = [],
|
array $context = [],
|
||||||
|
?bool $log_error = null,
|
||||||
): void {
|
): void {
|
||||||
|
if ($log_error === null) {
|
||||||
|
$log_error = $this->log_error;
|
||||||
|
}
|
||||||
$original_level = $level;
|
$original_level = $level;
|
||||||
$level = MessageLevel::fromName($level)->name;
|
$level = MessageLevel::fromName($level)->name;
|
||||||
// if not string set, write message string if set, else level/error id
|
// if not string set, write message string if set, else level/error id
|
||||||
@@ -71,10 +100,25 @@ class ErrorMessage
|
|||||||
'level' => $level,
|
'level' => $level,
|
||||||
'str' => $str,
|
'str' => $str,
|
||||||
'target' => $target,
|
'target' => $target,
|
||||||
|
'target_style' => $target_style,
|
||||||
'highlight' => $highlight,
|
'highlight' => $highlight,
|
||||||
];
|
];
|
||||||
// write to log for abort/crash
|
// write to log for abort/crash
|
||||||
switch ($level) {
|
switch ($level) {
|
||||||
|
case 'notice':
|
||||||
|
$this->log->notice($message ?? $str, array_merge([
|
||||||
|
'id' => $error_id,
|
||||||
|
'level' => $original_level,
|
||||||
|
], $context));
|
||||||
|
break;
|
||||||
|
case 'error':
|
||||||
|
if ($log_error) {
|
||||||
|
$this->log->error($message ?? $str, array_merge([
|
||||||
|
'id' => $error_id,
|
||||||
|
'level' => $original_level,
|
||||||
|
], $context));
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'abort':
|
case 'abort':
|
||||||
$this->log->critical($message ?? $str, array_merge([
|
$this->log->critical($message ?? $str, array_merge([
|
||||||
'id' => $error_id,
|
'id' => $error_id,
|
||||||
@@ -101,25 +145,40 @@ class ErrorMessage
|
|||||||
* Note, the parameter order is different and does not need an error id
|
* Note, the parameter order is different and does not need an error id
|
||||||
* This is for backend alerts
|
* This is for backend alerts
|
||||||
*
|
*
|
||||||
* @param string $level error level (ok/warn/info/error)
|
* @param string $level error level (ok/warn/info/error)
|
||||||
* @param string $str error string
|
* @param string $str error string
|
||||||
* @param string|null $error_id optional error id for precise error lookup
|
* @param string|null $error_id optional error id for precise error lookup
|
||||||
* @param string $target Alternate id name for output target on frontend
|
* @param string $target Alternate id name for output target on frontend
|
||||||
* @param array<string> $highlight Any additional error data as error OR
|
* @param string $target_style Alternate color style for the error message
|
||||||
* highlight points for field highlights
|
* @param array<string> $highlight Any additional error data as error OR
|
||||||
* @param string|null $message If abort/crash, non localized $str
|
* highlight points for field highlights
|
||||||
* @param array<mixed> $context Additionl info for abort/crash messages
|
* @param string|null $message If abort/crash, non localized $str
|
||||||
|
* @param array<mixed> $context Additionl info for abort/crash messages
|
||||||
|
* @param bool|null $log_error [=null] log level 'error' to error, if null use global,
|
||||||
|
* else set for this call only
|
||||||
*/
|
*/
|
||||||
public function setMessage(
|
public function setMessage(
|
||||||
string $level,
|
string $level,
|
||||||
string $str,
|
string $str,
|
||||||
?string $error_id = null,
|
?string $error_id = null,
|
||||||
string $target = '',
|
string $target = '',
|
||||||
|
string $target_style = '',
|
||||||
array $highlight = [],
|
array $highlight = [],
|
||||||
?string $message = null,
|
?string $message = null,
|
||||||
array $context = [],
|
array $context = [],
|
||||||
|
?bool $log_error = null,
|
||||||
): void {
|
): void {
|
||||||
$this->setErrorMsg($error_id ?? '', $level, $str, $target, $highlight, $message, $context);
|
$this->setErrorMsg(
|
||||||
|
$error_id ?? '',
|
||||||
|
$level,
|
||||||
|
$str,
|
||||||
|
$target,
|
||||||
|
$target_style,
|
||||||
|
$highlight,
|
||||||
|
$message,
|
||||||
|
$context,
|
||||||
|
$log_error
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// *********************************************************************
|
// *********************************************************************
|
||||||
@@ -150,7 +209,7 @@ class ErrorMessage
|
|||||||
* Gets the LAST entry in the array list.
|
* Gets the LAST entry in the array list.
|
||||||
* If nothing found returns empty array set
|
* If nothing found returns empty array set
|
||||||
*
|
*
|
||||||
* @return array{id:string,level:string,str:string,target:string,highlight:string[]} Error block
|
* @return array{id:string,level:string,str:string,target:string,target:string,highlight:string[]} Error block
|
||||||
*/
|
*/
|
||||||
public function getLastErrorMsg(): array
|
public function getLastErrorMsg(): array
|
||||||
{
|
{
|
||||||
@@ -159,9 +218,35 @@ class ErrorMessage
|
|||||||
'str' => '',
|
'str' => '',
|
||||||
'id' => '',
|
'id' => '',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_string' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// *********************************************************************
|
||||||
|
// FLAG SETTERS
|
||||||
|
// *********************************************************************
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the log error flag
|
||||||
|
*
|
||||||
|
* @param bool $flag True to log level error too, False for do not (Default)
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setFlagLogError(bool $flag): void
|
||||||
|
{
|
||||||
|
$this->log_error = $flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current log error flag
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function getFlagLogError(): bool
|
||||||
|
{
|
||||||
|
return $this->log_error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// __END__
|
// __END__
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ enum MessageLevel: int
|
|||||||
{
|
{
|
||||||
case ok = 100;
|
case ok = 100;
|
||||||
case info = 200;
|
case info = 200;
|
||||||
|
case notice = 250;
|
||||||
case warn = 300;
|
case warn = 300;
|
||||||
case error = 400;
|
case error = 400;
|
||||||
case abort = 500;
|
case abort = 500;
|
||||||
@@ -30,6 +31,7 @@ enum MessageLevel: int
|
|||||||
return match (strtolower($name)) {
|
return match (strtolower($name)) {
|
||||||
'ok' => self::ok,
|
'ok' => self::ok,
|
||||||
'info' => self::info,
|
'info' => self::info,
|
||||||
|
'notice' => self::notice,
|
||||||
'warn', 'warning' => self::warn,
|
'warn', 'warning' => self::warn,
|
||||||
'error' => self::error,
|
'error' => self::error,
|
||||||
'abort' => self::abort,
|
'abort' => self::abort,
|
||||||
@@ -46,6 +48,39 @@ enum MessageLevel: int
|
|||||||
{
|
{
|
||||||
return self::tryFrom($value) ?? self::unknown;
|
return self::tryFrom($value) ?? self::unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the passed $level is higher or equal to $this
|
||||||
|
*
|
||||||
|
* @param MessageLevel $level
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function includes(MessageLevel $level): bool
|
||||||
|
{
|
||||||
|
return $this->value <= $level->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If level is higher than set one
|
||||||
|
*
|
||||||
|
* @param MessageLevel $level
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isHigherThan(MessageLevel $level): bool
|
||||||
|
{
|
||||||
|
return $this->value > $level->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* if level is lower than set one
|
||||||
|
*
|
||||||
|
* @param MessageLevel $level
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isLowerThan(MessageLevel $level): bool
|
||||||
|
{
|
||||||
|
return $this->value < $level->value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// __END__
|
// __END__
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
40
www/lib/CoreLibs/Output/Form/TableArrays/EditOrder.php
Normal file
40
www/lib/CoreLibs/Output/Form/TableArrays/EditOrder.php
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace CoreLibs\Output\Form\TableArrays;
|
||||||
|
|
||||||
|
class EditOrder implements Interface\TableArraysInterface
|
||||||
|
{
|
||||||
|
/** @var \CoreLibs\Output\Form\Generate */
|
||||||
|
private \CoreLibs\Output\Form\Generate $form;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param \CoreLibs\Output\Form\Generate $form base form class
|
||||||
|
*/
|
||||||
|
public function __construct(\CoreLibs\Output\Form\Generate $form)
|
||||||
|
{
|
||||||
|
$this->form = $form;
|
||||||
|
$this->form->log->debug('CLASS LOAD', __NAMESPACE__ . __CLASS__);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NOTE: this is a dummy array to just init the Form\Generate class and is not used for anything else
|
||||||
|
*
|
||||||
|
* @return array<mixed>
|
||||||
|
*/
|
||||||
|
public function setTableArray(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'table_array' => [
|
||||||
|
'-'
|
||||||
|
],
|
||||||
|
'table_name' => '-',
|
||||||
|
'load_query' => '',
|
||||||
|
'show_fields' => [],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// __END__
|
||||||
1
www/vendor/composer/autoload_classmap.php
vendored
1
www/vendor/composer/autoload_classmap.php
vendored
@@ -68,6 +68,7 @@ return array(
|
|||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditGroups' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditGroups' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditLanguages' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditLanguages' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditMenuGroup' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditMenuGroup' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php',
|
||||||
|
'CoreLibs\\Output\\Form\\TableArrays\\EditOrder' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditOrder.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditPages' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditPages.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditPages' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditPages.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditSchemas' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditSchemas' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditUsers' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditUsers' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php',
|
||||||
|
|||||||
1
www/vendor/composer/autoload_static.php
vendored
1
www/vendor/composer/autoload_static.php
vendored
@@ -119,6 +119,7 @@ class ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9
|
|||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditGroups' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditGroups' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditLanguages' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditLanguages' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditMenuGroup' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditMenuGroup' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php',
|
||||||
|
'CoreLibs\\Output\\Form\\TableArrays\\EditOrder' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditOrder.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditPages' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditPages.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditPages' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditPages.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditSchemas' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditSchemas' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditUsers' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditUsers' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php',
|
||||||
|
|||||||
Reference in New Issue
Block a user