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

valkyrjaio / valkyrja / 20687263522

04 Jan 2026 03:56AM UTC coverage: 74.209%. Remained the same
20687263522

push

github

web-flow
[CI] Add dead code rector rules (#337)

# Description

Add dead code rector rules.

## Types of changes

- [ ] Bug fix _(non-breaking change which fixes an issue)_
    <!-- Target the lowest major affected branch -->
- [X] New feature _(non-breaking change which adds functionality)_
    <!-- Target master -->
- [ ] Deprecation _(breaking change which removes functionality)_
    <!-- Target master -->
- [ ] Breaking change _(fix or feature that would cause existing
functionality
  to change)_
<!-- Target master, unless this is a bug fix in which case let's chat
-->
- [ ] Documentation improvement
    <!-- Target appropriate branch -->

8419 of 11345 relevant lines covered (74.21%)

8.87 hits per line

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

0.0
/src/Valkyrja/Orm/QueryBuilder/SqlUpdateQueryBuilder.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the Valkyrja Framework package.
7
 *
8
 * (c) Melech Mizrachi <melechmizrachi@gmail.com>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13

14
namespace Valkyrja\Orm\QueryBuilder;
15

16
use Override;
17
use Valkyrja\Orm\Constant\Statement;
18
use Valkyrja\Orm\Data\Value;
19
use Valkyrja\Orm\QueryBuilder\Abstract\SqlQueryBuilder;
20
use Valkyrja\Orm\QueryBuilder\Contract\UpdateQueryBuilderContract;
21

22
class SqlUpdateQueryBuilder extends SqlQueryBuilder implements UpdateQueryBuilderContract
23
{
24
    /** @var Value[] */
25
    protected array $values = [];
26

27
    /**
28
     * @inheritDoc
29
     */
30
    #[Override]
×
31
    public function withSet(Value ...$values): static
32
    {
33
        $new = clone $this;
×
34

35
        $new->values = $values;
×
36

37
        return $new;
×
38
    }
39

40
    /**
41
     * @inheritDoc
42
     */
43
    #[Override]
×
44
    public function withAddedSet(Value ...$values): static
45
    {
46
        $new = clone $this;
×
47

48
        $new->values = array_merge($new->values, $values);
×
49

50
        return $new;
×
51
    }
52

53
    /**
54
     * @inheritDoc
55
     */
56
    public function __toString(): string
×
57
    {
58
        return Statement::UPDATE
×
59
            . " $this->from"
×
60
            . $this->getAliasQuery()
×
61
            . $this->getSetQuery()
×
62
            . $this->getWhereQuery()
×
63
            . $this->getJoinQuery();
×
64
    }
65

66
    /**
67
     * Get the SET part of an INSERT query.
68
     */
69
    protected function getSetQuery(): string
×
70
    {
71
        $values = [];
×
72

73
        foreach ($this->values as $value) {
×
74
            $values[] = "$value->name = " . ((string) $value);
×
75
        }
76

77
        return Statement::SET . ' ' . implode(', ', $values);
×
78
    }
79
}
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