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

CannotShrinkMenuException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 9
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromMarginAndTerminalWidth() 0 7 1
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