• 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/Abstract/SqlQueryBuilder.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\Abstract;
15

16
use Override;
17
use Valkyrja\Orm\Constant\Statement;
18
use Valkyrja\Orm\Data\Join;
19
use Valkyrja\Orm\Data\Where;
20
use Valkyrja\Orm\Data\WhereGroup;
21
use Valkyrja\Orm\QueryBuilder\Contract\QueryBuilderContract as Contract;
22

23
abstract class SqlQueryBuilder implements Contract
24
{
25
    /** @var string */
26
    protected string $alias = '';
27
    /** @var Join[] */
28
    protected array $joins = [];
29
    /** @var array<Where|WhereGroup> */
30
    protected array $where = [];
31

32
    /**
33
     * @param non-empty-string $from The table
34
     */
35
    public function __construct(
×
36
        protected string $from,
37
    ) {
38
    }
×
39

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

48
        $new->from = $table;
×
49

50
        return $new;
×
51
    }
52

53
    /**
54
     * @inheritDoc
55
     */
56
    #[Override]
×
57
    public function withAlias(string $alias): static
58
    {
59
        $new = clone $this;
×
60

61
        $new->alias = $alias;
×
62

63
        return $new;
×
64
    }
65

66
    /**
67
     * @inheritDoc
68
     */
69
    #[Override]
×
70
    public function withJoin(Join ...$joins): static
71
    {
72
        $new = clone $this;
×
73

74
        $new->joins = $joins;
×
75

76
        return $new;
×
77
    }
78

79
    /**
80
     * @inheritDoc
81
     */
82
    #[Override]
×
83
    public function withAddedJoin(Join ...$joins): static
84
    {
85
        $new = clone $this;
×
86

87
        $new->joins = array_merge($new->joins, $joins);
×
88

89
        return $new;
×
90
    }
91

92
    #[Override]
×
93
    public function withWhere(Where|WhereGroup ...$where): static
94
    {
95
        $new = clone $this;
×
96

97
        $new->where = $where;
×
98

99
        return $new;
×
100
    }
101

102
    #[Override]
×
103
    public function withAddedWhere(Where|WhereGroup ...$where): static
104
    {
105
        $new = clone $this;
×
106

107
        $new->where = array_merge($new->where, $where);
×
108

109
        return $new;
×
110
    }
111

112
    /**
113
     * Get the alias of a query statement.
114
     */
115
    protected function getAliasQuery(): string
×
116
    {
117
        return $this->alias === ''
×
118
            ? ''
×
119
            : " $this->alias";
×
120
    }
121

122
    /**
123
     * Get the where of a query statement.
124
     */
125
    protected function getWhereQuery(): string
×
126
    {
127
        return empty($this->where)
×
128
            ? ''
×
129
            : ' ' . Statement::WHERE . ' ' . implode(' ', $this->where);
×
130
    }
131

132
    /**
133
     * Get the joins of a query statement.
134
     */
135
    protected function getJoinQuery(): string
×
136
    {
137
        return empty($this->joins)
×
138
            ? ''
×
139
            : ' ' . implode(' ', $this->joins);
×
140
    }
141
}
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