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

ICanBoogie / Common / 6398009159

03 Oct 2023 08:19PM UTC coverage: 45.965% (+1.6%) from 44.407%
6398009159

push

github

olvlvl
Use named parameters for exceptions

26 of 26 new or added lines in 7 files covered. (100.0%)

131 of 285 relevant lines covered (45.96%)

2.28 hits per line

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

0.0
/lib/PropertyNotReadable.php
1
<?php
2

3
/*
4
 * This file is part of the ICanBoogie package.
5
 *
6
 * (c) Olivier Laviale <olivier.laviale@gmail.com>
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
namespace ICanBoogie;
13

14
use LogicException;
15
use Throwable;
16

17
/**
18
 * Exception thrown when a property is not readable.
19
 *
20
 * For example, this could be triggered when a private property is read from a public scope.
21
 */
22
class PropertyNotReadable extends LogicException implements PropertyError
23
{
24
    public function __construct(
25
        public readonly string $property,
26
        public readonly object $container,
27
        string $message = null,
28
        Throwable $previous = null
29
    ) {
30
        $message ??= sprintf(
×
31
            "The property '%s' for object of class '%s is not readable.",
×
32
            $property,
×
33
            $container::class
×
34
        );
×
35

36
        parent::__construct($message, previous:  $previous);
×
37
    }
38
}
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