mirror of
https://github.com/grocy/grocy.git
synced 2026-03-27 23:29:25 +01:00
PHP 8.5 compatibility
This commit is contained in:
parent
a5ea20afc6
commit
eb5332f0da
|
|
@ -7,7 +7,7 @@
|
||||||
"php-di/php-di": "^7.0.3",
|
"php-di/php-di": "^7.0.3",
|
||||||
"berrnd/slim-blade-view": "^1.0.0",
|
"berrnd/slim-blade-view": "^1.0.0",
|
||||||
"morris/lessql": "dev-php82",
|
"morris/lessql": "dev-php82",
|
||||||
"gettext/gettext": "^4.8.10",
|
"gettext/gettext": "dev-4.x-fork",
|
||||||
"eluceo/ical": "^2.2.0",
|
"eluceo/ical": "^2.2.0",
|
||||||
"erusev/parsedown": "^1.7",
|
"erusev/parsedown": "^1.7",
|
||||||
"gumlet/php-image-resize": "^2.0",
|
"gumlet/php-image-resize": "^2.0",
|
||||||
|
|
@ -20,6 +20,10 @@
|
||||||
{
|
{
|
||||||
"type": "vcs",
|
"type": "vcs",
|
||||||
"url": "https://github.com/berrnd/lessql"
|
"url": "https://github.com/berrnd/lessql"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "vcs",
|
||||||
|
"url": "https://github.com/berrnd/php-gettext"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|
|
||||||
46
composer.lock
generated
46
composer.lock
generated
|
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "728e901068c017ef990c1936652b93c6",
|
"content-hash": "ef8208c97da190ec7d138910f95733f2",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "berrnd/slim-blade-view",
|
"name": "berrnd/slim-blade-view",
|
||||||
|
|
@ -517,16 +517,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "gettext/gettext",
|
"name": "gettext/gettext",
|
||||||
"version": "v4.8.12",
|
"version": "dev-4.x-fork",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/php-gettext/Gettext.git",
|
"url": "https://github.com/berrnd/php-gettext.git",
|
||||||
"reference": "11af89ee6c087db3cf09ce2111a150bca5c46e12"
|
"reference": "3cafd9f9e66a8673500d767cf7e8da7762f8d00d"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/php-gettext/Gettext/zipball/11af89ee6c087db3cf09ce2111a150bca5c46e12",
|
"url": "https://api.github.com/repos/berrnd/php-gettext/zipball/3cafd9f9e66a8673500d767cf7e8da7762f8d00d",
|
||||||
"reference": "11af89ee6c087db3cf09ce2111a150bca5c46e12",
|
"reference": "3cafd9f9e66a8673500d767cf7e8da7762f8d00d",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -547,13 +547,24 @@
|
||||||
"twig/extensions": "Is necessary if you want to use the Twig extractor",
|
"twig/extensions": "Is necessary if you want to use the Twig extractor",
|
||||||
"twig/twig": "Is necessary if you want to use the Twig extractor"
|
"twig/twig": "Is necessary if you want to use the Twig extractor"
|
||||||
},
|
},
|
||||||
|
"default-branch": true,
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Gettext\\": "src"
|
"Gettext\\": "src"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"autoload-dev": {
|
||||||
|
"psr-4": {
|
||||||
|
"Gettext\\Tests\\": "tests"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": [
|
||||||
|
"phpunit",
|
||||||
|
"phpcs"
|
||||||
|
]
|
||||||
|
},
|
||||||
"license": [
|
"license": [
|
||||||
"MIT"
|
"MIT"
|
||||||
],
|
],
|
||||||
|
|
@ -568,9 +579,9 @@
|
||||||
"description": "PHP gettext manager",
|
"description": "PHP gettext manager",
|
||||||
"homepage": "https://github.com/oscarotero/Gettext",
|
"homepage": "https://github.com/oscarotero/Gettext",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"JS",
|
|
||||||
"gettext",
|
"gettext",
|
||||||
"i18n",
|
"i18n",
|
||||||
|
"js",
|
||||||
"mo",
|
"mo",
|
||||||
"po",
|
"po",
|
||||||
"translation"
|
"translation"
|
||||||
|
|
@ -578,23 +589,9 @@
|
||||||
"support": {
|
"support": {
|
||||||
"email": "oom@oscarotero.com",
|
"email": "oom@oscarotero.com",
|
||||||
"issues": "https://github.com/oscarotero/Gettext/issues",
|
"issues": "https://github.com/oscarotero/Gettext/issues",
|
||||||
"source": "https://github.com/php-gettext/Gettext/tree/v4.8.12"
|
"source": "https://github.com/berrnd/php-gettext/tree/4.x-fork"
|
||||||
},
|
},
|
||||||
"funding": [
|
"time": "2026-03-02T19:56:11+00:00"
|
||||||
{
|
|
||||||
"url": "https://paypal.me/oscarotero",
|
|
||||||
"type": "custom"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://github.com/oscarotero",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://www.patreon.com/misteroom",
|
|
||||||
"type": "patreon"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2024-05-18T10:25:07+00:00"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "gettext/languages",
|
"name": "gettext/languages",
|
||||||
|
|
@ -4085,6 +4082,7 @@
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": {
|
"stability-flags": {
|
||||||
|
"gettext/gettext": 20,
|
||||||
"morris/lessql": 20
|
"morris/lessql": 20
|
||||||
},
|
},
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
|
|
|
||||||
|
|
@ -278,17 +278,3 @@ function EmptyFolder($folderPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global $ERROR_REPORTING_STATE;
|
|
||||||
function ErrorReportingDisableDeprecationWarnings()
|
|
||||||
{
|
|
||||||
global $ERROR_REPORTING_STATE;
|
|
||||||
$ERROR_REPORTING_STATE = error_reporting();
|
|
||||||
error_reporting($ERROR_REPORTING_STATE & ~E_DEPRECATED);
|
|
||||||
}
|
|
||||||
|
|
||||||
function ErrorReportingReset()
|
|
||||||
{
|
|
||||||
global $ERROR_REPORTING_STATE;
|
|
||||||
error_reporting($ERROR_REPORTING_STATE);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ class ApiKeyService extends BaseService
|
||||||
const API_KEY_TYPE_DEFAULT = 'default';
|
const API_KEY_TYPE_DEFAULT = 'default';
|
||||||
const API_KEY_TYPE_SPECIAL_PURPOSE_CALENDAR_ICAL = 'special-purpose-calendar-ical';
|
const API_KEY_TYPE_SPECIAL_PURPOSE_CALENDAR_ICAL = 'special-purpose-calendar-ical';
|
||||||
|
|
||||||
public function CreateApiKey(string $keyType = self::API_KEY_TYPE_DEFAULT, string $description = null)
|
public function CreateApiKey(string $keyType = self::API_KEY_TYPE_DEFAULT, ?string $description = null)
|
||||||
{
|
{
|
||||||
$newApiKey = $this->GenerateApiKey();
|
$newApiKey = $this->GenerateApiKey();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,9 +73,6 @@ class LocalizationService
|
||||||
|
|
||||||
public function __n($number, $singularForm, $pluralForm, $isQu = false)
|
public function __n($number, $singularForm, $pluralForm, $isQu = false)
|
||||||
{
|
{
|
||||||
// TODO: Upgrade to gettext/gettext >= v5.7
|
|
||||||
ErrorReportingDisableDeprecationWarnings();
|
|
||||||
|
|
||||||
$this->CheckAndAddMissingTranslationToPot($singularForm);
|
$this->CheckAndAddMissingTranslationToPot($singularForm);
|
||||||
|
|
||||||
if (empty($pluralForm))
|
if (empty($pluralForm))
|
||||||
|
|
@ -91,18 +88,10 @@ class LocalizationService
|
||||||
{
|
{
|
||||||
return sprintf($this->Translator->ngettext($singularForm, $pluralForm, abs(floatval($number))), $number);
|
return sprintf($this->Translator->ngettext($singularForm, $pluralForm, abs(floatval($number))), $number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO: Upgrade to gettext/gettext >= v5.7
|
|
||||||
ErrorReportingReset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __t($text, ...$placeholderValues)
|
public function __t($text, ...$placeholderValues)
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO: Upgrade to gettext/gettext >= v5.7
|
|
||||||
ErrorReportingDisableDeprecationWarnings();
|
|
||||||
|
|
||||||
$this->CheckAndAddMissingTranslationToPot($text);
|
$this->CheckAndAddMissingTranslationToPot($text);
|
||||||
|
|
||||||
if (func_num_args() === 1)
|
if (func_num_args() === 1)
|
||||||
|
|
@ -120,10 +109,6 @@ class LocalizationService
|
||||||
return sprintf($this->Translator->gettext($text), array_shift($placeholderValues));
|
return sprintf($this->Translator->gettext($text), array_shift($placeholderValues));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO: Upgrade to gettext/gettext >= v5.7
|
|
||||||
ErrorReportingReset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getInstance(string $culture)
|
public static function getInstance(string $culture)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use LessQL\Result;
|
||||||
|
|
||||||
class UsersService extends BaseService
|
class UsersService extends BaseService
|
||||||
{
|
{
|
||||||
public function CreateUser(string $username, ?string $firstName, ?string $lastName, string $password, string $pictureFileName = null)
|
public function CreateUser(string $username, ?string $firstName, ?string $lastName, string $password, ?string $pictureFileName = null)
|
||||||
{
|
{
|
||||||
$newUserRow = $this->getDatabase()->users()->createRow([
|
$newUserRow = $this->getDatabase()->users()->createRow([
|
||||||
'username' => $username,
|
'username' => $username,
|
||||||
|
|
@ -37,7 +37,7 @@ class UsersService extends BaseService
|
||||||
$row->delete();
|
$row->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function EditUser(int $userId, string $username, string $firstName, string $lastName, ?string $password, string $pictureFileName = null)
|
public function EditUser(int $userId, string $username, string $firstName, string $lastName, ?string $password, ?string $pictureFileName = null)
|
||||||
{
|
{
|
||||||
if (!$this->UserExists($userId))
|
if (!$this->UserExists($userId))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user