Fixed some deprecations.

This commit is contained in:
Jan Böhmer 2022-08-14 19:09:07 +02:00
parent 4fa8eef1bf
commit 5fd608f42a
59 changed files with 202 additions and 165 deletions

View file

@ -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);

View file

@ -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 {

View file

@ -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 */

View file

@ -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())) {

View file

@ -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) {

View file

@ -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 '';
}