TransManager::count()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arcanedev\LaravelLang\Contracts;
6
7
use Arcanedev\LaravelLang\Entities\{Locale, LocaleCollection};
8
9
/**
10
 * Interface  TransManager
11
 *
12
 * @author    ARCANEDEV <[email protected]>
13
 */
14
interface TransManager
15
{
16
    /* -----------------------------------------------------------------
17
     |  Getters & Setters
18
     | -----------------------------------------------------------------
19
     */
20
21
    /**
22
     * Get the translation paths.
23
     *
24
     * @return array
25
     */
26
    public function getPaths(): array;
27
28
    /* -----------------------------------------------------------------
29
     |  Main Methods
30
     | -----------------------------------------------------------------
31
     */
32
33
    /**
34
     * Get locale collection by group location.
35
     *
36
     * @param  string      $group
37
     * @param  mixed|null  $default
38
     *
39
     * @return \Arcanedev\LaravelLang\Entities\LocaleCollection|null
40
     */
41
    public function getCollection(string $group, $default = null): ?LocaleCollection;
42
43
    /**
44
     * Get a locale translations from a group.
45
     *
46
     * @param  string      $group
47
     * @param  string      $locale
48
     * @param  mixed|null  $default
49
     *
50
     * @return \Arcanedev\LaravelLang\Entities\Locale|null
51
     */
52
    public function getFrom(string $group, string $locale, $default = null): ?Locale;
53
54
    /**
55
     * Get locale keys.
56
     *
57
     * @return array
58
     */
59
    public function keys(): array;
60
61
    /**
62
     * Get locales count.
63
     *
64
     * @return int
65
     */
66
    public function count(): int;
67
68
    /* -----------------------------------------------------------------
69
     |  Check Methods
70
     | -----------------------------------------------------------------
71
     */
72
73
    /**
74
     * Check if a translation group exists.
75
     *
76
     * @param  string  $group
77
     *
78
     * @return bool
79
     */
80
    public function hasCollection(string $group): bool;
81
}
82