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

Cecilapp / Cecil / 15789667681

20 Jun 2025 11:43PM UTC coverage: 82.623%. Remained the same
15789667681

push

github

ArnaudLigny
doc: better API doc

3119 of 3775 relevant lines covered (82.62%)

0.83 hits per line

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

71.43
/src/Renderer/Config.php
1
<?php
2

3
/**
4
 * This file is part of Cecil.
5
 *
6
 * (c) Arnaud Ligny <arnaud@ligny.fr>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace Cecil\Renderer;
15

16
use Cecil\Builder;
17

18
/**
19
 * Config renderer class.
20
 *
21
 * This class implements the \ArrayAccess interface to allow access to configuration
22
 * values using array syntax. It retrieves configuration values from the Builder's
23
 * configuration object, allowing for easy access to configuration settings in a
24
 * language-specific context.
25
 */
26
class Config implements \ArrayAccess
27
{
28
    /**
29
     * Builder object.
30
     * @var Builder
31
     */
32
    protected $builder;
33
    /**
34
     * Configuration object.
35
     * @var \Cecil\Config
36
     */
37
    protected $config;
38
    /**
39
     * Current language code.
40
     * @var string
41
     */
42
    protected $language;
43

44
    public function __construct(Builder $builder, string $language)
45
    {
46
        $this->builder = $builder;
1✔
47
        $this->config = $this->builder->getConfig();
1✔
48
        $this->language = $language;
1✔
49
    }
50

51
    /**
52
     * Implement ArrayAccess.
53
     *
54
     * @param mixed $offset
55
     *
56
     * @return bool
57
     */
58
    #[\ReturnTypeWillChange]
59
    public function offsetExists($offset): bool
60
    {
61
        return $this->config->has($offset);
1✔
62
    }
63

64
    /**
65
     * Implements \ArrayAccess.
66
     *
67
     * @param mixed $offset
68
     *
69
     * @return mixed|null
70
     */
71
    #[\ReturnTypeWillChange]
72
    public function offsetGet($offset)
73
    {
74
        return $this->config->get($offset, $this->language);
1✔
75
    }
76

77
    /**
78
     * Implements \ArrayAccess.
79
     *
80
     * @param mixed $offset
81
     * @param mixed $value
82
     *
83
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
84
     */
85
    #[\ReturnTypeWillChange]
86
    public function offsetSet($offset, $value): void
87
    {
88
    }
×
89

90
    /**
91
     * Implements \ArrayAccess.
92
     *
93
     * @param mixed $offset
94
     *
95
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
96
     */
97
    #[\ReturnTypeWillChange]
98
    public function offsetUnset($offset): void
99
    {
100
    }
×
101
}
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