mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-10 02:14:31 +02:00
Fixed some deprecations.
This commit is contained in:
parent
4fa8eef1bf
commit
5fd608f42a
59 changed files with 202 additions and 165 deletions
|
@ -163,11 +163,11 @@ class AttachmentManager
|
|||
* Returns a human readable version of the attachment file size.
|
||||
* For external attachments, null is returned.
|
||||
*
|
||||
* @param int $decimals The number of decimals numbers that should be printed
|
||||
* @param int $decimals The number of decimals numbers that should be printed
|
||||
*
|
||||
* @return string|null A string like 1.3M
|
||||
*/
|
||||
public function getHumanFileSize(Attachment $attachment, $decimals = 2): ?string
|
||||
public function getHumanFileSize(Attachment $attachment, int $decimals = 2): ?string
|
||||
{
|
||||
$bytes = $this->getFileSize($attachment);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ use Symfony\Component\DependencyInjection\Exception\EnvNotFoundException;
|
|||
|
||||
final class CustomEnvVarProcessor implements EnvVarProcessorInterface
|
||||
{
|
||||
public function getEnv($prefix, $name, Closure $getEnv)
|
||||
public function getEnv($prefix, $name, Closure $getEnv): bool
|
||||
{
|
||||
if ('validMailDSN' === $prefix) {
|
||||
try {
|
||||
|
|
|
@ -228,9 +228,9 @@ class EntityImporter
|
|||
* This functions corrects the parent setting based on the children value of the parent.
|
||||
*
|
||||
* @param iterable $entities the list of entities that should be fixed
|
||||
* @param AbstractStructuralDBElement|null $parent the parent, to which the entity should be set
|
||||
* @param AbstractStructuralDBElement|null $parent the parent, to which the entity should be set
|
||||
*/
|
||||
protected function correctParentEntites(iterable $entities, $parent = null): void
|
||||
protected function correctParentEntites(iterable $entities, AbstractStructuralDBElement $parent = null): void
|
||||
{
|
||||
foreach ($entities as $entity) {
|
||||
/** @var AbstractStructuralDBElement $entity */
|
||||
|
|
|
@ -62,10 +62,10 @@ class MoneyFormatter
|
|||
*
|
||||
* @param string|float $value the value that should be formatted
|
||||
* @param Currency|null $currency The currency that should be used for formatting. If null the global one is used
|
||||
* @param int $decimals the number of decimals that should be shown
|
||||
* @param int $decimals the number of decimals that should be shown
|
||||
* @param bool $show_all_digits if set to true, all digits are shown, even if they are null
|
||||
*/
|
||||
public function format($value, ?Currency $currency = null, $decimals = 5, bool $show_all_digits = false): string
|
||||
public function format($value, ?Currency $currency = null, int $decimals = 5, bool $show_all_digits = false): string
|
||||
{
|
||||
$iso_code = $this->base_currency;
|
||||
if (null !== $currency && !empty($currency->getIsoCode())) {
|
||||
|
|
|
@ -62,10 +62,10 @@ class StructuralElementRecursionHelper
|
|||
* $func has the signature function(StructuralDBElement $element) : void
|
||||
* @param int $max_depth The maximum depth for which should be recursivly called. So if this is set to 5, after the
|
||||
* 5th level the execution is stopped.
|
||||
* @param bool $call_from_bottom If set to true the bottom elements (elements with high level) will be called first.
|
||||
* @param bool $call_from_bottom If set to true the bottom elements (elements with high level) will be called first.
|
||||
* Set to false if you want to call the top elements first.
|
||||
*/
|
||||
public function execute(AbstractStructuralDBElement $element, callable $func, int $max_depth = -1, $call_from_bottom = true): void
|
||||
public function execute(AbstractStructuralDBElement $element, callable $func, int $max_depth = -1, bool $call_from_bottom = true): void
|
||||
{
|
||||
//Cancel if we reached our maximal allowed level. Must be zero because -1 is infinity levels
|
||||
if (0 === $max_depth) {
|
||||
|
|
|
@ -103,9 +103,9 @@ final class PermissionExtractor implements ExtractorInterface
|
|||
/**
|
||||
* Sets the prefix that should be used for new found messages.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param string $prefix The prefix
|
||||
*/
|
||||
public function setPrefix($prefix)
|
||||
public function setPrefix(string $prefix): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue