Make admin_audit strict

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
pull/8769/head
Roeland Jago Douma 8 years ago
parent f08bc1bc6f
commit 4d5830c4aa
No known key found for this signature in database
GPG Key ID: F941078878347C0C
  1. 1
      apps/admin_audit/appinfo/app.php
  2. 5
      apps/admin_audit/lib/Actions/Action.php
  3. 7
      apps/admin_audit/lib/Actions/AppManagement.php
  4. 1
      apps/admin_audit/lib/Actions/Auth.php
  5. 3
      apps/admin_audit/lib/Actions/Console.php
  6. 1
      apps/admin_audit/lib/Actions/Files.php
  7. 1
      apps/admin_audit/lib/Actions/GroupManagement.php
  8. 1
      apps/admin_audit/lib/Actions/Sharing.php
  9. 5
      apps/admin_audit/lib/Actions/Trashbin.php
  10. 1
      apps/admin_audit/lib/Actions/UserManagement.php
  11. 5
      apps/admin_audit/lib/Actions/Versions.php
  12. 1
      apps/admin_audit/lib/AppInfo/Application.php

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2016 Bjoern Schiessle <bjoern@schiessle.org>
* @copyright Copyright (c) 2017 Lukas Reschke <lukas@statuscode.ch>

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch>
*
@ -45,10 +46,10 @@ class Action {
* @param array $elements
* @param bool $obfuscateParameters
*/
public function log($text,
public function log(string $text,
array $params,
array $elements,
$obfuscateParameters = false) {
bool $obfuscateParameters = false) {
foreach($elements as $element) {
if(!isset($params[$element])) {
if ($obfuscateParameters) {

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
*
@ -28,7 +29,7 @@ class AppManagement extends Action {
/**
* @param string $appName
*/
public function enableApp($appName) {
public function enableApp(string $appName) {
$this->log('App "%s" enabled',
['app' => $appName],
['app']
@ -39,7 +40,7 @@ class AppManagement extends Action {
* @param string $appName
* @param string[] $groups
*/
public function enableAppForGroups($appName, array $groups) {
public function enableAppForGroups(string $appName, array $groups) {
$this->log('App "%s" enabled for groups: %s',
['app' => $appName, 'groups' => implode(', ', $groups)],
['app', 'groups']
@ -49,7 +50,7 @@ class AppManagement extends Action {
/**
* @param string $appName
*/
public function disableApp($appName) {
public function disableApp(string $appName) {
$this->log('App "%s" disabled',
['app' => $appName],
['app']

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch>
*

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
*
@ -28,7 +29,7 @@ class Console extends Action {
/**
* @param $arguments
*/
public function runCommand($arguments) {
public function runCommand(array $arguments) {
if ($arguments[1] === '_completion') {
// Don't log autocompletion
return;

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch>
*

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2016 Bjoern Schiessle <bjoern@schiessle.org>
*

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch>
*

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2016 Bjoern Schiessle <bjoern@schiessle.org>
*
@ -27,13 +28,13 @@ namespace OCA\AdminAudit\Actions;
class Trashbin extends Action {
public function delete($params) {
public function delete(array $params) {
$this->log('File "%s" deleted from trash bin.',
['path' => $params['path']], ['path']
);
}
public function restore($params) {
public function restore(array $params) {
$this->log('File "%s" restored from trash bin.',
['path' => $params['filePath']], ['path']
);

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch>
*

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Bjoern Schiessle <bjoern@schiessle.org>
*
@ -27,7 +28,7 @@ namespace OCA\AdminAudit\Actions;
class Versions extends Action {
public function rollback($params) {
public function rollback(array $params) {
$this->log('Version "%s" of "%s" was restored.',
[
'version' => $params['revision'],
@ -37,7 +38,7 @@ class Versions extends Action {
);
}
public function delete($params) {
public function delete(array $params) {
$this->log('Version "%s" was deleted.',
['path' => $params['path']],
['path']

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
*

Loading…
Cancel
Save