for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* FlexiPeeHP - Custom Report object.
*
* @author Vítězslav Dvořák <[email protected]>
* @copyright (C) 2020 Spoje.Net
*/
namespace FlexiPeeHP;
* Description of Report
* @author vitex
class Report extends RW {
* Evidence užitá objektem.
* Evidence used by object.
* @var string
public $evidence = 'report';
* Načte záznam z FlexiBee a uloží v sobě jeho data
* Read FlexiBee record and store it inside od object
* @param int|string $id ID or conditions
* @return int počet načtených položek
public function loadFromAbraFlexi($id = null) {
if (strstr($id, 'code:')) { //Dirty Hack ⚠ Error 400: Entita 'Report' neobsahuje kód nebo ho nelze použít jako ID (není unikátní)
$candidates = $this->getColumnsFromAbraFlexi(['id', 'kod'], null, 'kod');
if (array_key_exists(\FlexiPeeHP\RO::uncode($id), $candidates)) {
$id = intval($candidates[\FlexiPeeHP\RO::uncode($id)]['id']);
}
return parent::loadFromAbraFlexi($id);
* Update $this->apiURL
public function updateApiURL() {
$code = $this->getDataValue('kod');
$this->unsetDataValue('kod');
$result = parent::updateApiURL();
$result
parent::updateApiURL()
FlexiPeeHP\RO::updateApiURL()
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
class A { function getObject() { return null; } } $a = new A(); $object = $a->getObject();
The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
$this->setDataValue('kod',$code);
return $result;
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.