Applied code style rules to src/

This commit is contained in:
Jan Böhmer 2020-01-05 15:46:58 +01:00
parent 700c049d26
commit f861de791f
186 changed files with 1462 additions and 1059 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).
*
@ -104,7 +107,7 @@ class Currency extends StructuralDBElement
return null;
}
return bcdiv(1, $tmp, static::PRICE_SCALE);
return bcdiv('1', $tmp, static::PRICE_SCALE);
}
/**

View file

@ -181,8 +181,8 @@ class Orderdetail extends DBElement
/**
* Get the link to the website of the article on the suppliers website.
*
* @param $no_automatic_url bool Set this to true, if you only want to get the local set product URL for this Orderdetail
* and not a automatic generated one, based from the Supplier
* @param bool $no_automatic_url Set this to true, if you only want to get the local set product URL for this Orderdetail
* and not a automatic generated one, based from the Supplier
*
* @return string the link to the article
*/
@ -330,7 +330,7 @@ class Orderdetail extends DBElement
* Sets the custom product supplier URL for this order detail.
* Set this to "", if the function getSupplierProductURL should return the automatic generated URL.
*
* @param $new_url string The new URL for the supplier URL
* @param string $new_url The new URL for the supplier URL
*
* @return Orderdetail
*/

View file

@ -68,10 +68,10 @@ use Symfony\Component\Validator\Constraints as Assert;
*/
class Pricedetail extends DBElement
{
public const PRICE_PRECISION = 5;
use TimestampTrait;
public const PRICE_PRECISION = 5;
/**
* @var Orderdetail
* @ORM\ManyToOne(targetEntity="Orderdetail", inversedBy="pricedetails")
@ -180,7 +180,7 @@ class Pricedetail extends DBElement
*/
public function getPriceRelatedQuantity(): float
{
if ($this->orderdetail && $this->orderdetail->getPart() && !$this->orderdetail->getPart()->useFloatAmount()) {
if ($this->orderdetail && $this->orderdetail->getPart() && ! $this->orderdetail->getPart()->useFloatAmount()) {
$tmp = round($this->price_related_quantity);
return $tmp < 1 ? 1 : $tmp;
@ -203,7 +203,7 @@ class Pricedetail extends DBElement
*/
public function getMinDiscountQuantity(): float
{
if ($this->orderdetail && $this->orderdetail->getPart() && !$this->orderdetail->getPart()->useFloatAmount()) {
if ($this->orderdetail && $this->orderdetail->getPart() && ! $this->orderdetail->getPart()->useFloatAmount()) {
$tmp = round($this->min_discount_quantity);
return $tmp < 1 ? 1 : $tmp;