Code Duplication    Length = 14-14 lines in 2 locations

tools/update_evidencelist_class.php 1 location

@@ 14-27 (lines=14) @@
11
 * @param FlexiBeeRO $syncer Class to read from FlexiBee
12
 * @return array     Evidence structure
13
 */
14
function getColumnsInfo($evidence, FlexiBeeRO $syncer)
15
{
16
    $useKeywords = [];
17
    $flexinfo    = $syncer->performRequest($evidence.'/properties.json');
18
    if (count($flexinfo) && array_key_exists('properties', $flexinfo)) {
19
        foreach ($flexinfo['properties']['property'] as $evidenceProperty) {
20
            $key                       = $evidenceProperty['propertyName'];
21
            $useKeywords[$key]         = $evidenceProperty;
22
            $useKeywords[$key]['name'] = $evidenceProperty['name'];
23
            $useKeywords[$key]['type'] = $evidenceProperty['type'];
24
        }
25
    }
26
    return $useKeywords;
27
}
28
29
30
echo '<?php

tools/update_properties_class.php 1 location

@@ 14-27 (lines=14) @@
11
 * @param FlexiBeeRO $syncer Class to read from FlexiBee
12
 * @return array     Evidence structure
13
 */
14
function getPropertiesInfo($evidence, FlexiBeeRO $syncer)
15
{
16
    $properties = [];
17
    $flexinfo   = $syncer->performRequest($evidence.'/properties.json');
18
    if (count($flexinfo) && array_key_exists('properties', $flexinfo)) {
19
        foreach ($flexinfo['properties']['property'] as $evidenceProperty) {
20
            $key                      = $evidenceProperty['propertyName'];
21
            $properties[$key]         = $evidenceProperty;
22
            $properties[$key]['name'] = $evidenceProperty['name'];
23
            $properties[$key]['type'] = $evidenceProperty['type'];
24
        }
25
    }
26
    return $properties;
27
}
28
echo '<?php
29
/**
30
 * FlexiPeeHP - Struktura evidenci.