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

aplus-framework / database / 15202200207

21 Apr 2025 08:34PM UTC coverage: 99.02%. Remained the same
15202200207

push

github

natanfelles
Merge branch 'development'

2426 of 2450 relevant lines covered (99.02%)

10.85 hits per line

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

0.0
/src/Result/Explain.php
1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of Aplus Framework Database Library.
4
 *
5
 * (c) Natan Felles <natanfelles@gmail.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Framework\Database\Result;
11

12
/**
13
 * Class Explain.
14
 *
15
 * @see https://mariadb.com/kb/en/explain/
16
 *
17
 * @package database
18
 */
19
readonly class Explain
20
{
21
    /**
22
     * Sequence number that shows in which order tables are joined.
23
     */
24
    public int $id;
25
    /**
26
     * What kind of SELECT the table comes from.
27
     *
28
     * @see https://mariadb.com/kb/en/explain/#select_type-column
29
     */
30
    public string $selectType;
31
    /**
32
     * Alias name of table. Materialized temporary tables for sub queries are
33
     * named <subquery#>.
34
     */
35
    public string $table;
36
    /**
37
     * How rows are found from the table (join type).
38
     *
39
     * @see https://mariadb.com/kb/en/explain/#type-column
40
     */
41
    public string $type;
42
    /**
43
     * keys in table that could be used to find rows in the table.
44
     */
45
    public ?string $possibleKeys;
46
    /**
47
     * The name of the key that is used to retrieve rows. NULL is no key was used.
48
     */
49
    public ?string $key;
50
    /**
51
     * How many bytes of the key that was used (shows if we are using only parts
52
     * of the multi-column key).
53
     */
54
    public ?string $keyLen;
55
    /**
56
     * The reference that is used as the key value.
57
     */
58
    public ?string $ref;
59
    /**
60
     * An estimate of how many rows we will find in the table for each key lookup.
61
     */
62
    public string $rows;
63
    /**
64
     * Extra information about this join.
65
     *
66
     * @see https://mariadb.com/kb/en/explain/#extra-column
67
     */
68
    public string $extra;
69
    /**
70
     * The EXTENDED keyword adds another column, filtered, to the output. This
71
     * is a percentage estimate of the table rows that will be filtered by the
72
     * condition.
73
     *
74
     * @see https://mariadb.com/kb/en/explain/#explain-extended
75
     */
76
    public float $filtered;
77
    /**
78
     * EXPLAIN FORMAT=JSON is a variant of EXPLAIN command that produces output
79
     * in JSON form.
80
     *
81
     * @see https://mariadb.com/kb/en/explain-format-json/
82
     */
83
    public string $explain;
84

85
    public function __construct(\stdClass $result)
86
    {
87
        foreach ((array) $result as $key => $value) {
×
88
            $key = \strtolower($key);
×
89
            $key = \ucwords($key, '_');
×
90
            $key = \strtr($key, ['_' => '']);
×
91
            $key[0] = \strtolower($key[0]);
×
92
            $this->{$key} = $value;
×
93
        }
94
    }
95
}
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