__trans()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 2
rs 10
1
<?php
2
3
use Illuminate\Support\Facades\App;
4
5
if ( ! function_exists( '__trans' ) ) :
6
    /**
7
     * Shorthand function for translating text.
8
     *
9
     * @param string $text
10
     * @param array  $replacements
11
     * @param string $toLocale
12
     *
13
     * @return string
14
     */
15
    function __trans( string $text, array $replacements = [], string $to_locale = '' ) {
16
        return App::make('translation')->translate( $text, $replacements, $to_locale );
17
    }
18
endif;