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

phpolar / model / 5449748827

pending completion
5449748827

Pull #12

github

web-flow
Merge 068a00ea6 into 190d9e203
Pull Request #12: refactor: use renamed core library

263 of 287 relevant lines covered (91.64%)

7.79 hits per line

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

100.0
/src/Column.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Phpolar\Model;
6

7
;
8

9
use Attribute;
10
use Phpolar\Phpolar\Core\AbstractPropertyNameExtractor;
11
use Phpolar\Phpolar\Core\ColumnConfig;
12
use Phpolar\Phpolar\Core\DefaultColumnName;
13

14
/**
15
 * Provides support for configuring the text for column names in records.
16
 */
17
#[Attribute(Attribute::TARGET_PROPERTY)]
18
final class Column extends AbstractPropertyNameExtractor
19
{
20
    public function __construct(private string|ColumnConfig $arg = ColumnConfig::T_Default)
21
    {
22
    }
4✔
23

24
    /**
25
     * Returns the configured column name.
26
     *
27
     * @api
28
     */
29
    public function getColumnName(): string
30
    {
31
        return match ($this->arg) {
4✔
32
            ColumnConfig::T_Default => (new DefaultColumnName($this->propName))->getColumnName(),
4✔
33
            default => (string) $this->arg
4✔
34
        };
4✔
35
    }
36
}
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