Spoje-NET /
php-flexibee
| 1 | <?php |
||||
| 2 | |||||
| 3 | /* |
||||
| 4 | * To change this license header, choose License Headers in Project Properties. |
||||
| 5 | * To change this template file, choose Tools | Templates |
||||
| 6 | * and open the template in the editor. |
||||
| 7 | */ |
||||
| 8 | |||||
| 9 | namespace FlexiPeeHP; |
||||
| 10 | |||||
| 11 | /** |
||||
| 12 | * |
||||
| 13 | * @author vitex |
||||
| 14 | */ |
||||
| 15 | trait SubItems { |
||||
| 16 | /** |
||||
| 17 | * Subitems - ex. items of invoice |
||||
| 18 | * |
||||
| 19 | * @return array of document items or null |
||||
| 20 | */ |
||||
| 21 | public function getSubItems() { |
||||
| 22 | return $this->getDataValue($this->getSubmenuName()); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 23 | } |
||||
| 24 | |||||
| 25 | public function setSubitems(array $subitems) { |
||||
| 26 | return $this->setDataValue($this->getSubmenuName(), $subitems); |
||||
|
0 ignored issues
–
show
It seems like
setDataValue() 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
Loading history...
|
|||||
| 27 | } |
||||
| 28 | |||||
| 29 | public function getSubMenuName() { |
||||
| 30 | return array_key_exists('polozkyFaktury', $this->getData()) ? 'polozkyFaktury' : (array_key_exists('polozkyDokladu', $this->getData()) ? 'polozkyDokladu' : null); |
||||
|
0 ignored issues
–
show
It seems like
getData() 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
Loading history...
|
|||||
| 31 | |||||
| 32 | } |
||||
| 33 | |||||
| 34 | } |
||||
| 35 |