• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

michalsn / codeigniter-translatable / 17217073242

25 Aug 2025 06:16PM UTC coverage: 95.279%. Remained the same
17217073242

push

github

web-flow
Bump actions/checkout from 4 to 5 (#3)

Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

222 of 233 relevant lines covered (95.28%)

8.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/Traits/TranslatableEntity.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Michalsn\CodeIgniterTranslatable\Traits;
6

7
use Michalsn\CodeIgniterTranslatable\Exceptions\TranslatableException;
8

9
trait TranslatableEntity
10
{
11
    public function translate(?string $locale = null)
12
    {
13
        if ($locale === null) {
4✔
14
            $locale = is_cli() ? config('App')->defaultLocale : service('request')->getLocale();
3✔
15
        }
16

17
        if (! in_array($locale, config('App')->supportedLocales, true)) {
4✔
18
            throw TranslatableException::forLocaleNotSupported($locale);
1✔
19
        }
20

21
        return $this->attributes['translations'][$locale];
3✔
22
    }
23

24
    public function hasTranslation(string $locale): bool
25
    {
26
        return isset($this->attributes['translations'][$locale]);
1✔
27
    }
28

29
    public function getTranslationKeys(): array
30
    {
31
        return array_keys($this->attributes['translations']);
1✔
32
    }
33
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc