This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace Utils\PHPStan; | |
use Generator; | |
use Illuminate\Database\Eloquent\Model; | |
use PhpParser\Node; | |
use PhpParser\Node\Expr\PropertyFetch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
function convert(string $from, string $to, float $amount) | |
{ | |
$exchangeRates = [ | |
'USD,EUR' => 1.240055, | |
// ... | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// provided as method arguments: | |
$quantityInCurrentDelivery = 10.0; | |
// product-specific: | |
$quantityPrecision = 5; | |
// these quantities are all floats: | |
$quantityInitiallyOrdered = 12.5; |