Fixed code style.

This commit is contained in:
Jan Böhmer 2020-01-04 20:24:09 +01:00
parent 1aed1d1d26
commit 9a7223a301
142 changed files with 534 additions and 716 deletions

View file

@ -81,7 +81,7 @@ abstract class Attachment extends NamedDBElement
protected $path = '';
/**
* @var string The original filename the file had, when the user uploaded it.
* @var string the original filename the file had, when the user uploaded it
* @ORM\Column(type="string", nullable=true)
*/
protected $original_filename;
@ -138,8 +138,6 @@ abstract class Attachment extends NamedDBElement
/**
* Check if this attachment is a 3D model and therefore can be directly shown to user.
* If the attachment is external, false is returned (3D Models must be internal).
*
* @return bool
*/
public function is3DModel(): bool
{
@ -179,7 +177,7 @@ abstract class Attachment extends NamedDBElement
* Check if this attachment is saved in a secure place.
* This means that it can not be accessed directly via a web request, but must be viewed via a controller.
*
* @return bool True, if the file is secure.
* @return bool true, if the file is secure
*/
public function isSecure(): bool
{
@ -197,7 +195,7 @@ abstract class Attachment extends NamedDBElement
* Checks if the attachment file is using a builtin file. (see BUILTIN_PLACEHOLDERS const for possible placeholders)
* If a file is built in, the path is shown to user in url field (no sensitive infos are provided).
*
* @return bool True if the attachment is using an builtin file.
* @return bool true if the attachment is using an builtin file
*/
public function isBuiltIn(): bool
{
@ -215,7 +213,7 @@ abstract class Attachment extends NamedDBElement
* For a path like %BASE/path/foo.bar, bar will be returned.
* If this attachment is external null is returned.
*
* @return string|null The file extension in lower case.
* @return string|null the file extension in lower case
*/
public function getExtension(): ?string
{
@ -233,7 +231,7 @@ abstract class Attachment extends NamedDBElement
/**
* Get the element, associated with this Attachment (for example a "Part" object).
*
* @return AttachmentContainingDBElement The associated Element.
* @return AttachmentContainingDBElement the associated Element
*/
public function getElement(): ?AttachmentContainingDBElement
{
@ -243,8 +241,6 @@ abstract class Attachment extends NamedDBElement
/**
* The URL to the external file, or the path to the built in file.
* Returns null, if the file is not external (and not builtin).
*
* @return string|null
*/
public function getURL(): ?string
{
@ -258,8 +254,6 @@ abstract class Attachment extends NamedDBElement
/**
* Returns the hostname where the external file is stored.
* Returns null, if the file is not external.
*
* @return string|null
*/
public function getHost(): ?string
{
@ -285,8 +279,6 @@ abstract class Attachment extends NamedDBElement
* For a path like %BASE/path/foo.bar, foo.bar will be returned.
*
* If the path is a URL (can be checked via isExternal()), null will be returned.
*
* @return string|null
*/
public function getFilename(): ?string
{
@ -356,10 +348,6 @@ abstract class Attachment extends NamedDBElement
* Setters
****************************************************************************************************/
/**
* @param bool $show_in_table
* @return self
*/
public function setShowInTable(bool $show_in_table): self
{
$this->show_in_table = $show_in_table;
@ -369,7 +357,7 @@ abstract class Attachment extends NamedDBElement
/**
* Sets the element that is associated with this attachment.
* @param AttachmentContainingDBElement $element
*
* @return $this
*/
public function setElement(AttachmentContainingDBElement $element): self
@ -384,8 +372,10 @@ abstract class Attachment extends NamedDBElement
}
/**
* Sets the filepath (with relative placeholder) for this attachment
* @param string $path The new filepath of the attachment.
* Sets the filepath (with relative placeholder) for this attachment.
*
* @param string $path the new filepath of the attachment
*
* @return Attachment
*/
public function setPath(string $path): self
@ -396,7 +386,6 @@ abstract class Attachment extends NamedDBElement
}
/**
* @param AttachmentType $attachement_type
* @return $this
*/
public function setAttachmentType(AttachmentType $attachement_type): self
@ -410,7 +399,6 @@ abstract class Attachment extends NamedDBElement
* Sets the url associated with this attachment.
* If the url is empty nothing is changed, to not override the file path.
*
* @param string|null $url
* @return Attachment
*/
public function setURL(?string $url): self
@ -438,7 +426,7 @@ abstract class Attachment extends NamedDBElement
*
* @param string $path The path that should be checked
*
* @return bool True if the path is pointing to a builtin resource.
* @return bool true if the path is pointing to a builtin resource
*/
public static function checkIfBuiltin(string $path): bool
{
@ -455,7 +443,7 @@ abstract class Attachment extends NamedDBElement
/**
* Check if a string is a URL and is valid.
*
* @param $string string The string which should be checked.
* @param $string string The string which should be checked
* @param bool $path_required If true, the string must contain a path to be valid. (e.g. foo.bar would be invalid, foo.bar/test.php would be valid).
* @param $only_http bool Set this to true, if only HTTPS or HTTP schemata should be allowed.
* *Caution: When this is set to false, a attacker could use the file:// schema, to get internal server files, like /etc/passwd.*

View file

@ -85,7 +85,6 @@ abstract class AttachmentContainingDBElement extends NamedDBElement
/**
* Removes the given attachment from this element.
*
* @param Attachment $attachment
* @return $this
*/
public function removeAttachment(Attachment $attachment): self

View file

@ -88,8 +88,6 @@ class AttachmentType extends StructuralDBElement
* Gets an filter, which file types are allowed for attachment files.
* Must be in the format of <input type=file> accept attribute
* (See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers).
*
* @return string
*/
public function getFiletypeFilter(): string
{
@ -98,7 +96,9 @@ class AttachmentType extends StructuralDBElement
/**
* Sets the filetype filter pattern.
*
* @param string $filetype_filter The new filetype filter
*
* @return $this
*/
public function setFiletypeFilter(string $filetype_filter): self

View file

@ -31,7 +31,7 @@ use Doctrine\ORM\Mapping as ORM;
class AttachmentTypeAttachment extends Attachment
{
/**
* @var AttachmentType The element this attachment is associated with.
* @var AttachmentType the element this attachment is associated with
* @ORM\ManyToOne(targetEntity="App\Entity\Attachments\AttachmentType", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/

View file

@ -32,7 +32,7 @@ use Doctrine\ORM\Mapping as ORM;
class CategoryAttachment extends Attachment
{
/**
* @var Category The element this attachment is associated with.
* @var Category the element this attachment is associated with
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Category", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/

View file

@ -32,7 +32,7 @@ use Doctrine\ORM\Mapping as ORM;
class CurrencyAttachment extends Attachment
{
/**
* @var Currency The element this attachment is associated with.
* @var Currency the element this attachment is associated with
* @ORM\ManyToOne(targetEntity="App\Entity\PriceInformations\Currency", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/

View file

@ -32,7 +32,7 @@ use Doctrine\ORM\Mapping as ORM;
class DeviceAttachment extends Attachment
{
/**
* @var Device The element this attachment is associated with.
* @var Device the element this attachment is associated with
* @ORM\ManyToOne(targetEntity="App\Entity\Devices\Device", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/

View file

@ -32,7 +32,7 @@ use Doctrine\ORM\Mapping as ORM;
class FootprintAttachment extends Attachment
{
/**
* @var Footprint The element this attachment is associated with.
* @var Footprint the element this attachment is associated with
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Footprint", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/

View file

@ -32,7 +32,7 @@ use Doctrine\ORM\Mapping as ORM;
class GroupAttachment extends Attachment
{
/**
* @var Group The element this attachment is associated with.
* @var Group the element this attachment is associated with
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\Group", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/

View file

@ -32,7 +32,7 @@ use Doctrine\ORM\Mapping as ORM;
class ManufacturerAttachment extends Attachment
{
/**
* @var Manufacturer The element this attachment is associated with.
* @var Manufacturer the element this attachment is associated with
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Manufacturer", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/

View file

@ -33,7 +33,7 @@ use Doctrine\ORM\Mapping as ORM;
class MeasurementUnitAttachment extends Attachment
{
/**
* @var Manufacturer The element this attachment is associated with.
* @var Manufacturer the element this attachment is associated with
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\MeasurementUnit", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/

View file

@ -32,7 +32,7 @@ use Doctrine\ORM\Mapping as ORM;
class PartAttachment extends Attachment
{
/**
* @var Part The element this attachment is associated with.
* @var Part the element this attachment is associated with
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Part", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/

View file

@ -32,7 +32,7 @@ use Doctrine\ORM\Mapping as ORM;
class StorelocationAttachment extends Attachment
{
/**
* @var Storelocation The element this attachment is associated with.
* @var Storelocation the element this attachment is associated with
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Storelocation", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/

View file

@ -32,7 +32,7 @@ use Doctrine\ORM\Mapping as ORM;
class SupplierAttachment extends Attachment
{
/**
* @var Supplier The element this attachment is associated with.
* @var Supplier the element this attachment is associated with
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Supplier", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/

View file

@ -32,7 +32,7 @@ use Doctrine\ORM\Mapping as ORM;
class UserAttachment extends Attachment
{
/**
* @var User The element this attachment is associated with.
* @var User the element this attachment is associated with
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\User", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/