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

nette / application / 20834855301

08 Jan 2026 10:54PM UTC coverage: 84.605% (+1.7%) from 82.856%
20834855301

push

github

dg
added CLAUDE.md

1940 of 2293 relevant lines covered (84.61%)

0.85 hits per line

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

20.0
/src/Application/UI/Link.php
1
<?php
2

3
/**
4
 * This file is part of the Nette Framework (https://nette.org)
5
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6
 */
7

8
declare(strict_types=1);
9

10
namespace Nette\Application\UI;
11

12

13
/**
14
 * Lazy encapsulation of Component::link().
15
 * Do not instantiate directly, use Component::lazyLink()
16
 */
17
final class Link
18
{
19
        public function __construct(
1✔
20
                private readonly Component $component,
21
                private readonly string $destination,
22
                /** @var array<string, mixed> */
23
                private array $params = [],
24
        ) {
25
        }
1✔
26

27

28
        /**
29
         * Returns link component.
30
         */
31
        public function getComponent(): Component
32
        {
33
                return $this->component;
×
34
        }
35

36

37
        /**
38
         * Returns link destination.
39
         */
40
        public function getDestination(): string
41
        {
42
                return $this->destination;
×
43
        }
44

45

46
        /**
47
         * Changes link parameter.
48
         */
49
        public function setParameter(string $key, mixed $value): static
50
        {
51
                $this->params[$key] = $value;
×
52
                return $this;
×
53
        }
54

55

56
        /**
57
         * Returns link parameter.
58
         */
59
        public function getParameter(string $key): mixed
60
        {
61
                return $this->params[$key] ?? null;
×
62
        }
63

64

65
        /**
66
         * Returns link parameters.
67
         * @return array<string, mixed>
68
         */
69
        public function getParameters(): array
70
        {
71
                return $this->params;
×
72
        }
73

74

75
        /**
76
         * Determines whether this links to the current page.
77
         */
78
        public function isLinkCurrent(): bool
79
        {
80
                return $this->component->isLinkCurrent($this->destination, $this->params);
×
81
        }
82

83

84
        /**
85
         * Converts link to URL.
86
         */
87
        public function __toString(): string
88
        {
89
                return $this->component->link($this->destination, $this->params);
×
90
        }
91
}
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