Test Failed
Branch master (b41ac8)
by John
03:12
created

ACipher   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getPaddedText() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Encryption\Cipher;
6
7
8
abstract class ACipher
0 ignored issues
show
Coding Style introduced by
ACipher does not seem to conform to the naming convention (^Abstract|Factory$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
9
{
10
    public const BLOCK_SIZE = 0;
11
    public const IV_LENGTH = 0;
12
    public const CIPHER = 'abstract';
13
14 2
    public function getName(): string
15
    {
16 2
        return static::CIPHER;
17
    }
18
19 77
    protected function getPaddedText(string $plainText, int $blockSize): string
20
    {
21 77
        $stringLength = strlen($plainText);
22 77
        if ($stringLength % $blockSize) {
23 77
            $plainText = str_pad($plainText, $stringLength + $blockSize - $stringLength % $blockSize, "\0");
0 ignored issues
show
Coding Style introduced by
Consider using a different name than the parameter $plainText. This often makes code more readable.
Loading history...
24
        }
25 77
        return $plainText;
26
    }
27
}
28