Skip to content

Commit 63d667c

Browse files
authored
a few ignore on untestable code (#1845)
1 parent bc263f6 commit 63d667c

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

app/Eloquent/FixedQueryBuilderTrait.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
6464
try {
6565
// @phpstan-ignore-next-line; due to the Larastan rules set PhpStan falsely assumes we are calling a static method
6666
return parent::where($column, $operator, $value, $boolean);
67+
// @codeCoverageIgnoreStart
6768
} catch (\Throwable $e) {
6869
throw new QueryBuilderException($e);
6970
}
71+
// @codeCoverageIgnoreEnd
7072
}
7173

7274
/**
@@ -86,9 +88,11 @@ public function whereIn($column, $values, $boolean = 'and', $not = false): stati
8688
try {
8789
// @phpstan-ignore-next-line; due to the Larastan rules set PhpStan falsely assumes we are calling a static method
8890
return parent::whereIn($column, $values, $boolean, $not);
91+
// @codeCoverageIgnoreStart
8992
} catch (\Throwable $e) {
9093
throw new QueryBuilderException($e);
9194
}
95+
// @codeCoverageIgnoreEnd
9296
}
9397

9498
/**
@@ -107,9 +111,11 @@ public function whereNotIn($column, $values, $boolean = 'and'): static
107111
try {
108112
// @phpstan-ignore-next-line; due to the Larastan rules set PhpStan falsely assumes we are calling a static method
109113
return parent::whereNotIn($column, $values, $boolean);
114+
// @codeCoverageIgnoreStart
110115
} catch (\Throwable $e) {
111116
throw new QueryBuilderException($e);
112117
}
118+
// @codeCoverageIgnoreEnd
113119
}
114120

115121
/**
@@ -126,9 +132,11 @@ public function select($columns = ['*']): static
126132
try {
127133
// @phpstan-ignore-next-line; due to the Larastan rules set PhpStan falsely assumes we are calling a static method
128134
return parent::select($columns);
135+
// @codeCoverageIgnoreStart
129136
} catch (\Throwable $e) {
130137
throw new QueryBuilderException($e);
131138
}
139+
// @codeCoverageIgnoreEnd
132140
}
133141

134142
/**
@@ -150,9 +158,11 @@ public function join($table, $first, $operator = null, $second = null, $type = '
150158
try {
151159
// @phpstan-ignore-next-line; due to the Larastan rules set PhpStan falsely assumes we are calling a static method
152160
return parent::join($table, $first, $operator, $second, $type, $where);
161+
// @codeCoverageIgnoreStart
153162
} catch (\Throwable $e) {
154163
throw new QueryBuilderException($e);
155164
}
165+
// @codeCoverageIgnoreEnd
156166
}
157167

158168
/**
@@ -175,9 +185,11 @@ public function joinSub($query, $as, $first, $operator = null, $second = null, $
175185
try {
176186
// @phpstan-ignore-next-line; due to the Larastan rules set PhpStan falsely assumes we are calling a static method
177187
return parent::joinSub($query, $as, $first, $operator, $second, $type, $where);
188+
// @codeCoverageIgnoreStart
178189
} catch (\Throwable $e) {
179190
throw new QueryBuilderException($e);
180191
}
192+
// @codeCoverageIgnoreEnd
181193
}
182194

183195
/**
@@ -197,9 +209,11 @@ public function leftJoin($table, $first, $operator = null, $second = null): stat
197209
try {
198210
// @phpstan-ignore-next-line; due to the Larastan rules set PhpStan falsely assumes we are calling a static method
199211
return parent::leftJoin($table, $first, $operator, $second);
212+
// @codeCoverageIgnoreStart
200213
} catch (\Throwable $e) {
201214
throw new QueryBuilderException($e);
202215
}
216+
// @codeCoverageIgnoreEnd
203217
}
204218

205219
/**
@@ -223,9 +237,11 @@ public function orderBy($column, $direction = 'asc'): static
223237
//
224238
// @phpstan-ignore-next-line
225239
return parent::orderBy($column, $direction);
240+
// @codeCoverageIgnoreStart
226241
} catch (\Throwable $e) {
227242
throw new QueryBuilderException($e);
228243
}
244+
// @codeCoverageIgnoreEnd
229245
}
230246

231247
/**
@@ -242,9 +258,11 @@ public function addSelect($column): static
242258
try {
243259
// @phpstan-ignore-next-line; due to the Larastan rules set PhpStan falsely assumes we are calling a static method
244260
return parent::addSelect($column);
261+
// @codeCoverageIgnoreStart
245262
} catch (\Throwable $e) {
246263
throw new QueryBuilderException($e);
247264
}
265+
// @codeCoverageIgnoreEnd
248266
}
249267

250268
/**
@@ -263,8 +281,10 @@ public function orWhere($column, $operator = null, $value = null): static
263281
try {
264282
// @phpstan-ignore-next-line; due to the Larastan rules set PhpStan falsely assumes we are calling a static method
265283
return parent::orWhere($column, $operator, $value);
284+
// @codeCoverageIgnoreStart
266285
} catch (\Throwable $e) {
267286
throw new QueryBuilderException($e);
268287
}
288+
// @codeCoverageIgnoreEnd
269289
}
270290
}

app/Legacy/AdminAuthentication.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public static function loginAsAdmin(string $username, string $password, string $
3030
$db_version_number = $installed_version->getVersion();
3131

3232
// For version up to 4.0.8 the admin password is stored in the settings
33+
/** @codeCoverageIgnore */
3334
if ($db_version_number->toInteger() <= 40008) {
3435
return self::logAsAdminFromConfig($username, $password, $ip);
3536
}
@@ -65,6 +66,8 @@ public static function loginAsAdmin(string $username, string $password, string $
6566
* @param string $ip
6667
*
6768
* @return bool
69+
*
70+
* @codeCoverageIgnore
6871
*/
6972
public static function logAsAdminFromConfig(string $username, string $password, string $ip): bool
7073
{

0 commit comments

Comments
 (0)