Options::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 5
rs 10
1
<?php
2
3
namespace sylouuu\Curl\Method;
4
5
    /**
6
     * Options
7
     *
8
     * @author sylouuu
9
     * @link https://github.com/sylouuu/php-curl
10
     * @version 0.8.1
11
     * @license MIT
12
     */
13
    class Options extends \sylouuu\Curl\Curl
14
    {
15
        /**
16
         * Constructor
17
         *
18
         * @param string $url
19
         * @param array $options
20
         */
21
        public function __construct($url, $options = null)
22
        {
23
            parent::__construct($url, $options);
24
25
            $this->prepare();
26
        }
27
28
        /**
29
         * Prepare the request
30
         */
31
        public function prepare()
32
        {
33
            $this->setCurlOption(CURLOPT_CUSTOMREQUEST, 'OPTIONS');
0 ignored issues
show
Bug introduced by
sylouuu\Curl\Method\CURLOPT_CUSTOMREQUEST of type integer is incompatible with the type sylouuu\Curl\const expected by parameter $option of sylouuu\Curl\Curl::setCurlOption(). ( Ignorable by Annotation )

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

33
            $this->setCurlOption(/** @scrutinizer ignore-type */ CURLOPT_CUSTOMREQUEST, 'OPTIONS');
Loading history...
34
        }
35
    }
36