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

@ -117,16 +117,12 @@ class Category extends PartsContainingDBElement
return 'C'.sprintf('%09d', $this->getID());
}
/**
* @return string
*/
public function getPartnameHint(): string
{
return $this->partname_hint;
}
/**
* @param string $partname_hint
* @return Category
*/
public function setPartnameHint(string $partname_hint): self
@ -136,16 +132,12 @@ class Category extends PartsContainingDBElement
return $this;
}
/**
* @return string
*/
public function getPartnameRegex(): string
{
return $this->partname_regex;
}
/**
* @param string $partname_regex
* @return Category
*/
public function setPartnameRegex(string $partname_regex): self
@ -155,16 +147,12 @@ class Category extends PartsContainingDBElement
return $this;
}
/**
* @return bool
*/
public function isDisableFootprints(): bool
{
return $this->disable_footprints;
}
/**
* @param bool $disable_footprints
* @return Category
*/
public function setDisableFootprints(bool $disable_footprints): self
@ -174,16 +162,12 @@ class Category extends PartsContainingDBElement
return $this;
}
/**
* @return bool
*/
public function isDisableManufacturers(): bool
{
return $this->disable_manufacturers;
}
/**
* @param bool $disable_manufacturers
* @return Category
*/
public function setDisableManufacturers(bool $disable_manufacturers): self
@ -193,16 +177,12 @@ class Category extends PartsContainingDBElement
return $this;
}
/**
* @return bool
*/
public function isDisableAutodatasheets(): bool
{
return $this->disable_autodatasheets;
}
/**
* @param bool $disable_autodatasheets
* @return Category
*/
public function setDisableAutodatasheets(bool $disable_autodatasheets): self
@ -212,16 +192,12 @@ class Category extends PartsContainingDBElement
return $this;
}
/**
* @return bool
*/
public function isDisableProperties(): bool
{
return $this->disable_properties;
}
/**
* @param bool $disable_properties
* @return Category
*/
public function setDisableProperties(bool $disable_properties): self
@ -231,16 +207,12 @@ class Category extends PartsContainingDBElement
return $this;
}
/**
* @return string
*/
public function getDefaultDescription(): string
{
return $this->default_description;
}
/**
* @param string $default_description
* @return Category
*/
public function setDefaultDescription(string $default_description): self
@ -250,16 +222,12 @@ class Category extends PartsContainingDBElement
return $this;
}
/**
* @return string
*/
public function getDefaultComment(): string
{
return $this->default_comment;
}
/**
* @param string $default_comment
* @return Category
*/
public function setDefaultComment(string $default_comment): self

View file

@ -110,8 +110,6 @@ class Footprint extends PartsContainingDBElement
/**
* Returns the 3D Model associated with this footprint.
*
* @return FootprintAttachment|null
*/
public function getFootprint3d(): ?FootprintAttachment
{
@ -128,6 +126,7 @@ class Footprint extends PartsContainingDBElement
* Sets the 3D Model associated with this footprint.
*
* @param FootprintAttachment|null $new_attachment The new 3D Model
*
* @return Footprint
*/
public function setFootprint3d(?FootprintAttachment $new_attachment): self

View file

@ -113,16 +113,12 @@ class MeasurementUnit extends PartsContainingDBElement
return $this;
}
/**
* @return bool
*/
public function isInteger(): bool
{
return $this->is_integer;
}
/**
* @param bool $isInteger
* @return MeasurementUnit
*/
public function setIsInteger(bool $isInteger): self
@ -132,16 +128,12 @@ class MeasurementUnit extends PartsContainingDBElement
return $this;
}
/**
* @return bool
*/
public function isUseSIPrefix(): bool
{
return $this->use_si_prefix;
}
/**
* @param bool $usesSIPrefixes
* @return MeasurementUnit
*/
public function setUseSIPrefix(bool $usesSIPrefixes): self

View file

@ -92,7 +92,7 @@ class Part extends AttachmentContainingDBElement
protected $addedDate;
/**
* @var \DateTime The date when this element was modified the last time.
* @var \DateTime the date when this element was modified the last time
* @ColumnSecurity(type="datetime")
* @ORM\Column(type="datetime", name="last_modified", options={"default"="CURRENT_TIMESTAMP"})
*/

View file

@ -112,6 +112,7 @@ class PartLot extends DBElement
* This is the case, if the expiration date is greater the the current date.
*
* @return bool|null True, if the part lot is expired. Returns null, if no expiration date was set.
*
* @throws \Exception If an error with the DateTime occurs
*/
public function isExpired(): ?bool
@ -137,7 +138,6 @@ class PartLot extends DBElement
/**
* Sets the description of the part lot.
*
* @param string $description
* @return PartLot
*/
public function setDescription(string $description): self
@ -160,7 +160,6 @@ class PartLot extends DBElement
/**
* Sets the comment for this part lot.
*
* @param string $comment
* @return PartLot
*/
public function setComment(string $comment): self
@ -207,7 +206,6 @@ class PartLot extends DBElement
/**
* Sets the storage location, where this part lot is stored.
*
* @param Storelocation|null $storage_location
* @return PartLot
*/
public function setStorageLocation(?Storelocation $storage_location): self
@ -254,7 +252,6 @@ class PartLot extends DBElement
/**
* Set the unknown instock status of this part lot.
*
* @param bool $instock_unknown
* @return PartLot
*/
public function setInstockUnknown(bool $instock_unknown): self
@ -292,7 +289,6 @@ class PartLot extends DBElement
}
/**
* @param bool $needs_refill
* @return PartLot
*/
public function setNeedsRefill(bool $needs_refill): self

View file

@ -37,14 +37,14 @@ trait AdvancedPropertyTrait
protected $needs_review = false;
/**
* @var string A comma separated list of tags, associated with the part.
* @var string a comma separated list of tags, associated with the part
* @ORM\Column(type="text")
* @ColumnSecurity(type="string", prefix="tags", placeholder="")
*/
protected $tags = '';
/**
* @var float|null How much a single part unit weighs in grams.
* @var float|null how much a single part unit weighs in grams
* @ORM\Column(type="float", nullable=true)
* @ColumnSecurity(type="float", placeholder=null)
* @Assert\PositiveOrZero()
@ -53,8 +53,6 @@ trait AdvancedPropertyTrait
/**
* Checks if this part is marked, for that it needs further review.
*
* @return bool
*/
public function isNeedsReview(): bool
{
@ -63,7 +61,9 @@ trait AdvancedPropertyTrait
/**
* Sets the "needs review" status of this part.
*
* @param bool $needs_review The new status
*
* @return Part|self
*/
public function setNeedsReview(bool $needs_review): self
@ -75,8 +75,6 @@ trait AdvancedPropertyTrait
/**
* Gets a comma separated list, of tags, that are assigned to this part.
*
* @return string
*/
public function getTags(): string
{
@ -87,7 +85,6 @@ trait AdvancedPropertyTrait
* Sets a comma separated list of tags, that are assigned to this part.
*
* @param string $tags The new tags
* @return self
*/
public function setTags(string $tags): self
{
@ -99,8 +96,6 @@ trait AdvancedPropertyTrait
/**
* Returns the mass of a single part unit.
* Returns null, if the mass is unknown/not set yet.
*
* @return float|null
*/
public function getMass(): ?float
{
@ -111,8 +106,7 @@ trait AdvancedPropertyTrait
* Sets the mass of a single part unit.
* Sett to null, if the mass is unknown.
*
* @param float|null $mass The new mass.
* @return self
* @param float|null $mass the new mass
*/
public function setMass(?float $mass): self
{

View file

@ -49,7 +49,7 @@ trait BasicPropertyTrait
protected $visible = true;
/**
* @var bool True, if the part is marked as favorite.
* @var bool true, if the part is marked as favorite
* @ORM\Column(type="boolean")
* @ColumnSecurity(type="boolean")
*/
@ -111,7 +111,7 @@ trait BasicPropertyTrait
* Check if this part is a favorite.
*
* @return bool * true if this part is a favorite
* * false if this part is not a favorite.
* * false if this part is not a favorite
*/
public function isFavorite(): bool
{
@ -143,8 +143,6 @@ trait BasicPropertyTrait
* Sets the description of this part.
*
* @param string $new_description the new description
*
* @return self
*/
public function setDescription(?string $new_description): self
{
@ -157,8 +155,6 @@ trait BasicPropertyTrait
* Sets the comment property of this part.
*
* @param string $new_comment the new comment
*
* @return self
*/
public function setComment(string $new_comment): self
{
@ -172,8 +168,6 @@ trait BasicPropertyTrait
* The category property is required for every part, so you can not pass null like the other properties (footprints).
*
* @param Category $category The new category of this part
*
* @return self
*/
public function setCategory(Category $category): self
{
@ -187,8 +181,6 @@ trait BasicPropertyTrait
*
* @param Footprint|null $new_footprint The new footprint of this part. Set to null, if this part should not have
* a footprint.
*
* @return self
*/
public function setFootprint(?Footprint $new_footprint): self
{
@ -202,8 +194,6 @@ trait BasicPropertyTrait
*
* @param $new_favorite_status bool The new favorite status, that should be applied on this part.
* Set this to true, when the part should be a favorite.
*
* @return self
*/
public function setFavorite(bool $new_favorite_status): self
{

View file

@ -49,7 +49,7 @@ trait InstockTrait
protected $minamount = 0;
/**
* @var ?MeasurementUnit The unit in which the part's amount is measured.
* @var ?MeasurementUnit the unit in which the part's amount is measured
* @ORM\ManyToOne(targetEntity="MeasurementUnit", inversedBy="parts")
* @ORM\JoinColumn(name="id_part_unit", referencedColumnName="id", nullable=true)
* @ColumnSecurity(type="object", prefix="unit")
@ -69,9 +69,6 @@ trait InstockTrait
/**
* Adds the given part lot, to the list of part lots.
* The part lot is assigned to this part.
*
* @param PartLot $lot
* @return self
*/
public function addPartLot(PartLot $lot): self
{
@ -84,9 +81,7 @@ trait InstockTrait
/**
* Removes the given part lot from the list of part lots.
*
* @param PartLot $lot The part lot that should be deleted.
*
* @return self
* @param PartLot $lot the part lot that should be deleted
*/
public function removePartLot(PartLot $lot): self
{
@ -98,8 +93,6 @@ trait InstockTrait
/**
* Gets the measurement unit in which the part's amount should be measured.
* Returns null if no specific unit was that. That means the parts are measured simply in quantity numbers.
*
* @return MeasurementUnit|null
*/
public function getPartUnit(): ?MeasurementUnit
{
@ -109,9 +102,6 @@ trait InstockTrait
/**
* Sets the measurement unit in which the part's amount should be measured.
* Set to null, if the part should be measured in quantities.
*
* @param MeasurementUnit|null $partUnit
* @return self
*/
public function setPartUnit(?MeasurementUnit $partUnit): self
{
@ -182,8 +172,6 @@ trait InstockTrait
* See getPartUnit() for the associated unit.
*
* @param float $new_minamount the new count of parts which should be in stock at least
*
* @return self
*/
public function setMinAmount(float $new_minamount): self
{

View file

@ -41,7 +41,7 @@ trait ManufacturerTrait
protected $manufacturer;
/**
* @var string The url to the part on the manufacturer's homepage.
* @var string the url to the part on the manufacturer's homepage
* @ORM\Column(type="string")
* @Assert\Url()
* @ColumnSecurity(prefix="mpn", type="string", placeholder="")
@ -86,7 +86,7 @@ trait ManufacturerTrait
/**
* Similar to getManufacturerProductUrl, but here only the database value is returned.
*
* @return string The manufacturer url saved in DB for this part.
* @return string the manufacturer url saved in DB for this part
*/
public function getCustomProductURL(): string
{
@ -115,7 +115,6 @@ trait ManufacturerTrait
* Sets the manufacturing status for this part
* See getManufacturingStatus() for valid values.
*
* @param string $manufacturing_status
* @return Part
*/
public function setManufacturingStatus(string $manufacturing_status): self
@ -137,8 +136,6 @@ trait ManufacturerTrait
/**
* Returns the assigned manufacturer product number (MPN) for this part.
*
* @return string
*/
public function getManufacturerProductNumber(): string
{
@ -148,7 +145,6 @@ trait ManufacturerTrait
/**
* Sets the manufacturer product number (MPN) for this part.
*
* @param string $manufacturer_product_number
* @return Part
*/
public function setManufacturerProductNumber(string $manufacturer_product_number): self
@ -163,8 +159,6 @@ trait ManufacturerTrait
* Set to "" if this part should use the automatically URL based on its manufacturer.
*
* @param string $new_url The new url
*
* @return self
*/
public function setManufacturerProductURL(string $new_url): self
{
@ -178,8 +172,6 @@ trait ManufacturerTrait
*
* @param Manufacturer|null $new_manufacturer The new Manufacturer of this part. Set to null, if this part should
* not have a manufacturer.
*
* @return self
*/
public function setManufacturer(?Manufacturer $new_manufacturer): self
{

View file

@ -31,7 +31,7 @@ use Doctrine\Common\Collections\Collection;
trait OrderTrait
{
/**
* @var Orderdetail[]|Collection The details about how and where you can order this part.
* @var Orderdetail[]|Collection the details about how and where you can order this part
* @ORM\OneToMany(targetEntity="App\Entity\PriceInformations\Orderdetail", mappedBy="part", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
* @ColumnSecurity(prefix="orderdetails", type="collection")
@ -121,9 +121,7 @@ trait OrderTrait
* Adds the given orderdetail to list of orderdetails.
* The orderdetail is assigned to this part.
*
* @param Orderdetail $orderdetail The orderdetail that should be added.
*
* @return self
* @param Orderdetail $orderdetail the orderdetail that should be added
*/
public function addOrderdetail(Orderdetail $orderdetail): self
{
@ -136,7 +134,6 @@ trait OrderTrait
/**
* Removes the given orderdetail from the list of orderdetails.
*
* @param Orderdetail $orderdetail
* @return OrderTrait
*/
public function removeOrderdetail(Orderdetail $orderdetail): self
@ -157,8 +154,6 @@ trait OrderTrait
* (if the part has exactly one orderdetails,
* set this orderdetails as order orderdetails.
* Otherwise, set "no order orderdetails")
*
* @return self
*/
public function setManualOrder(bool $new_manual_order, int $new_order_quantity = 1, ?Orderdetail $new_order_orderdetail = null): self
{

View file

@ -145,7 +145,6 @@ class Storelocation extends PartsContainingDBElement
}
/**
* @param bool $only_single_part
* @return Storelocation
*/
public function setOnlySinglePart(bool $only_single_part): self
@ -166,7 +165,6 @@ class Storelocation extends PartsContainingDBElement
}
/**
* @param bool $limit_to_existing_parts
* @return Storelocation
*/
public function setLimitToExistingParts(bool $limit_to_existing_parts): self
@ -185,7 +183,6 @@ class Storelocation extends PartsContainingDBElement
}
/**
* @param MeasurementUnit|null $storage_type
* @return Storelocation
*/
public function setStorageType(?MeasurementUnit $storage_type): self

View file

@ -127,7 +127,6 @@ class Supplier extends Company
/**
* Sets the default currency.
*
* @param Currency|null $default_currency
* @return Supplier
*/
public function setDefaultCurrency(?Currency $default_currency): self
@ -151,6 +150,7 @@ class Supplier extends Company
* Sets the shipping costs for an order with this supplier.
*
* @param string|null $shipping_costs a bcmath string with the shipping costs
*
* @return Supplier
*/
public function setShippingCosts(?string $shipping_costs): self