mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-09 18:04:33 +02:00
Fixed code style.
This commit is contained in:
parent
e01b06fb85
commit
e73a90a234
24 changed files with 30 additions and 58 deletions
|
@ -59,6 +59,7 @@ final class CustomEnvVarProcessor implements EnvVarProcessorInterface
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ class EntityExporter
|
|||
$disposition = $response->headers->makeDisposition(
|
||||
ResponseHeaderBag::DISPOSITION_ATTACHMENT,
|
||||
$filename,
|
||||
$string = preg_replace('![^'.preg_quote('-','!').'a-z0-_9\s]+!', '', strtolower($filename))
|
||||
$string = preg_replace('![^'.preg_quote('-', '!').'a-z0-_9\s]+!', '', strtolower($filename))
|
||||
);
|
||||
// Set the content disposition
|
||||
$response->headers->set('Content-Disposition', $disposition);
|
||||
|
|
|
@ -151,7 +151,7 @@ class EntityImporter
|
|||
$tmp = $this->validator->validate($entity);
|
||||
|
||||
//When no validation error occured, persist entity to database (cascade must be set in entity)
|
||||
if ($tmp === null) {
|
||||
if (null === $tmp) {
|
||||
$this->em->persist($entity);
|
||||
} else { //Log validation errors to global log.
|
||||
$errors[$entity->getFullPath()] = $tmp;
|
||||
|
|
|
@ -75,8 +75,6 @@ final class LabelGenerator
|
|||
|
||||
/**
|
||||
* Check if the given LabelOptions can be used with $element.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function supports(LabelOptions $options, object $element): bool
|
||||
{
|
||||
|
|
|
@ -156,8 +156,8 @@ class TimeTravel
|
|||
$target_element,
|
||||
$timestamp
|
||||
) && $target_elements instanceof Collection) {
|
||||
$target_elements->removeElement($target_element);
|
||||
}
|
||||
$target_elements->removeElement($target_element);
|
||||
}
|
||||
$this->revertEntityToTimestamp($target_element, $timestamp, $reverted_elements);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,8 +64,6 @@ class MoneyFormatter
|
|||
* @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 bool $show_all_digits if set to true, all digits are shown, even if they are null
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function format($value, ?Currency $currency = null, $decimals = 5, bool $show_all_digits = false): string
|
||||
{
|
||||
|
|
|
@ -124,7 +124,7 @@ class TreeViewGenerator
|
|||
}
|
||||
|
||||
//Translate text if text starts with $$
|
||||
if (strpos($item->getText(), '$$') === 0) {
|
||||
if (0 === strpos($item->getText(), '$$')) {
|
||||
$item->setText($this->translator->trans(substr($item->getText(), 2)));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue