composer init --name='gordinskiy/new_package' \
--description='Project description' \
--type='library' \
--author='Dmitriy Gordinskiy' \
--license='MIT' \
--require='php:>=8.2' \
--require='webmozart/assert:^1.11' \
--require-dev='phpunit/phpunit:^10.3' \
--require-dev='vimeo/psalm:^5.11' \
--require-dev='phpstan/phpstan:^1.10'
SELECT * FROM (
SELECT * FROM doctrine_migration_versions ORDER BY execution_time ASC LIMIT 3
) r ORDER BY r.execution_time DESC;
class PaymentType
{
private const CASH = 1;
private const NON_CASH = 2;
private int $type;
private function __construct(int $type)
{
$this->type = $type;
}
public static function cash(): self
{
return new self(self::CASH);
}
public static function nonCash(): self
{
return new self(self::NON_CASH);
}
public function isCash(): bool
{
return $this->type === self::CASH;
}
public function isNonCash(): bool
{
return $this->type === self::NON_CASH;
}
}