Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: monthly
43 changes: 43 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: PHP Tests

on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
- release/*

jobs:
lint:
name: Lint and Code Style
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3']
os: ['ubuntu-latest']

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

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

- name: Setup dependencies
run: composer require -n --no-progress overtrue/phplint

- name: PHP Lint
if: success() || matrix.allow_failure
run: ./vendor/bin/phplint -n --exclude={^vendor/.*} -- .

- name: PHP CodeSniffer
if: success() || matrix.allow_failure
run: phpcs -wps --colors
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Exclude editor files
.*.sw[op]
*~
/.idea/
\#*
.\#*
*TODO*
!.git*

# PHP artifacts
_icingaweb2/
_libraries/
.phpunit.cache/
.phplint.cache/
reports/
vendor/
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.PHONY: setup lint phpcs

lint:
phplint application/ library/ configuration.php
phpcs:
phpcs application/ library/ configuration.php
2 changes: 0 additions & 2 deletions application/controllers/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Icinga\Module\Grafana\Controllers;


use Icinga\Web\Controller;
use Icinga\Module\Grafana\Forms\Config\GeneralConfigForm;

Expand All @@ -23,4 +22,3 @@ public function indexAction()
$this->view->tabs = $this->Module()->getConfigTabs()->activate('config');
}
}

1 change: 0 additions & 1 deletion application/controllers/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,4 @@ public function indexAction()
$graph = new Grapher();
$this->view->graph = $graph->getPreviewHtml($object);
}

}
6 changes: 2 additions & 4 deletions application/controllers/GraphController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Icinga\Module\Grafana\Controllers;


use Icinga\Exception\NotFoundError;
use Icinga\Forms\ConfirmRemovalForm;
use Icinga\Module\Grafana\Forms\Graph\GraphForm;
Expand All @@ -13,8 +12,8 @@ class GraphController extends Controller
{
public function init()
{
$this->assertPermission('grafana/graphconfig');
}
$this->assertPermission('grafana/graphconfig');
}

/**
* List Grafana graphs
Expand Down Expand Up @@ -109,4 +108,3 @@ public function updateAction()
$this->view->form = $graphs;
}
}

6 changes: 0 additions & 6 deletions application/controllers/IcingadbimgController.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: carst
* Date: 11.03.2018
* Time: 07:18
*/

namespace Icinga\Module\Grafana\Controllers;

Expand Down
Loading