ParameterUrlGenerator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A generate() 0 8 2
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