mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-22 18:03:37 +02:00
Fixed static analysis issues
This commit is contained in:
parent
172884ace8
commit
485b35fbd4
4 changed files with 21 additions and 14 deletions
|
@ -87,9 +87,6 @@ class LogController extends AbstractController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Request $request
|
|
||||||
*/
|
|
||||||
#[Route(path: '/{id}/details', name: 'log_details')]
|
#[Route(path: '/{id}/details', name: 'log_details')]
|
||||||
public function logDetails(AbstractLogEntry $logEntry, LogEntryExtraFormatter $logEntryExtraFormatter,
|
public function logDetails(AbstractLogEntry $logEntry, LogEntryExtraFormatter $logEntryExtraFormatter,
|
||||||
LogLevelHelper $logLevelHelper, LogTargetHelper $logTargetHelper, EntityManagerInterface $entityManager): Response
|
LogLevelHelper $logLevelHelper, LogTargetHelper $logTargetHelper, EntityManagerInterface $entityManager): Response
|
||||||
|
|
|
@ -49,15 +49,17 @@ final class PermissionData implements \JsonSerializable
|
||||||
* Creates a new Permission Data Instance using the given data.
|
* Creates a new Permission Data Instance using the given data.
|
||||||
* By default, an empty array is used, meaning
|
* By default, an empty array is used, meaning
|
||||||
*/
|
*/
|
||||||
public function __construct(/**
|
public function __construct(
|
||||||
* @var array|null This array contains the permission values for each permission
|
/**
|
||||||
|
* @var array This array contains the permission values for each permission
|
||||||
* This array contains the permission values for each permission, in the form of:
|
* This array contains the permission values for each permission, in the form of:
|
||||||
* permission => [
|
* permission => [
|
||||||
* operation => value,
|
* operation => value,
|
||||||
* ]
|
* ]
|
||||||
*/
|
*/
|
||||||
#[ORM\Column(type: Types::JSON, name: 'data')]
|
#[ORM\Column(type: Types::JSON, name: 'data')]
|
||||||
protected array $data = [])
|
protected array $data = []
|
||||||
|
)
|
||||||
{
|
{
|
||||||
//If the passed data did not contain a schema version, we set it to the current version
|
//If the passed data did not contain a schema version, we set it to the current version
|
||||||
if (!isset($this->data['$ver'])) {
|
if (!isset($this->data['$ver'])) {
|
||||||
|
|
|
@ -56,7 +56,10 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly StructuralElementFromNameDenormalizer $locationDenormalizer,
|
private readonly StructuralElementFromNameDenormalizer $locationDenormalizer,
|
||||||
#[Autowire(service: ObjectNormalizer::class)]
|
#[Autowire(service: ObjectNormalizer::class)]
|
||||||
private readonly NormalizerInterface $normalizer)
|
private readonly NormalizerInterface $normalizer,
|
||||||
|
#[Autowire(service: ObjectNormalizer::class)]
|
||||||
|
private readonly DenormalizerInterface $denormalizer,
|
||||||
|
)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +124,7 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface
|
||||||
$data['minamount'] = 0.0;
|
$data['minamount'] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$object = $this->normalizer->denormalize($data, $type, $format, $context);
|
$object = $this->denormalizer->denormalize($data, $type, $format, $context);
|
||||||
|
|
||||||
if (!$object instanceof Part) {
|
if (!$object instanceof Part) {
|
||||||
throw new \InvalidArgumentException('This normalizer only supports Part objects!');
|
throw new \InvalidArgumentException('This normalizer only supports Part objects!');
|
||||||
|
|
|
@ -31,4 +31,9 @@ use Symfony\Component\Validator\Constraint;
|
||||||
class NoLockout extends Constraint
|
class NoLockout extends Constraint
|
||||||
{
|
{
|
||||||
public string $message = 'validator.noLockout';
|
public string $message = 'validator.noLockout';
|
||||||
|
|
||||||
|
public function getTargets(): string|array
|
||||||
|
{
|
||||||
|
return [self::CLASS_CONSTRAINT];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue