Passed
Push — main ( a015e4...e40688 )
by Sammy
02:05 queued 31s
created

Traceable::after_destroy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 1
eloc 0
c 1
b 1
f 1
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
3
namespace HexMakina\TightORM\Abilities;
4
5
use HexMakina\Tracer\TracerInterface;
0 ignored issues
show
Bug introduced by
The type HexMakina\Tracer\TracerInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
trait Traceable
8
{
9
  abstract public function get_tracer() : TracerInterface;
10
  abstract public function get_id();
11
  abstract public static function table_name();
12
13
14
  public function trace()
15
  {
16
    ;
17
  }
18
19
  public function traceable(): bool
20
  {
21
    return true; // TightORM are traced by default
22
  }
23
24
  public function traces() : array
25
  {
26
    $q = $this->get_tracer()->tracing_table()->select();
27
    $q->aw_fields_eq(['query_table' => get_class($this)::table_name(), 'query_id' => $this->get_id()]);
28
    $q->order_by(['query_on', 'DESC']);
29
    $q->run();
30
    $res = $q->ret_ass();
31
32
    return $res;
33
  }
34
35
  // don't really know the purpose of this anymore.. came from Tracer
36
  public function traces_by_model(ModelInterface $m)
0 ignored issues
show
Bug introduced by
The type HexMakina\TightORM\Abilities\ModelInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
37
  {
38
      return $this->get_tracer()->traces(['id' => $m->get_id(), 'table' => get_class($m)::table_name()]);
39
  }
40
41
  public function after_save()
42
  {
43
    ;
44
  }
45
46
  public function after_destroy()
47
  {
48
    ;
49
  }
50
}
51