Completed
Pull Request — master (#8)
by Rafał
01:58
created

ParameterUrlGenerator::generate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of the takeit/AmpHtmlBundle package.
5
 *
6
 * (c) Rafał Muszyński <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Takeit\Bundle\AmpHtmlBundle\Generator;
13
14
final class ParameterUrlGenerator implements AmpUrlGeneratorInterface
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function generate($url)
20
    {
21
        if (strpos($url, '?') !== false) {
22
            return $url.'&amp';
23
        }
24
25
        return $url.'?amp';
26
    }
27
}
28