Fixed some inspection issues.

This commit is contained in:
Jan Böhmer 2019-11-10 14:00:56 +01:00
parent 3438f15274
commit 6ddc937ec5
32 changed files with 111 additions and 208 deletions

View file

@ -20,25 +20,6 @@
*/
declare(strict_types=1);
/**
* Part-DB Version 0.4+ "nextgen"
* Copyright (C) 2016 - 2019 Jan Böhmer
* https://github.com/jbtronics.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
namespace App\Entity\Parts;
@ -145,6 +126,7 @@ class Category extends PartsContainingDBElement
}
/**
* @param string $partname_hint
* @return Category
*/
public function setPartnameHint(string $partname_hint): self
@ -163,6 +145,7 @@ class Category extends PartsContainingDBElement
}
/**
* @param string $partname_regex
* @return Category
*/
public function setPartnameRegex(string $partname_regex): self
@ -181,6 +164,7 @@ class Category extends PartsContainingDBElement
}
/**
* @param bool $disable_footprints
* @return Category
*/
public function setDisableFootprints(bool $disable_footprints): self
@ -199,6 +183,7 @@ class Category extends PartsContainingDBElement
}
/**
* @param bool $disable_manufacturers
* @return Category
*/
public function setDisableManufacturers(bool $disable_manufacturers): self
@ -217,6 +202,7 @@ class Category extends PartsContainingDBElement
}
/**
* @param bool $disable_autodatasheets
* @return Category
*/
public function setDisableAutodatasheets(bool $disable_autodatasheets): self
@ -235,6 +221,7 @@ class Category extends PartsContainingDBElement
}
/**
* @param bool $disable_properties
* @return Category
*/
public function setDisableProperties(bool $disable_properties): self
@ -253,6 +240,7 @@ class Category extends PartsContainingDBElement
}
/**
* @param string $default_description
* @return Category
*/
public function setDefaultDescription(string $default_description): self
@ -271,6 +259,7 @@ class Category extends PartsContainingDBElement
}
/**
* @param string $default_comment
* @return Category
*/
public function setDefaultComment(string $default_comment): self

View file

@ -127,6 +127,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

@ -30,7 +30,7 @@ use Symfony\Component\Validator\Constraints as Assert;
/**
* This unit represents the unit in which the amount of parts in stock are measured.
* This could be something like N, gramms, meters, etc...
* This could be something like N, grams, meters, etc...
*
* @ORM\Entity(repositoryClass="App\Repository\StructuralDBElementRepository")
* @ORM\Table(name="`measurement_units`")
@ -45,7 +45,7 @@ class MeasurementUnit extends PartsContainingDBElement
protected $attachments;
/**
* @var string The unit symbol that should be used for the Unit. This could be something like "", g (for gramms)
* @var string The unit symbol that should be used for the Unit. This could be something like "", g (for grams)
* or m (for meters).
* @ORM\Column(type="string", name="unit", nullable=true)
* @Assert\Length(max=10)
@ -54,7 +54,7 @@ class MeasurementUnit extends PartsContainingDBElement
/**
* @var bool Determines if the amount value associated with this unit should be treated as integer.
* Set to false, to measure continuous sizes likes masses or lengthes.
* Set to false, to measure continuous sizes likes masses or lengths.
* @ORM\Column(type="boolean", name="is_integer")
*/
protected $is_integer = false;
@ -122,6 +122,7 @@ class MeasurementUnit extends PartsContainingDBElement
}
/**
* @param bool $isInteger
* @return MeasurementUnit
*/
public function setIsInteger(bool $isInteger): self
@ -140,6 +141,7 @@ class MeasurementUnit extends PartsContainingDBElement
}
/**
* @param bool $usesSIPrefixes
* @return MeasurementUnit
*/
public function setUseSIPrefix(bool $usesSIPrefixes): self

View file

@ -100,7 +100,7 @@ class Part extends AttachmentContainingDBElement
protected $lastModified;
/***************************************************************
* Overriden properties
* Overridden properties
* (They are defined here and not in a trait, to avoid conflicts)
****************************************************************/

View file

@ -56,7 +56,7 @@ class PartLot extends DBElement
/**
* @var ?\DateTime Set a time until when the lot must be used.
* Set to null, if the lot can be used indefinitley.
* Set to null, if the lot can be used indefinitely.
* @ORM\Column(type="datetime", name="expiration_date", nullable=true)
*/
protected $expiration_date;
@ -84,7 +84,7 @@ class PartLot extends DBElement
protected $instock_unknown = false;
/**
* @var float For continuos sizes (length, volume, etc.) the instock is saved here.
* @var float For continuous sizes (length, volume, etc.) the instock is saved here.
* @ORM\Column(type="float")
* @Assert\PositiveOrZero()
*/
@ -136,6 +136,7 @@ class PartLot extends DBElement
/**
* Sets the description of the part lot.
*
* @param string $description
* @return PartLot
*/
public function setDescription(string $description): self
@ -158,6 +159,7 @@ class PartLot extends DBElement
/**
* Sets the comment for this part lot.
*
* @param string $comment
* @return PartLot
*/
public function setComment(string $comment): self
@ -192,7 +194,7 @@ class PartLot extends DBElement
}
/**
* Gets the storage locatiion, where this part lot is stored.
* Gets the storage location, where this part lot is stored.
*
* @return Storelocation|null The store location where this part is stored
*/
@ -204,6 +206,7 @@ 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
@ -250,6 +253,7 @@ 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
@ -287,6 +291,7 @@ 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 seperated list of tags, assocciated 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 gramms.
* @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()
@ -63,7 +63,7 @@ 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
@ -86,6 +86,7 @@ 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
@ -110,6 +111,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
*/
public function setMass(?float $mass): self

View file

@ -70,6 +70,7 @@ 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
@ -109,6 +110,7 @@ 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

View file

@ -99,7 +99,7 @@ trait ManufacturerTrait
* (Similar to https://designspark.zendesk.com/hc/en-us/articles/213584805-What-are-the-Lifecycle-Status-definitions-)
* * "": Status unknown
* * "announced": Part has been announced, but is not in production yet
* * "active": Part is in production and will be for the forseeable future
* * "active": Part is in production and will be for the foreseeable future
* * "nrfnd": Not recommended for new designs.
* * "eol": Part will become discontinued soon
* * "discontinued": Part is obsolete/discontinued by the manufacturer.
@ -115,6 +115,7 @@ 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
@ -147,6 +148,7 @@ 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

View file

@ -32,7 +32,7 @@ use Doctrine\Common\Collections\Collection;
trait OrderTrait
{
/**
* @var Orderdetail[] 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")
@ -137,6 +137,7 @@ trait OrderTrait
/**
* Removes the given orderdetail from the list of orderdetails.
*
* @param Orderdetail $orderdetail
* @return OrderTrait
*/
public function removeOrderdetail(Orderdetail $orderdetail): self

View file

@ -57,7 +57,7 @@ use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Storelocation.
* Class Store location.
*
* @ORM\Entity(repositoryClass="App\Repository\StructuralDBElementRepository")
* @ORM\Table("`storelocations`")
@ -126,8 +126,8 @@ class Storelocation extends PartsContainingDBElement
*
* When this attribute is set, it is not possible to add additional parts or increase the instock of existing parts.
*
* @return bool * true if the storelocation is full
* * false if the storelocation isn't full
* @return bool * true if the store location is full
* * false if the store location isn't full
*/
public function isFull(): bool
{
@ -145,6 +145,7 @@ class Storelocation extends PartsContainingDBElement
}
/**
* @param bool $only_single_part
* @return Storelocation
*/
public function setOnlySinglePart(bool $only_single_part): self
@ -165,6 +166,7 @@ class Storelocation extends PartsContainingDBElement
}
/**
* @param bool $limit_to_existing_parts
* @return Storelocation
*/
public function setLimitToExistingParts(bool $limit_to_existing_parts): self
@ -183,6 +185,7 @@ class Storelocation extends PartsContainingDBElement
}
/**
* @param MeasurementUnit|null $storage_type
* @return Storelocation
*/
public function setStorageType(?MeasurementUnit $storage_type): self
@ -199,7 +202,7 @@ class Storelocation extends PartsContainingDBElement
*********************************************************************************/
/**
* Change the "is full" attribute of this storelocation.
* Change the "is full" attribute of this store location.
*
* "is_full" = true means that there is no more space in this storelocation.
* This attribute is only for information, it has no effect.

View file

@ -117,7 +117,7 @@ class Supplier extends Company
/**
* Gets the currency that should be used by default, when creating a orderdetail with this supplier.
*
* @return ?Currency
* @return Currency|null
*/
public function getDefaultCurrency(): ?Currency
{
@ -127,7 +127,8 @@ class Supplier extends Company
/**
* Sets the default currency.
*
* @param ?Currency $default_currency
* @param Currency|null $default_currency
* @return Supplier
*/
public function setDefaultCurrency(?Currency $default_currency): self
{
@ -150,6 +151,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
{