Completed
Pull Request — master (#33)
by ARCANEDEV
14:20
created

LangPublishException::unpublishable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arcanedev\LaravelLang\Exceptions;
6
7
/**
8
 * Class     LangPublishException
9
 *
10
 * @package  Arcanedev\LaravelLang\Exceptions
11
 * @author   ARCANEDEV <[email protected]>
12
 */
13
class LangPublishException extends LaravelLangException
14
{
15
    /* -----------------------------------------------------------------
16
     |  Main Methods
17
     | -----------------------------------------------------------------
18
     */
19
20
    /**
21
     * @param  string  $locale
22
     *
23
     * @return static
24
     */
25
    public static function unpublishable(string $locale): self
26
    {
27
        return new static(
28
            "You can't publish the translations because the [$locale] folder is not empty. ".
29
            "To override the translations, try to clean/delete the [$locale] folder or force the publication."
30
        );
31
    }
32
}
33