Skip to content

Commit 03c4440

Browse files
authored
improve coverge (#60)
1 parent 39137e4 commit 03c4440

File tree

5 files changed

+4
-66
lines changed

5 files changed

+4
-66
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,6 @@ jobs:
9393
9494
- name: Upload coverage reports to Codecov
9595
uses: codecov/codecov-action@v3
96+
if: matrix.php-version == 8.1
9697
env:
9798
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage:
2+
ignore:
3+
- "lib/PhpStan/*"

lib/Reflections.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,6 @@ public function add(string $class): Reflections
3939
return $this;
4040
}
4141

42-
/**
43-
* Destroys the cached ReflectionClass.
44-
*
45-
* Put this here mainly for testing purposes.
46-
*
47-
* @param class-string $class name of a class
48-
*/
49-
public function destroy(string $class): void
50-
{
51-
if (isset($this->reflections[$class])) {
52-
unset($this->reflections[$class]);
53-
}
54-
}
55-
5642
/**
5743
* Get a cached ReflectionClass.
5844
*

lib/Singleton.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,4 @@ final public static function instance(): static
3737
*/
3838
return self::$instances[$class_name] ??= new $class_name();
3939
}
40-
41-
/**
42-
* Singleton objects should not be cloned.
43-
*/
44-
private function __clone()
45-
{
46-
}
4740
}

lib/ValidationErrors.php

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -139,25 +139,6 @@ public function first(string $attribute)
139139
return $this->on($attribute)[0] ?? null;
140140
}
141141

142-
/**
143-
* Returns the internal errors object.
144-
*
145-
* ```
146-
* $model->errors->get_raw_errors();
147-
*
148-
* # [
149-
* # "name" => ["can't be blank"],
150-
* # "state" => ["is the wrong length (should be 2 chars)"],
151-
* # ]
152-
* ```
153-
*
154-
* @return array<string, array<string>>
155-
*/
156-
public function get_raw_errors(): array
157-
{
158-
return $this->errors;
159-
}
160-
161142
/**
162143
* Returns all the error messages as an array.
163144
*
@@ -247,32 +228,6 @@ public function is_empty()
247228
return empty($this->errors);
248229
}
249230

250-
/**
251-
* Clears out all error messages.
252-
*/
253-
public function clear(): void
254-
{
255-
$this->errors = [];
256-
}
257-
258-
/**
259-
* Returns the number of error messages there are.
260-
*/
261-
public function size(): int
262-
{
263-
if ($this->is_empty()) {
264-
return 0;
265-
}
266-
267-
$count = 0;
268-
269-
foreach ($this->errors as $attribute => $error) {
270-
$count += count($error);
271-
}
272-
273-
return $count;
274-
}
275-
276231
/**
277232
* Returns an iterator to the error messages.
278233
*

0 commit comments

Comments
 (0)