TranslationsBindingTrait::translationBindings()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 12
cts 12
cp 1
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Omatech\Mage\Core\Providers\Bindings;
4
5
use Omatech\Mage\Core\Domains\Translations\Contracts\AllTranslationInterface;
6
use Omatech\Mage\Core\Domains\Translations\Contracts\CreateTranslationInterface;
7
use Omatech\Mage\Core\Domains\Translations\Contracts\DeleteTranslationInterface;
8
use Omatech\Mage\Core\Domains\Translations\Contracts\ExistsTranslationInterface;
9
use Omatech\Mage\Core\Domains\Translations\Contracts\FindTranslationInterface;
10
use Omatech\Mage\Core\Domains\Translations\Contracts\TranslationInterface;
11
use Omatech\Mage\Core\Domains\Translations\Contracts\UniqueTranslationInterface;
12
use Omatech\Mage\Core\Domains\Translations\Contracts\UpdateTranslationInterface;
13
use Omatech\Mage\Core\Domains\Translations\Translation;
14
use Omatech\Mage\Core\Repositories\Translations\AllTranslation;
15
use Omatech\Mage\Core\Repositories\Translations\CreateTranslation;
16
use Omatech\Mage\Core\Repositories\Translations\DeleteTranslation;
17
use Omatech\Mage\Core\Repositories\Translations\ExistsTranslation;
18
use Omatech\Mage\Core\Repositories\Translations\FindTranslation;
19
use Omatech\Mage\Core\Repositories\Translations\UniqueTranslation;
20
use Omatech\Mage\Core\Repositories\Translations\UpdateTranslation;
21
22
trait TranslationsBindingTrait
23
{
24 82
    private function translationBindings()
25
    {
26
        $this->app->bind('mage.translations', function () {
0 ignored issues
show
Bug introduced by
The property app does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
27 10
            return resolve(TranslationInterface::class);
28 82
        });
29
30 82
        $this->app->bind(TranslationInterface::class, Translation::class);
31 82
        $this->app->bind(AllTranslationInterface::class, AllTranslation::class);
32 82
        $this->app->bind(FindTranslationInterface::class, FindTranslation::class);
33 82
        $this->app->bind(CreateTranslationInterface::class, CreateTranslation::class);
34 82
        $this->app->bind(DeleteTranslationInterface::class, DeleteTranslation::class);
35 82
        $this->app->bind(ExistsTranslationInterface::class, ExistsTranslation::class);
36 82
        $this->app->bind(UpdateTranslationInterface::class, UpdateTranslation::class);
37 82
        $this->app->bind(UniqueTranslationInterface::class, UniqueTranslation::class);
38 82
    }
39
}
40