Examples for presentation.
This commit is contained in:
30
sources/Example/Bad/Product.php
Normal file
30
sources/Example/Bad/Product.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Example\Bad;
|
||||
|
||||
class Product
|
||||
{
|
||||
public string $sku = '';
|
||||
public int $quantity = 0;
|
||||
public float $price = 0;
|
||||
|
||||
public function setSku(string $sku): Product
|
||||
{
|
||||
$this->sku = $sku;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setQuantity(int $quantity): Product
|
||||
{
|
||||
$this->quantity = $quantity;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPrice(float $price): Product
|
||||
{
|
||||
$this->price = $price;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user