Fixed coding style.

This commit is contained in:
Jan Böhmer 2020-05-10 21:39:31 +02:00
parent e9493e52ec
commit f5d685dfd4
71 changed files with 619 additions and 531 deletions

View file

@ -1,4 +1,7 @@
<?php
declare(strict_types=1);
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
@ -20,7 +23,6 @@
namespace App\Entity\Attachments;
use App\Entity\LabelSystem\LabelProfile;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
@ -41,4 +43,4 @@ class LabelAttachment extends Attachment
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
}
}

View file

@ -33,7 +33,9 @@ interface TimeTravelInterface
*/
public function hasOldDataInformations(): bool;
/** Returns the data the entity had before this log entry. */
/**
* Returns the data the entity had before this log entry.
*/
public function getOldData(): array;
/**

View file

@ -1,4 +1,7 @@
<?php
declare(strict_types=1);
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
@ -96,12 +99,12 @@ class LabelOptions
}
/**
* @param float $width
* @return LabelOptions
*/
public function setWidth(float $width): LabelOptions
public function setWidth(float $width): self
{
$this->width = $width;
return $this;
}
@ -114,12 +117,12 @@ class LabelOptions
}
/**
* @param float $height
* @return LabelOptions
*/
public function setHeight(float $height): LabelOptions
public function setHeight(float $height): self
{
$this->height = $height;
return $this;
}
@ -132,12 +135,12 @@ class LabelOptions
}
/**
* @param string $barcode_type
* @return LabelOptions
*/
public function setBarcodeType(string $barcode_type): LabelOptions
public function setBarcodeType(string $barcode_type): self
{
$this->barcode_type = $barcode_type;
return $this;
}
@ -150,12 +153,12 @@ class LabelOptions
}
/**
* @param string $picture_type
* @return LabelOptions
*/
public function setPictureType(string $picture_type): LabelOptions
public function setPictureType(string $picture_type): self
{
$this->picture_type = $picture_type;
return $this;
}
@ -168,12 +171,12 @@ class LabelOptions
}
/**
* @param string $supported_element
* @return LabelOptions
*/
public function setSupportedElement(string $supported_element): LabelOptions
public function setSupportedElement(string $supported_element): self
{
$this->supported_element = $supported_element;
return $this;
}
@ -186,17 +189,18 @@ class LabelOptions
}
/**
* @param string $lines
* @return LabelOptions
*/
public function setLines(string $lines): LabelOptions
public function setLines(string $lines): self
{
$this->lines = $lines;
return $this;
}
/**
* Gets additional CSS (it will simply be attached
* Gets additional CSS (it will simply be attached.
*
* @return string
*/
public function getAdditionalCss(): string
@ -205,13 +209,12 @@ class LabelOptions
}
/**
*
* @param string $additional_css
* @return LabelOptions
*/
public function setAdditionalCss(string $additional_css): LabelOptions
public function setAdditionalCss(string $additional_css): self
{
$this->additional_css = $additional_css;
return $this;
}
@ -224,17 +227,12 @@ class LabelOptions
}
/**
* @param string $lines_mode
* @return LabelOptions
*/
public function setLinesMode(string $lines_mode): LabelOptions
public function setLinesMode(string $lines_mode): self
{
$this->lines_mode = $lines_mode;
return $this;
}
}
}

View file

@ -1,4 +1,7 @@
<?php
declare(strict_types=1);
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
@ -32,7 +35,6 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\Table(name="label_profiles")
* @ORM\EntityListeners({"App\EntityListeners\TreeCacheInvalidationListener"})
* @UniqueEntity({"name", "options.supported_element"})
* @package App\Entity\LabelSystem
*/
class LabelProfile extends AttachmentContainingDBElement
{
@ -73,14 +75,16 @@ class LabelProfile extends AttachmentContainingDBElement
return $this->options;
}
public function setOptions(LabelOptions $labelOptions): LabelProfile
public function setOptions(LabelOptions $labelOptions): self
{
$this->options = $labelOptions;
return $this;
}
/**
* Get the comment of the element.
*
* @return string the comment
*/
public function getComment(): ?string
@ -91,11 +95,13 @@ class LabelProfile extends AttachmentContainingDBElement
public function setComment(string $new_comment): string
{
$this->comment = $new_comment;
return $this;
}
/**
* Returns true, if this label profile should be shown in label generator quick menu.
*
* @return bool
*/
public function isShowInDropdown(): bool
@ -105,22 +111,18 @@ class LabelProfile extends AttachmentContainingDBElement
/**
* Sets the show in dropdown menu.
* @param bool $show_in_dropdown
*
* @return LabelProfile
*/
public function setShowInDropdown(bool $show_in_dropdown): LabelProfile
public function setShowInDropdown(bool $show_in_dropdown): self
{
$this->show_in_dropdown = $show_in_dropdown;
return $this;
}
/**
* @inheritDoc
*/
public function getIDString(): string
{
return 'LP'.sprintf('%09d', $this->getID());
}
}
}

View file

@ -120,7 +120,9 @@ abstract class AbstractLogEntry extends AbstractDBElement
protected const TARGET_TYPE_PARAMETER = 18;
protected const TARGET_TYPE_LABEL_PROFILE = 19;
/** @var array This const is used to convert the numeric level to a PSR-3 compatible log level */
/**
* @var array This const is used to convert the numeric level to a PSR-3 compatible log level
*/
protected const LEVEL_ID_TO_STRING = [
self::LEVEL_EMERGENCY => LogLevel::EMERGENCY,
self::LEVEL_ALERT => LogLevel::ALERT,