mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-25 19:28:51 +02:00
Fixed some deprecation messages
This commit is contained in:
parent
b3ecee749e
commit
5f29ee9052
8 changed files with 14 additions and 8 deletions
|
@ -48,6 +48,9 @@ class RowClassColumn extends AbstractColumn
|
|||
parent::initialize('$$rowClass', $index, $options, $dataTable); // TODO: Change the autogenerated stub
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function normalize($value)
|
||||
{
|
||||
return $value;
|
||||
|
|
|
@ -43,7 +43,7 @@ class SIUnitNumberColumn extends AbstractColumn
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function normalize($value)
|
||||
public function normalize($value): string
|
||||
{
|
||||
//Ignore null values
|
||||
if ($value === null) {
|
||||
|
|
|
@ -43,6 +43,9 @@ class SelectColumn extends AbstractColumn
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function normalize($value)
|
||||
{
|
||||
return $value;
|
||||
|
|
|
@ -203,9 +203,9 @@ final class PermissionData implements \JsonSerializable
|
|||
|
||||
/**
|
||||
* Returns an JSON encodable representation of this object.
|
||||
* @return array|mixed
|
||||
* @return array
|
||||
*/
|
||||
public function jsonSerialize()
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
$ret = [];
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface, Cach
|
|||
return $data instanceof Part;
|
||||
}
|
||||
|
||||
public function normalize($object, string $format = null, array $context = [])
|
||||
public function normalize($object, string $format = null, array $context = []): array
|
||||
{
|
||||
if (!$object instanceof Part) {
|
||||
throw new \InvalidArgumentException('This normalizer only supports Part objects!');
|
||||
|
@ -94,7 +94,7 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface, Cach
|
|||
return $data;
|
||||
}
|
||||
|
||||
public function denormalize($data, string $type, string $format = null, array $context = [])
|
||||
public function denormalize($data, string $type, string $format = null, array $context = []): ?Part
|
||||
{
|
||||
$this->normalizeKeys($data);
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ class StructuralElementDenormalizer implements ContextAwareDenormalizerInterface
|
|||
&& in_array('import', $context['groups'] ?? []);
|
||||
}
|
||||
|
||||
public function denormalize($data, string $type, string $format = null, array $context = [])
|
||||
public function denormalize($data, string $type, string $format = null, array $context = []): ?AbstractStructuralDBElement
|
||||
{
|
||||
/** @var AbstractStructuralDBElement $deserialized_entity */
|
||||
$deserialized_entity = $this->normalizer->denormalize($data, $type, $format, $context);
|
||||
|
|
|
@ -42,7 +42,7 @@ class StructuralElementFromNameDenormalizer implements DenormalizerInterface, Ca
|
|||
return is_string($data) && is_subclass_of($type, AbstractStructuralDBElement::class);
|
||||
}
|
||||
|
||||
public function denormalize($data, string $type, string $format = null, array $context = [])
|
||||
public function denormalize($data, string $type, string $format = null, array $context = []): ?AbstractStructuralDBElement
|
||||
{
|
||||
//Retrieve the repository for the given type
|
||||
/** @var StructuralDBElementRepository $repo */
|
||||
|
|
|
@ -41,7 +41,7 @@ class StructuralElementNormalizer implements NormalizerInterface, CacheableSuppo
|
|||
return $data instanceof AbstractStructuralDBElement;
|
||||
}
|
||||
|
||||
public function normalize($object, string $format = null, array $context = [])
|
||||
public function normalize($object, string $format = null, array $context = []): array
|
||||
{
|
||||
if (!$object instanceof AbstractStructuralDBElement) {
|
||||
throw new \InvalidArgumentException('This normalizer only supports AbstractStructural objects!');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue