Examples for presentation.

This commit is contained in:
giedrius
2024-11-19 13:57:03 +02:00
commit 41f2b5eec1
23 changed files with 3351 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace Example\Good;
class VATCalculator
{
private float $vat;
/**
* @param float $vat
*/
public function __construct(float $vat)
{
$this->vat = $vat;
}
/**
* @param Product[] $products
*/
public function applyVat(array $products) : void {
foreach ($products as $product) {
$product->setPrice( $product->price * (1+$this->vat/100) );
}
}
}