| Total Complexity | 4 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class ReferralLinkExtension extends AbstractExtension |
||
| 10 | { |
||
| 11 | |||
| 12 | /** @var ReferralManager */ |
||
| 13 | private $referralManager; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * ReferralLinkExtension constructor. |
||
| 17 | * @param ReferralManager $referralManager |
||
| 18 | */ |
||
| 19 | public function __construct(ReferralManager $referralManager) |
||
| 20 | { |
||
| 21 | $this->referralManager = $referralManager; |
||
| 22 | } |
||
| 23 | |||
| 24 | |||
| 25 | public function getFunctions() |
||
| 26 | { |
||
| 27 | return [ |
||
| 28 | new \Twig_SimpleFunction('referralLink', [$this, 'referralProductLinkGenerator']), |
||
|
|
|||
| 29 | new \Twig_SimpleFunction('referralRootLink', [$this, 'referralRootLinkGenerator']) |
||
| 30 | ]; |
||
| 31 | } |
||
| 32 | |||
| 33 | public function referralProductLinkGenerator($id) |
||
| 34 | { |
||
| 35 | return $this->referralManager->referralProductLinkGenerator($id); |
||
| 36 | } |
||
| 37 | |||
| 38 | public function referralRootLinkGenerator() |
||
| 41 | } |
||
| 42 | } |
||
| 43 |