GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

File::initInputFile()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Trait with methods to handle file uploads via CURL.
5
 *
6
 * @package Teebot (Telegram bot framework)
7
 *
8
 * @author  Stanislav Drozdov <[email protected]>
9
 */
10
11
declare(strict_types=1);
12
13
namespace Teebot\Api\Traits;
14
15
use Teebot\Api\Entity\InputFile;
16
17
trait File
18
{
19
    /**
20
     * Creates an InputFile instance for handling file uploads.
21
     *
22
     * @param string $file Full path to the file
23
     *
24
     * @return \CURLFile
0 ignored issues
show
Bug introduced by
The type CURLFile was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
25
     */
26
    protected function initInputFile(string $file)
27
    {
28
        $inputFile = new InputFile($file);
29
        $file      = $inputFile->getFileForUpload();
30
31
        if ($file) {
32
            $this->hasAttachedData = true;
0 ignored issues
show
Bug Best Practice introduced by
The property hasAttachedData does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
33
        }
34
35
        return $file;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $file also could return the type resource which is incompatible with the documented return type CURLFile.
Loading history...
36
    }
37
}
38