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

tattersoftware / codeigniter4-schemas / 3884177658

pending completion
3884177658

Pull #44

github

GitHub
Merge dbcb0d181 into cee97dbe4
Pull Request #44: fix: ForeignKey should return strings

6 of 6 new or added lines in 2 files covered. (100.0%)

6 existing lines in 2 files now uncovered.

397 of 519 relevant lines covered (76.49%)

5.28 hits per line

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

33.33
/src/Reader/BaseReader.php
1
<?php
2

3
namespace Tatter\Schemas\Reader;
4

5
use Tatter\Schemas\BaseHandler;
6
use Tatter\Schemas\Exceptions\SchemasException;
7

8
/**
9
 * Base Drafter Class
10
 *
11
 * Provides common methods for Reader classes.
12
 */
13
abstract class BaseReader extends BaseHandler
14
{
15
    /**
16
     * Whether the reader is in a state to be used
17
     *
18
     * @var bool
19
     */
20
    protected $ready = false;
21

22
    /**
23
     * The currently loaded schema.
24
     * Could be static but since Reader is usually called by
25
     * the service we'll try it like this.
26
     *
27
     * @var string
28
     */
29
    protected $schema;
30

31
    /**
32
     * Indicate whether the reader is in a state to be used
33
     */
34
    public function ready(): bool
35
    {
36
        return $this->ready;
1✔
37
    }
38

39
    /**
40
     * Check that reader is ready before using its functions
41
     */
42
    protected function ensureReady(): bool
43
    {
44
        if ($this->ready) {
2✔
45
            return true;
2✔
46
        }
47

48
        if (! $this->config->silent) {
×
49
            throw SchemasException::forReaderNotReady();
×
50
        }
51

52
        $this->errors[] = lang('Schemas.notReady');
×
53

54
        return false;
×
55
    }
56

57
    /**
58
     * Dummy implementation for classes that cannot lazy load
59
     *
60
     * @param array|string $tables
61
     */
62
    public function fetch($tables)
63
    {
UNCOV
64
    }
×
65

66
    /**
67
     * Dummy implementation for classes that only bulk load
68
     */
69
    public function fetchAll()
70
    {
UNCOV
71
    }
×
72
}
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