Skip to content
Permalink
Browse files

Add buildsystem based on Makefile and integrate php-cs-fixer and phpstan

  • Loading branch information...
decke committed Aug 27, 2019
1 parent 36d1e42 commit a229acc45cb2c8a9dd6bcb3ff4c0404c9859b2be
Showing with 38 additions and 45 deletions.
  1. +21 −0 Makefile
  2. +1 −2 composer.json
  3. +2 −2 index.php
  4. +0 −41 lib/functions.php
  5. +14 −0 phpstan.neon
@@ -0,0 +1,21 @@
all: build

clean:
rm -f .php_cs.cache
rm -rf vendor

vendor:
composer install --dev

build: vendor

test: build
php-cs-fixer fix --dry-run --diff-format udiff index.php
php-cs-fixer fix --dry-run --diff-format udiff lib
vendor/bin/phpstan analyse -l 5 -c phpstan.neon lib index.php

fix:
php-cs-fixer fix index.php
php-cs-fixer fix lib

.PHONY: all clean build test fix
@@ -14,8 +14,7 @@
"autoload": {
"psr-0": {
"FunkFeuer": "lib"
},
"files": ["lib/functions.php"]
}
},
"require-dev": {
"phpstan/phpstan": "^0.11.12"
@@ -126,7 +126,7 @@
$query = '';
if ($request->getParam('lat') && $request->getParam('lng')) {
$query = sprintf('?lat=%lf&lng=%lf', $request->getParam('lat'), $request->getParam('lng'));
$query = sprintf('?lat=%f&lng=%f', $request->getParam('lat'), $request->getParam('lng'));
}
return $this->view->render($response, 'map.html', array(
@@ -302,7 +302,7 @@
/* HACK: Slim-Flash hasMessage('error') does not see messages for next request */
if (!isset($_SESSION['slimFlash']['error'])) {
$node = new node();
$node = new Node();
$node->name = $request->getParam('name');
$node->owner = $session->getUser()->userid;
$node->location = $args['locationid'];

This file was deleted.

@@ -0,0 +1,14 @@
parameters:
inferPrivatePropertyTypeFromConstructor: true
ignoreErrors:
# does not support anonymous classes like Slim is using
-
message: '#Undefined variable: \$this#'
path: %currentWorkingDirectory%/index.php
-
message: '#Using \$this outside a class.#'
path: %currentWorkingDirectory%/index.php
# hack to shut up __get()/__set() usage
-
message: '#Access to an undefined property#'
path: %currentWorkingDirectory%

0 comments on commit a229acc

Please sign in to comment.
You can’t perform that action at this time.