Passed
Pull Request — master (#489)
by Artem
37:51
created

DeleteVirtualCardConv   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A convert() 0 3 1
1
<?php
2
3
/**
4
 * amadeus-ws-client
5
 *
6
 * Copyright 2015 Amadeus Benelux NV
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this file except in compliance with the License.
10
 * You may obtain a copy of the License at
11
 *
12
 * http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and
18
 * limitations under the License.
19
 *
20
 * @package Amadeus
21
 * @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
22
 */
23
24
namespace Amadeus\Client\RequestCreator\Converter\PAY;
25
26
use Amadeus\Client\RequestCreator\Converter\BaseConverter;
27
use Amadeus\Client\RequestOptions\PayDeleteVirtualCardOptions;
28
use Amadeus\Client\Struct;
29
30
/**
31
 * DeleteVirtualCardConv
32
 *
33
 * @package Amadeus\Client\RequestCreator\Converter\PAY
34
 * @author Konstantin Bogomolov <[email protected]>
35
 */
36
class DeleteVirtualCardConv extends BaseConverter
37
{
38
    /**
39
     * @param PayDeleteVirtualCardOptions $requestOptions
40
     * @param int|string                     $version
41
     * @return Struct\Pay\DeleteVirtualCard
42
     */
43
    public function convert($requestOptions, $version)
44
    {
45
        return new Struct\Pay\DeleteVirtualCard($requestOptions, $version);
0 ignored issues
show
Unused Code introduced by
The call to Amadeus\Client\Struct\Pa...tualCard::__construct() has too many arguments starting with $version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

45
        return /** @scrutinizer ignore-call */ new Struct\Pay\DeleteVirtualCard($requestOptions, $version);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
46
    }
47
}
48