Completed
Push — master ( 0283b1...36767e )
by Aydin
14s queued 11s
created

fromMarginAndTerminalWidth()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpSchool\CliMenu\Exception;
6
7
use InvalidArgumentException;
8
9
class CannotShrinkMenuException extends InvalidArgumentException
10
{
11
    public static function fromMarginAndTerminalWidth(int $margin, int $terminalWidth) : self
12
    {
13
        return new self(
14
            sprintf(
15
                'Cannot shrink menu. Margin: %s * 2 with terminal width: %s leaves no space for menu',
16
                $margin,
17
                $terminalWidth
18
            )
19
        );
20
    }
21
}
22