Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/php-syntax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: PHP Syntax

on:
pull_request:
push:
branches:
- develop

permissions:
contents: read

concurrency:
group: php-syntax-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: PHP ${{ matrix.php }} syntax
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: none
coverage: none

- name: Show PHP version
run: php -v

- name: Guard against corrupted refactor patterns
run: |
set -euo pipefail
if grep -R -n -E '\b(is_|in_|call_user_func_|port_list_to_|mactrack_display_|mactrack_device_action_)\[' --include='*.php' .; then
echo "Detected corrupted call-pattern rewrite(s)." >&2
exit 1
fi

- name: Lint PHP files
run: |
set -euo pipefail
git ls-files '*.php' | while IFS= read -r f; do
php -l "$f"
done
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
# +-------------------------------------------------------------------------+

locales/po/*.mo
.omc/
2 changes: 2 additions & 0 deletions images/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions includes/database.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_3com.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_aruba_oscx.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_cabletron.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_cisco.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_dell.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_dlink.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_enterasys.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_enterasys_N7.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_extreme.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_foundry.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_functions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_h3c_3com.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_hp.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_hp_ng.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_hp_ngi.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_juniper.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_linux.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_norbay.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_norbay_ng.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_tplink.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_trendnet.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions lib/mactrack_vendors.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions locales/LC_MESSAGES/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions locales/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions locales/po/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_actions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_ajax.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_ajax_admin.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
6 changes: 3 additions & 3 deletions mactrack_convert.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,15 @@ function mactrack_create_partitioned_table($engine = 'InnoDB', $charset, $collat
SELECT *
FROM mac_track_ports_backups
WHERE scan_date = ?',
array($sd['scan_date']));
[$sd['scan_date']]);

db_execute_prepared('DELETE FROM mac_track_ports_backup
WHERE scan_date = ?',
array($sd['scan_date']));
[$sd['scan_date']]);
}
}
*/
db_execute('INSERT mac_track_ports SELECT * FROM mac_track_ports_backup');
db_execute_prepared('INSERT INTO mac_track_ports SELECT * FROM mac_track_ports_backup');
}

db_execute('DROP TABLE mac_track_ports_backup');
Expand Down
2 changes: 2 additions & 0 deletions mactrack_device_types.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_devices.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_import_ouidb.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_macauth.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_macwatch.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_resolver.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_scanner.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_sites.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_snmp.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_utilities.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_vendormacs.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_view_arp.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_view_devices.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
2 changes: 2 additions & 0 deletions mactrack_view_dot1x.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types = 1);
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down
Loading
Loading