Sum   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSumFromFlexibee() 0 4 2
1
<?php
2
/**
3
 * FlexiPeeHP - Summary support
4
 *
5
 * @author     Vítězslav Dvořák <[email protected]>
6
 * @copyright  (C) 2018-2020 Spoje.Net
7
 */
8
9
namespace FlexiPeeHP;
10
11
/**
12
 * Add for evidencies with Summary support
13
 * @author Vítězslav Dvořák <[email protected]>
14
 */
15
trait Sum
16
{
17
18
    /**
19
     * Vrací z FlexiBee sumaci i podle podmínek.
20
     *
21
     * @param array           $conditions  pole podmínek nebo ID záznamu
22
     *
23
     * @return array
24
     */
25
    public function getSumFromFlexibee($conditions = [])
26
    {
27
        $flexiData = $this->getFlexiData('$sum', $conditions);
0 ignored issues
show
Bug introduced by
It seems like getFlexiData() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        /** @scrutinizer ignore-call */ 
28
        $flexiData = $this->getFlexiData('$sum', $conditions);
Loading history...
28
        return empty($flexiData) ? null : $flexiData['sum'];
29
    }
30
}
31