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.
Completed
Push — master ( fb3a62...ec23f8 )
by Orlando
01:04
created

Certificate::getFileExtensionName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the cfdi-certificate project.
5
 *
6
 * (c) Kinedu
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 Kinedu\CFDI\Certificate;
13
14
use Kinedu\CFDI\Certificate\Traits\HasFiles;
15
16
abstract class Certificate
17
{
18
    use HasFiles;
19
20
    public abstract function decode(): string;
21
22
    public function save(string $directory, string $filename)
23
    {
24
        $extension = $this->decodeExtension;
0 ignored issues
show
Bug introduced by
The property decodeExtension does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
25
26
        $directory = rtrim($directory, '/').'/';
27
        $directory = "{$directory}{$filename}.{$extension}";
28
29
        return file_put_contents($directory, $this->decode());
30
    }
31
}
32