nur-sery/nur_tests/mapper/base/impl/AddMapper.php

17 lines
319 B
PHP
Raw Normal View History

2024-04-04 16:26:22 +04:00
<?php
namespace nur\mapper\base\impl;
use nur\mapper\base\Mapper;
class AddMapper extends Mapper {
function __construct(int $amount, ?iterable $source = null) {
parent::__construct($source);
$this->amount = $amount;
}
private $amount;
function mapper($item) {
return $item + $this->amount;
}
}