mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-13 11:54:32 +02:00
Fixed typos
This commit is contained in:
parent
63df16a369
commit
d04d743520
144 changed files with 263 additions and 265 deletions
|
@ -166,7 +166,7 @@ class CollectionTypeExtension extends AbstractTypeExtension
|
|||
|
||||
/**
|
||||
* Set the option of the form.
|
||||
* This a bit hacky cause we access private properties....
|
||||
* This a bit hacky because we access private properties....
|
||||
*
|
||||
*/
|
||||
public function setOption(FormConfigInterface $builder, string $option, $value): void
|
||||
|
@ -175,7 +175,7 @@ class CollectionTypeExtension extends AbstractTypeExtension
|
|||
throw new \RuntimeException('This method only works with FormConfigBuilder instances.');
|
||||
}
|
||||
|
||||
//We have to use FormConfigBuilder::class here, because options is private and not available in sub classes
|
||||
//We have to use FormConfigBuilder::class here, because options is private and not available in subclasses
|
||||
$reflection = new ReflectionClass(FormConfigBuilder::class);
|
||||
$property = $reflection->getProperty('options');
|
||||
$property->setAccessible(true);
|
||||
|
|
|
@ -47,7 +47,7 @@ class NumberConstraintType extends AbstractType
|
|||
$resolver->setDefaults([
|
||||
'compound' => true,
|
||||
'data_class' => NumberConstraint::class,
|
||||
'text_suffix' => '', // An suffix which is attached as text-append to the input group. This can for example be used for units
|
||||
'text_suffix' => '', // A suffix which is attached as text-append to the input group. This can for example be used for units
|
||||
|
||||
'min' => null,
|
||||
'max' => null,
|
||||
|
|
|
@ -68,7 +68,6 @@ class ParameterConstraintType extends AbstractType
|
|||
* Ensure that the data is never null, but use an empty ParameterConstraint instead
|
||||
*/
|
||||
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
|
||||
$form = $event->getForm();
|
||||
$data = $event->getData();
|
||||
|
||||
if ($data === null) {
|
||||
|
|
|
@ -36,7 +36,7 @@ class StructuralEntityConstraintType extends AbstractType
|
|||
$resolver->setDefaults([
|
||||
'compound' => true,
|
||||
'data_class' => EntityConstraint::class,
|
||||
'text_suffix' => '', // An suffix which is attached as text-append to the input group. This can for example be used for units
|
||||
'text_suffix' => '', // A suffix which is attached as text-append to the input group. This can for example be used for units
|
||||
]);
|
||||
|
||||
$resolver->setRequired('entity_class');
|
||||
|
|
|
@ -36,7 +36,7 @@ class UserEntityConstraintType extends AbstractType
|
|||
$resolver->setDefaults([
|
||||
'compound' => true,
|
||||
'data_class' => EntityConstraint::class,
|
||||
'text_suffix' => '', // An suffix which is attached as text-append to the input group. This can for example be used for units
|
||||
'text_suffix' => '', //A suffix which is attached as text-append to the input group. This can for example be used for units
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ class CurrencyEntityType extends StructuralEntityType
|
|||
});
|
||||
|
||||
$resolver->setDefault('empty_message', function (Options $options) {
|
||||
//By default we use the global base currency:
|
||||
//By default, we use the global base currency:
|
||||
$iso_code = $this->base_currency;
|
||||
|
||||
if ($options['base_currency']) { //Allow to override it
|
||||
|
@ -75,7 +75,7 @@ class CurrencyEntityType extends StructuralEntityType
|
|||
|
||||
$resolver->setDefault('used_to_select_parent', false);
|
||||
|
||||
//If short is set to true, then the name of the entity will only shown in the dropdown list not in the selected value.
|
||||
//If short is set to true, then the name of the entity will only show in the dropdown list not in the selected value.
|
||||
$resolver->setDefault('short', false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,8 +147,8 @@ class StructuralEntityChoiceHelper
|
|||
|
||||
/**
|
||||
* Do not change the structure below, even when inspection says it can be replaced with a null coalescing operator.
|
||||
* It is important that the value returned here for a existing element is an int, and for a new element a string.
|
||||
* I dont really understand why, but it seems to be important for the choice_loader to work correctly.
|
||||
* It is important that the value returned here for an existing element is an int, and for a new element a string.
|
||||
* I don't really understand why, but it seems to be important for the choice_loader to work correctly.
|
||||
* So please do not change this!
|
||||
*/
|
||||
if ($element->getID() === null) {
|
||||
|
|
|
@ -35,7 +35,7 @@ class PartSelectType extends AbstractType implements DataMapperInterface
|
|||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
//At initialization we have to fill the form element with our selected data, so the user can see it
|
||||
//At initialization, we have to fill the form element with our selected data, so the user can see it
|
||||
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (PreSetDataEvent $event) {
|
||||
$form = $event->getForm();
|
||||
$config = $form->getConfig()->getOptions();
|
||||
|
|
|
@ -118,7 +118,7 @@ class StructuralEntityType extends AbstractType
|
|||
'choice_translation_domain' => false, //Don't translate the entity names
|
||||
]);
|
||||
|
||||
//Set the constraints for the case that allow add is enabled (we then have to check that the new element is valid)
|
||||
//Set the constraints for the case that allow to add is enabled (we then have to check that the new element is valid)
|
||||
$resolver->setNormalizer('constraints', function (Options $options, $value) {
|
||||
if ($options['allow_add']) {
|
||||
$value[] = new Valid();
|
||||
|
@ -159,8 +159,8 @@ class StructuralEntityType extends AbstractType
|
|||
public function modelReverseTransform($value, array $options)
|
||||
{
|
||||
/* This step is important in combination with the caching!
|
||||
The elements deserialized from cache, are not known to Doctrinte ORM any more, so doctrine thinks,
|
||||
that the entity has changed (and so throws an exception about non-persited entities).
|
||||
The elements deserialized from cache, are not known to Doctrine ORM anymore, so doctrine thinks,
|
||||
that the entity has changed (and so throws an exception about non-persisted entities).
|
||||
This function just retrieves a fresh copy of the entity from database, so doctrine detect correctly that no
|
||||
change happened.
|
||||
The performance impact of this should be very small in comparison of the boost, caused by the caching.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue