for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Polyglot\Pluralization\Rules;
/**
* @package Polyglot/Pluralization/Rules
* @author Mihai MATEI <[email protected]>
*/
class Slovenian implements RuleInterface
{
* @inheritDoc
public function decide(int $n): int
$lastTwo = $n % 100;
if ($lastTwo === 1) {
return 0;
}
if ($lastTwo === 2) {
return 1;
if ($lastTwo === 3 || $lastTwo === 4) {
return 2;
return 3;