diff --git a/configs/models/Dell-switches.yml b/configs/models/Dell-switches.yml index 638afa0..7ccad71 100644 --- a/configs/models/Dell-switches.yml +++ b/configs/models/Dell-switches.yml @@ -91,7 +91,7 @@ models: oids: - ./oids/dell/ems.yml extra: - console_conn_type: dell + console_conn_type: dell_emc_networking_os modules: parse_interface: \SwitcherCore\Modules\DellSwitch\ParseInterface fdb: \SwitcherCore\Modules\DellSwitch\Fdb @@ -111,7 +111,7 @@ models: multi_console_command: \SwitcherCore\Modules\DellSwitch\MultiRawConsoleCommand lldp_info: \SwitcherCore\Modules\DellSwitch\LldpInfo net_settings: \SwitcherCore\Modules\General\NetSettings - arps: \SwitcherCore\Modules\DellSwitch\ArpInfo + arps: \SwitcherCore\Modules\DellSwitch\ArpInfoEMC bgp_info: \SwitcherCore\Modules\DellSwitch\BgpInfo bgp_peers: \SwitcherCore\Modules\DellSwitch\BgpPeers direct_routes: \SwitcherCore\Modules\DellSwitch\DirectRoutes diff --git a/configs/oids/xos.yml b/configs/oids/xos.yml index d4d1298..5d17d91 100644 --- a/configs/oids/xos.yml +++ b/configs/oids/xos.yml @@ -15,4 +15,8 @@ - {name: extreme.fdbMacExosFdbVlanIfIndex , oid: .1.3.6.1.4.1.1916.1.16.4.1.2} #.1.3.6.1.4.1.1916.1.16.4.1.2.4.141.56.32.98.186.1000006 = INTEGER: 1000006 - {name: extreme.fdbMacExosFdbPortIfIndex , oid: .1.3.6.1.4.1.1916.1.16.4.1.3} #.1.3.6.1.4.1.1916.1.16.4.1.3.4.141.56.32.98.186.1000006 = INTEGER: 1026 - {name: extreme.fdbMacExosFdbStatus, oid: .1.3.6.1.4.1.1916.1.16.4.1.4, values: {1: OTHER, 2: INVALID, 3: LEARNED, 4: SELF, 5: MGMT}} #.1.3.6.1.4.1.1916.1.16.4.1.4.4.141.56.32.98.186.1000006 = INTEGER: 3 -- {name: extreme.vlanIfVlanId, oid: .1.3.6.1.4.1.1916.1.2.1.2.1.10 } # .1.3.6.1.4.1.1916.1.2.1.2.1.10.1000004 = INTEGER: 1 \ No newline at end of file +- {name: extreme.vlanIfVlanId, oid: .1.3.6.1.4.1.1916.1.2.1.2.1.10 } # .1.3.6.1.4.1.1916.1.2.1.2.1.10.1000004 = INTEGER: 1 + +- {name: extreme.vlanIfDescr, oid: .1.3.6.1.4.1.1916.1.2.1.2.1.2 } #vlan name (.1.3.6.1.4.1.1916.1.2.1.2.1.2.1000004 = STRING: "Default") +- {name: extreme.vlanOpaqueTaggedPorts, oid: .1.3.6.1.4.1.1916.1.2.6.1.1.1 } # .1.3.6.1.4.1.1916.1.2.6.1.1.1.1000005.1 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +- {name: extreme.vlanOpaqueUntaggedPorts, oid: .1.3.6.1.4.1.1916.1.2.6.1.1.2 } # .1.3.6.1.4.1.1916.1.2.6.1.1.2.1000005.1 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ No newline at end of file diff --git a/src/Modules/Arista/ArpInfo.php b/src/Modules/Arista/ArpInfo.php index 0eb5ae1..e79bb47 100644 --- a/src/Modules/Arista/ArpInfo.php +++ b/src/Modules/Arista/ArpInfo.php @@ -6,47 +6,55 @@ use SwitcherCore\Modules\AbstractModule; use SwitcherCore\Modules\Helper; -class ArpInfo extends AbstractModule -{ +class ArpInfo extends AbstractModule { use InterfacesTrait; - public function run($params = []) - { - $oid = $this->oids->getOidByName('ip.arp.macAddr')->getOid(); + public function getPrettyFiltered($filter = []) { + return $this->response; + } - $this->response = $this->formatResponse($this->snmp->walk([Oid::init($oid)])); - return $this; + public function getPretty() { + return $this->response; } - public function getPretty() - { - if ($this->response['ip.arp.macAddr']->error()) { - throw new \SNMPException($this->response['ip.arp.macAddr']->error()); + public function run($params = []) { + $cmd = 'show arp'; + if(isset($params['vlan_id']) && intval($params['vlan_id']) > 0 && intval($params['vlan_id']) < 4095) { + $cmd .= ' interface vlan' . $params['vlan_id']; } - $vlanIds = $this->getVlanIdsMap(); - $response = []; - foreach ($this->response['ip.arp.macAddr']->fetchAll() as $mac) { - $ip = Helper::getIndexByOid($mac->getOid(), 3) . "." . - Helper::getIndexByOid($mac->getOid(), 2) . "." . - Helper::getIndexByOid($mac->getOid(), 1) . "." . - Helper::getIndexByOid($mac->getOid()) - ; - $vlanIdIndex = Helper::getIndexByOid($mac->getOid(), 4); - - $response[] = [ - 'mac' => $mac->getHexValue(), - 'ip' => $ip, - 'vlan_id' => isset($vlanIds[$vlanIdIndex]) ? $vlanIds[$vlanIdIndex] : null, - 'interface' => null, - ]; + if(isset($params['ip']) && preg_match('/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/', $params['ip'])) { + $cmd .= ' ' . $params['ip']; } - - return $response; - } - - public function getPrettyFiltered($filter = []) - { - return $this->getPretty(); + if(isset($params['mac'])) { + $mac = Helper::formatMac3Blocks($params['mac']); + $cmd .= ' mac-address ' . $mac; + } + $cmd .= " | json"; + + $res = $this->getModule('console_command')->run(['command' => $cmd])->getPrettyFiltered(); + if(!$res['success']) throw new \Exception("Error while running command {$cmd}"); + + $this->response = []; + $res = json_decode($res['output'], true); + if(isset($res['ipV4Neighbors'])) { + foreach($res['ipV4Neighbors'] as $row) { + $vlan_id = null; + if(preg_match('/vlan(\d{1,4})/i', $row['interface'], $m)) { + $vlan_id = $m[1]; + } + $iface = null; + if(preg_match('/(Ethernet\d{1,3}\/?\d?\d?\d?|Port\-Channel\d{1,3})/', $row['interface'], $m)) { + $iface = $this->parseInterface($m[1], 'name'); + } + $this->response[] = [ + 'interface' => $iface, + 'mac' => Helper::formatMac($row['hwAddress']), + 'ip' => $row['address'], + 'vlan_id' => $vlan_id, + '_age' => (isset($row['age']) ? $row['age'] : null), + ]; + } + } + return $this; } - } \ No newline at end of file diff --git a/src/Modules/DellSwitch/ArpInfo.php b/src/Modules/DellSwitch/ArpInfo.php index ed16323..c3758f5 100644 --- a/src/Modules/DellSwitch/ArpInfo.php +++ b/src/Modules/DellSwitch/ArpInfo.php @@ -2,46 +2,50 @@ namespace SwitcherCore\Modules\DellSwitch; -use SnmpWrapper\Oid; use SwitcherCore\Modules\AbstractModule; use SwitcherCore\Modules\Helper; -class ArpInfo extends AbstractModule -{ +class ArpInfo extends AbstractModule { use InterfacesTrait; - public function run($params = []) - { - $oid = $this->oids->getOidByName('ip.arp.macAddr')->getOid(); - - $this->response = $this->formatResponse($this->snmp->walk([Oid::init($oid)])); - return $this; - } - - public function getPretty() - { - if ($this->response['ip.arp.macAddr']->error()) { - throw new \SNMPException($this->response['ip.arp.macAddr']->error()); + public function run($params = []) { + $cmd = 'show arp'; + if (isset($params['mac'])) { + $mac = Helper::formatMac($params['mac']); + $cmd .= ' macaddress ' . $mac; + } elseif (isset($params['ip']) && preg_match('/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/', $params['ip'])) { + $cmd .= ' ip ' . $params['ip']; + } elseif (isset($params['vlan_id']) && intval($params['vlan_id']) > 0 && intval($params['vlan_id']) < 4095) { + $cmd .= ' interface vlan ' . $params['vlan_id']; } - $vlanIds = $this->getVlanIdsMap(); - $response = []; - foreach ($this->response['ip.arp.macAddr']->fetchAll() as $mac) { - $ip = Helper::getIndexByOid($mac->getOid(), 3) . "." . - Helper::getIndexByOid($mac->getOid(), 2) . "." . - Helper::getIndexByOid($mac->getOid(), 1) . "." . - Helper::getIndexByOid($mac->getOid()) - ; - $vlanIdIndex = Helper::getIndexByOid($mac->getOid(), 4); - - $response[] = [ - 'mac' => $mac->getHexValue(), - 'ip' => $ip, - 'vlan_id' => isset($vlanIds[$vlanIdIndex]) ? $vlanIds[$vlanIdIndex] : null, - 'interface' => null, - ]; + $res = $this->getModule('console_command')->run(['command' => $cmd])->getPrettyFiltered(); + if(!$res['success']) throw new \Exception("Error while running command {$cmd}. output = {$res['output']}"); + $exploded = explode("\n", $res['output']); + $this->response = []; + foreach($exploded as $row) { + if(preg_match('/^.*\s(((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4})\s+(\d{1,6}|\-)\s+(([a-f0-9]{2}\:){5}[a-f0-9]{2})\s+(\-|.*)\s+Vl\s(\d{1,4})/i', $row, $m)) { + $iface = null; + if(preg_match('/^Po\s(\d{1,3})$/', trim($m[8]), $mm)) { + $iface = $this->parseInterface('Port-channel ' . $mm[1], 'name'); + } elseif(preg_match('/^Te\s(\d\/\d+)$/', trim($m[8]), $mm)) { + $iface = $this->parseInterface('TenGigabitEthernet ' . $mm[1], 'name'); + } elseif(preg_match('/^Fo\s(\d\/\d+)$/', trim($m[8]), $mm)) { + $iface = $this->parseInterface('fortyGigE ' . $mm[1], 'name'); + } + $this->response[] = [ + 'interface' => $iface, + 'mac' => Helper::formatMac($m[6]), + 'ip' => $m[1], + 'vlan_id' => $m[9], + '_age' => (($m[5] === '-') ? null : $m[5]), + ]; + } } + return $this; + } - return $response; + public function getPretty() { + return $this->response; } public function getPrettyFiltered($filter = []) diff --git a/src/Modules/DellSwitch/ArpInfoEMC.php b/src/Modules/DellSwitch/ArpInfoEMC.php new file mode 100644 index 0000000..424afca --- /dev/null +++ b/src/Modules/DellSwitch/ArpInfoEMC.php @@ -0,0 +1,48 @@ + 0 && intval($params['vlan_id']) < 4095) { + $cmd .= ' interface vlan' . $params['vlan_id']; + } + $res = $this->getModule('console_command')->run(['command' => $cmd])->getPrettyFiltered(); + if(!$res['success']) throw new \Exception("Error while running command {$cmd}. output = {$res['output']}"); + + $exploded = explode("\n", $res['output']); + $this->response = []; + foreach($exploded as $row) { + if(preg_match('/^(((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4})\s+(([a-f0-9]{2}\:){5}[a-f0-9]{2})\s+vlan(\d{1,4})\s+(port\-channel\d{1,3}|ethernet\d{1,3}\/\d{1,3}\/\d{1,3}\:?\d?\d?\d?)/i', $row, $m)) { + $this->response[] = [ + 'interface' => $this->parseInterface($m[8], 'name'), + 'mac' => Helper::formatMac($m[5]), + 'ip' => $m[1], + 'vlan_id' => $m[7], + ]; + } + } + return $this; + } + + public function getPretty() { + return $this->response; + } + + public function getPrettyFiltered($filter = []) + { + return $this->getPretty(); + } + +} \ No newline at end of file diff --git a/src/Modules/ExtremeXOS/ArpInfo.php b/src/Modules/ExtremeXOS/ArpInfo.php index 2173207..211f124 100644 --- a/src/Modules/ExtremeXOS/ArpInfo.php +++ b/src/Modules/ExtremeXOS/ArpInfo.php @@ -33,12 +33,32 @@ public function run($params = []) * - {name: mac, pattern: '^[a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$', required: no} * - {name: status, pattern: '^(disabled|invalid|OK)$', required: no, values: [disabled, invalid, OK]} */ + $filter_vlan_id = false; + if(isset($params['vlan_id']) && intval($params['vlan_id']) > 0 && intval($params['vlan_id']) < 4097) { + $oids[] = Oid::init($this->oids->getOidByName('extreme.vlanIfDescr')->getOid()); + $oids[] = Oid::init($this->oids->getOidByName('extreme.vlanIfVlanId')->getOid()); + $res = $this->formatResponse($this->snmp->walk($oids)); + + foreach($res['extreme.vlanIfDescr']->fetchAll() as $val) { + $vlan_names[Helper::getIndexByOid($val->getOid())] = $val->getValue(); + } + foreach($res['extreme.vlanIfVlanId']->fetchAll() as $val) { + $vlan_ids[$val->getValue()] = Helper::getIndexByOid($val->getOid()); + } + + if(isset($vlan_names[$vlan_ids[$params['vlan_id']]])) { + $filter_vlan_id = $vlan_names[$vlan_ids[$params['vlan_id']]]; + } + } + $command = "show iparp"; - if(isset($params['ip']) && $params['ip']) { + if($filter_vlan_id) { + $command .= " {$filter_vlan_id}"; + } elseif(isset($params['ip']) && $params['ip']) { $command .= " {$params['ip']}"; - } - if(isset($params['mac']) && $params['mac']) { - $command .= " {$params['mac']}"; + } elseif(isset($params['mac']) && $params['mac']) { + $mac = Helper::formatMac($params['mac']); + $command .= " {$mac}"; } $this->response = $this->console->exec($command); diff --git a/src/Modules/ExtremeXOS/VlanList.php b/src/Modules/ExtremeXOS/VlanList.php index 8e04526..ff4e3bc 100644 --- a/src/Modules/ExtremeXOS/VlanList.php +++ b/src/Modules/ExtremeXOS/VlanList.php @@ -2,40 +2,30 @@ namespace SwitcherCore\Modules\ExtremeXOS; +use SnmpWrapper\Oid; use SwitcherCore\Exceptions\IncompleteResponseException; -use SwitcherCore\Modules\AbstractModule; -use SwitcherCore\Modules\General\Switches\AbstractInterfaces; -use SwitcherCore\Modules\General\Switches\FdbDot1Bridge; use SwitcherCore\Modules\Helper; -class VlanList extends \SwitcherCore\Modules\General\Switches\VlansDot1q -{ +class VlanList extends \SwitcherCore\Modules\General\Switches\VlansDot1q { use InterfacesTrait; - protected function formate() { - $response = []; - $forbidden = $this->getResponseByName('dot1q.VlanStaticForbiddenEgressPorts'); - $untagged = $this->getResponseByName('dot1q.VlanStaticUntaggedPorts'); - $names = $this->getResponseByName('dot1q.VlanStaticName'); - $egress = $this->getResponseByName('dot1q.VlanStaticEgressPorts'); + private $filter_vlan_id = false; - if($names->error()) { - throw new IncompleteResponseException($names->error()); - } - if($egress->error()) { - throw new IncompleteResponseException($egress->error()); - } - if($untagged->error()) { - throw new IncompleteResponseException($untagged->error()); - } - if($forbidden->error()) { - throw new IncompleteResponseException($forbidden->error()); - } + protected function formate() { + $vlan_ids = $this->getResponseByName('extreme.vlanIfVlanId'); + $names = $this->getResponseByName('extreme.vlanIfDescr'); + $tagged = $this->getResponseByName('extreme.vlanOpaqueTaggedPorts'); + $untagged = $this->getResponseByName('extreme.vlanOpaqueUntaggedPorts'); + if($vlan_ids->error()) throw new IncompleteResponseException($vlan_ids->error()); + if($names->error()) throw new IncompleteResponseException($names->error()); + if($untagged->error()) throw new IncompleteResponseException($untagged->error()); + if($tagged->error()) throw new IncompleteResponseException($tagged->error()); $indexes = []; foreach ($this->getInterfacesIds() as $iface) { - $indexes[$iface['id']] = $iface; + $indexes[$iface['_dot1q_id']] = $iface; } + $formater = function ($resp) use ($indexes) { $dex = Helper::hexToBinStr($resp->getHexValue()); $ports = []; @@ -48,26 +38,49 @@ protected function formate() { $response = []; foreach ($names->fetchAll() as $resp) { $response[Helper::getIndexByOid($resp->getOid())]['name'] = $resp->getValue(); - $response[Helper::getIndexByOid($resp->getOid())]['id'] = Helper::getIndexByOid($resp->getOid()); } - - foreach ($egress->fetchAll() as $resp) { - $response[ Helper::getIndexByOid($resp->getOid())]['ports']['egress'] = $formater($resp); + foreach ($vlan_ids->fetchAll() as $resp) { + $response[Helper::getIndexByOid($resp->getOid())]['id'] = $resp->getValue(); } + foreach ($tagged->fetchAll() as $resp) { + $response[Helper::getIndexByOid($resp->getOid(), 1)]['ports']['tagged'] = $formater($resp); + } foreach ($untagged->fetchAll() as $resp) { - $response[ Helper::getIndexByOid($resp->getOid())]['ports']['untagged'] = $formater($resp); + $response[ Helper::getIndexByOid($resp->getOid(), 1)]['ports']['untagged'] = $formater($resp); } - foreach ($forbidden->fetchAll() as $resp) { - $response[ Helper::getIndexByOid($resp->getOid())]['ports']['forbidden'] = $formater($resp); - } - foreach ($response as $vlan_id => $resp) { - foreach ($resp['ports']['egress'] as $port) { - if(in_array($port, $response[$vlan_id]['ports']['untagged'])) continue; - if(in_array($port, $response[$vlan_id]['ports']['forbidden'])) continue; - $response[$vlan_id]['ports']['tagged'][] = $port; - } + foreach ($response as $vlan_if_id => $resp) { + $response[$vlan_if_id]['ports']['egress'] = []; + $response[$vlan_if_id]['ports']['forbidden'] = []; + if(!isset($resp['ports']['tagged'])) $response[$vlan_if_id]['ports']['tagged'] = []; + if(!isset($resp['ports']['untagged'])) $response[$vlan_if_id]['ports']['untagged'] = []; + if($this->filter_vlan_id && $this->filter_vlan_id != $resp['id']) unset($response[$vlan_if_id]); } return array_values($response); } + + function getPretty() { + return $this->formate(); + } + + function getPrettyFiltered($filter = []) { + return $this->getPretty(); + } + + public function run($filter = []) + { + Helper::prepareFilter($filter); + if($filter['vlan_id']) $this->filter_vlan_id = $filter['vlan_id']; + $oids[] = $this->oids->getOidByName('extreme.vlanIfVlanId')->getOid(); + $oids[] = $this->oids->getOidByName('extreme.vlanIfDescr')->getOid(); + $oids[] = $this->oids->getOidByName('extreme.vlanOpaqueTaggedPorts')->getOid(); + $oids[] = $this->oids->getOidByName('extreme.vlanOpaqueUntaggedPorts')->getOid(); + $oidObjects = []; + foreach ($oids as $oid) { + $oidObjects[] = Oid::init($oid); + } + $this->response = $this->formatResponse($this->snmp->walk($oidObjects)); + return $this; + } + } diff --git a/src/Modules/Juniper/ArpInfo.php b/src/Modules/Juniper/ArpInfo.php index a4976b1..ff57892 100644 --- a/src/Modules/Juniper/ArpInfo.php +++ b/src/Modules/Juniper/ArpInfo.php @@ -6,31 +6,38 @@ use SwitcherCore\Modules\AbstractModule; use SwitcherCore\Modules\Helper; -class ArpInfo extends AbstractModule -{ +class ArpInfo extends AbstractModule { use InterfacesTrait; - public function run($params = []) - { - $oid = $this->oids->getOidByName('ip.arp.macAddr')->getOid(); - - $this->response = $this->formatResponse($this->snmp->walk([Oid::init($oid)])); - return $this; - } + public function run($params = []) { + $filter_vlan = false; + $filter_ip = false; + $filter_mac = false; + if(isset($params['vlan_id']) && intval($params['vlan_id']) > 0 && intval($params['vlan_id']) < 4095) { + $filter_vlan = $params['vlan_id']; + } + if(isset($params['ip']) && preg_match('/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/', $params['ip'])) { + $filter_ip = $params['ip']; + } + if(isset($params['mac'])) { + $filter_mac = Helper::formatMac($params['mac']); + } - public function getPretty() - { - $ifaceByVlans = []; - $vlanIds = []; foreach ($this->getInterfacesIds() as $interface) { $ifaceByVlans[$interface['id']] = $interface; if($interface['type'] == "BRIDGE" || $interface['type'] == "LACP") { $vlanIds[$interface['id']] = $interface['_port_num']; + if($filter_vlan && $interface['_port_num'] == $filter_vlan) { + $filter_vlan_index = $interface['id']; + } } if (isset($interface['_iface_vlans'])) { foreach ($interface['_iface_vlans'] as $key => $vlanId) { $ifaceByVlans[$key] = $interface; $vlanIds[$key] = $vlanId; + if($filter_vlan && $vlanId == $filter_vlan) { + $filter_vlan_index = $key; + } } } } @@ -38,33 +45,40 @@ public function getPretty() unset($ifaceInfo['_iface_vlans']); $ifaceByVlans[$iface] = $ifaceInfo; } - - if ($this->response['ip.arp.macAddr']->error()) { - throw new \SNMPException($this->response['ip.arp.macAddr']->error()); + $oid = $this->oids->getOidByName('ip.arp.macAddr')->getOid(); + if($filter_vlan && isset($filter_vlan_index)) { + $oid .= ".{$filter_vlan_index}"; } - $response = []; - foreach ($this->response['ip.arp.macAddr']->fetchAll() as $mac) { - $ip = Helper::getIndexByOid($mac->getOid(), 3) . "." . - Helper::getIndexByOid($mac->getOid(), 2) . "." . - Helper::getIndexByOid($mac->getOid(), 1) . "." . - Helper::getIndexByOid($mac->getOid()) - ; - $vlanIdIndex = Helper::getIndexByOid($mac->getOid(), 4); + if($filter_vlan && isset($filter_vlan_index) && $filter_ip) { + $oid .= ".{$filter_ip}"; + } + $res = $this->formatResponse($this->snmp->walk([Oid::init($oid)])); + + $this->response = []; + foreach($res['ip.arp.macAddr']->fetchAll() as $val) { + $ip = Helper::oid2IP($val->getOid()); + if($filter_ip && $ip !== $filter_ip) continue; + $vlan_index = Helper::getIndexByOid($val->getOid(), 4); + $mac = $val->getHexValue(); + if($filter_mac && $mac !== $filter_mac) continue; - $response[] = [ - 'mac' => $mac->getHexValue(), + $this->response[] = [ + 'interface' => isset($ifaceByVlans[$vlan_index]) ? $ifaceByVlans[$vlan_index] : null, + 'mac' => $mac, 'ip' => $ip, - 'vlan_id' => isset($vlanIds[$vlanIdIndex]) ? (int)$vlanIds[$vlanIdIndex] : null, - 'interface' => isset($ifaceByVlans[$vlanIdIndex]) ? $ifaceByVlans[$vlanIdIndex] : null, - '_raw_iface_id' => $vlanIdIndex, + 'vlan_id' => isset($vlanIds[$vlan_index]) ? $vlanIds[$vlan_index] : null, + '_raw_iface_id' => $vlan_index, ]; + } + return $this; + } - return $response; + public function getPretty() { + return $this->response; } - public function getPrettyFiltered($filter = []) - { + public function getPrettyFiltered($filter = []) { return $this->getPretty(); }