oreolek
/
news-script
Archived
1
0
Fork 0

phpstan config

This commit is contained in:
Alexander Yakovlev 2019-05-16 01:27:32 +07:00
parent a453148193
commit fd9f522f46
Signed by: oreolek
GPG Key ID: 1CDC4B7820C93BD3
5 changed files with 16 additions and 15 deletions

8
.phpstan.neon Normal file
View File

@ -0,0 +1,8 @@
parameters:
level: 5
autoload_files:
ignoreErrors:
excludes_analyse:
- vendor/
- vndb-client-php/
- tests/

View File

@ -8,3 +8,6 @@ repos:
- id: php-md - id: php-md
files: \.(php)$ files: \.(php)$
args: ["codesize,controversial,design,naming,unusedcode"] args: ["codesize,controversial,design,naming,unusedcode"]
# - id: php-stan
# files: \.(php)$
# args: ["--configuration=.phpstan.neon"]

View File

@ -33,14 +33,6 @@ $client = new GuzzleClient([
'timeout' => 30, 'timeout' => 30,
]); ]);
/**
* Function to download images.
*
* @return string
*/
function get_file($url) {
}
$api = json_decode(file_get_contents('http://forum.ifiction.ru/extern.php?action=kril2018')); $api = json_decode(file_get_contents('http://forum.ifiction.ru/extern.php?action=kril2018'));
foreach ($api as $category) { foreach ($api as $category) {
$category_title = $category->category; $category_title = $category->category;
@ -81,9 +73,7 @@ foreach ($api as $category) {
$game->url_online = $files[1]->url; $game->url_online = $files[1]->url;
$game->url_online_description = $files[1]->title; $game->url_online_description = $files[1]->title;
} }
if ($game) { $page = new Wikipage($game);
$page = new Wikipage($game); $page->create();
$page->create();
}
} }
} }

View File

@ -33,7 +33,7 @@ $parsers = 'all';
if (PHP_SAPI !== 'cli') { if (PHP_SAPI !== 'cli') {
ob_start(); ob_start();
echo '<!DOCTYPE html><html><body><code><pre>'; echo '<!DOCTYPE html><html><body><code><pre>';
if (isset($_GET) && isset($_GET['parsers'])) { if (isset($_GET['parsers'])) {
$parsers = $_GET['parsers']; $parsers = $_GET['parsers'];
$parsers = explode(',', $parsers); $parsers = explode(',', $parsers);
} }

View File

@ -33,7 +33,7 @@ if (!isset($argv[1])) {
die(); die();
} }
$url = $argv[1]; $url = $argv[1];
$game = new Game; $game = new Game();
function check($classname) { function check($classname) {
global $game; global $game;
@ -54,7 +54,7 @@ function check($classname) {
} }
} }
check ('Urq', 'urq'); check ('Urq');
check ('Qsp'); check ('Qsp');
check ('Kvester'); check ('Kvester');
check ('Apero'); check ('Apero');