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

michalsn / codeigniter-relations / 26949978121

04 Jun 2026 11:51AM UTC coverage: 90.248% (+0.04%) from 90.211%
26949978121

push

github

michalsn
reuse entity relation setter closure

9 of 9 new or added lines in 1 file covered. (100.0%)

18 existing lines in 3 files now uncovered.

1203 of 1333 relevant lines covered (90.25%)

23.74 hits per line

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

56.25
/src/Exceptions/RelationException.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Michalsn\CodeIgniterRelations\Exceptions;
6

7
use RuntimeException;
8

9
final class RelationException extends RuntimeException
10
{
11
    public static function forThroughRelationNotWritable(string $relationType): static
12
    {
13
        return new self(lang('Relations.throughRelationNotWritable', [$relationType]));
4✔
14
    }
15

16
    public static function forMorphToNotWritable(): static
17
    {
18
        return new self(lang('Relations.morphToNotWritable'));
2✔
19
    }
20

21
    public static function forInvalidMorphModel(string $modelClass): static
22
    {
23
        return new self(lang('Relations.invalidMorphModel', [$modelClass]));
1✔
24
    }
25

26
    public static function forRelationMethodNotFound(string $methodName, string $modelClass): static
27
    {
28
        return new self(lang('Relations.relationMethodNotFound', [$methodName, $modelClass]));
×
29
    }
30

31
    public static function forCallbackWithArrayRelations(): static
32
    {
33
        return new self(lang('Relations.callbackWithArrayRelations'));
1✔
34
    }
35

36
    public static function forSaveManyNotSupportedForSingular(string $relationType): static
37
    {
UNCOV
38
        return new self(lang('Relations.saveManyNotSupportedForSingular', [$relationType]));
×
39
    }
40

41
    public static function forMissingParentContext(string $methodName): static
42
    {
43
        return new self(lang('Relations.missingParentContext', [$methodName]));
12✔
44
    }
45

46
    public static function forMethodNotSupported(string $methodName, string $relationType): static
47
    {
48
        return new self(lang('Relations.methodNotSupported', [$methodName, $relationType]));
1✔
49
    }
50

51
    public static function forPrimaryKeyNotAllowedInSave(string $primaryKey): static
52
    {
53
        return new self(lang('Relations.primaryKeyNotAllowedInSave', [$primaryKey]));
1✔
54
    }
55

56
    public static function forPrimaryKeyNotAllowedInSaveMany(string $primaryKey, int $index): static
57
    {
58
        return new self(lang('Relations.primaryKeyNotAllowedInSaveMany', [$primaryKey, $index]));
1✔
59
    }
60

61
    public static function forModelClassNotFound(string $entityClass): static
62
    {
UNCOV
63
        return new self(lang('Relations.modelClassNotFound', [$entityClass]));
×
64
    }
65

66
    public static function forCannotDeleteWithoutPrimaryKey(): static
67
    {
68
        return new self(lang('Relations.cannotDeleteWithoutPrimaryKey'));
1✔
69
    }
70

71
    public static function forMethodNotARelation(string $method, string $modelClass): static
72
    {
73
        return new self(lang('Relations.methodNotARelation', [$method, $modelClass]));
×
74
    }
75

76
    public static function forCannotCallRelationWithoutId(string $method, string $primaryKey): static
77
    {
78
        return new self(lang('Relations.cannotCallRelationWithoutId', [$method, $primaryKey]));
×
79
    }
80

81
    public static function forParentMissingKey(string $keyName): static
82
    {
83
        return new self(lang('Relations.parentMissingKey', [$keyName]));
×
84
    }
85

86
    public static function forIdRequiredWithModelClass(): static
87
    {
UNCOV
88
        return new self(lang('Relations.idRequiredWithModelClass'));
×
89
    }
90
}
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

© 2026 Coveralls, Inc