diff --git a/assets/config/nextdom.config.php b/assets/config/nextdom.config.php index a7d7d4930..25c72dd70 100644 --- a/assets/config/nextdom.config.php +++ b/assets/config/nextdom.config.php @@ -82,7 +82,6 @@ ), 'cmd' => array( 'generic_type' => array( - 'LIGHT_TOGGLE' => array('name' => 'Lumière Toggle', 'family' => 'Lumière', 'type' => 'Action'), 'LIGHT_STATE' => array('name' => 'Lumière Etat', 'family' => 'Lumière', 'type' => 'Info'), 'LIGHT_ON' => array('name' => 'Lumière Bouton On', 'family' => 'Lumière', 'type' => 'Action'), 'LIGHT_OFF' => array('name' => 'Lumière Bouton Off', 'family' => 'Lumière', 'type' => 'Action'), diff --git a/composer.json b/composer.json index d7e0eb952..92761343b 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,8 @@ }, "require-dev": { "vrana/adminer": "^4.7", - "symfony/var-dumper": "^3.4" + "symfony/var-dumper": "^3.4", + "phpstan/phpstan": "^0.9.3" }, "authors": [ { diff --git a/composer.lock b/composer.lock index 18a9db0d5..9f53e65b6 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,11 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "a258796c0b4b9e27a2da25fcd391cf0e", + "hash": "e157afe5a327b2a879b58a59cc7ade50", + "content-hash": "179d5f22a3cef414c7920b4a4a68b32f", "packages": [ { "name": "bacon/bacon-qr-code", @@ -50,7 +51,7 @@ ], "description": "BaconQrCode is a QR code generator for PHP.", "homepage": "https://github.com/Bacon/BaconQrCode", - "time": "2017-10-17T09:59:25+00:00" + "time": "2017-10-17 09:59:25" }, { "name": "christian-riesen/base32", @@ -92,9 +93,9 @@ "authors": [ { "name": "Christian Riesen", - "role": "Developer", "email": "chris.riesen@gmail.com", - "homepage": "http://christianriesen.com" + "homepage": "http://christianriesen.com", + "role": "Developer" } ], "description": "Base32 encoder/decoder according to RFC 4648", @@ -105,7 +106,7 @@ "encode", "rfc4648" ], - "time": "2018-11-02T09:03:50+00:00" + "time": "2018-11-02 09:03:50" }, { "name": "clue/stream-filter", @@ -157,7 +158,7 @@ "stream_filter_append", "stream_filter_register" ], - "time": "2019-04-09T12:31:48+00:00" + "time": "2019-04-09 12:31:48" }, { "name": "doctrine/cache", @@ -227,7 +228,7 @@ "cache", "caching" ], - "time": "2017-07-22T12:49:21+00:00" + "time": "2017-07-22 12:49:21" }, { "name": "doctrine/inflector", @@ -294,7 +295,7 @@ "singularize", "string" ], - "time": "2017-07-22T12:18:28+00:00" + "time": "2017-07-22 12:18:28" }, { "name": "endroid/qr-code", @@ -363,7 +364,7 @@ "qrcode", "symfony" ], - "time": "2018-05-09T20:26:30+00:00" + "time": "2018-05-09 20:26:30" }, { "name": "guzzlehttp/guzzle", @@ -430,7 +431,7 @@ "rest", "web service" ], - "time": "2019-12-23T11:57:10+00:00" + "time": "2019-12-23 11:57:10" }, { "name": "guzzlehttp/promises", @@ -481,7 +482,7 @@ "keywords": [ "promise" ], - "time": "2016-12-20T10:07:11+00:00" + "time": "2016-12-20 10:07:11" }, { "name": "guzzlehttp/psr7", @@ -552,7 +553,7 @@ "uri", "url" ], - "time": "2019-07-01T23:21:34+00:00" + "time": "2019-07-01 23:21:34" }, { "name": "icewind/smb", @@ -594,7 +595,7 @@ } ], "description": "php wrapper for smbclient and libsmbclient-php", - "time": "2019-08-08T09:42:26+00:00" + "time": "2019-08-08 09:42:26" }, { "name": "icewind/streams", @@ -635,7 +636,7 @@ } ], "description": "A set of generic stream wrappers", - "time": "2019-02-15T12:57:29+00:00" + "time": "2019-02-15 12:57:29" }, { "name": "illuminate/contracts", @@ -679,7 +680,7 @@ ], "description": "The Illuminate Contracts package.", "homepage": "https://laravel.com", - "time": "2018-03-20T15:34:35+00:00" + "time": "2018-03-20 15:34:35" }, { "name": "illuminate/support", @@ -736,7 +737,7 @@ ], "description": "The Illuminate Support package.", "homepage": "https://laravel.com", - "time": "2018-08-10T19:40:01+00:00" + "time": "2018-08-10 19:40:01" }, { "name": "influxdb/influxdb-php", @@ -797,7 +798,7 @@ "influxdb library", "time series" ], - "time": "2019-05-30T00:15:14+00:00" + "time": "2019-05-30 00:15:14" }, { "name": "khanamiryan/qrcode-detector-decoder", @@ -847,7 +848,7 @@ "qr", "zxing" ], - "time": "2017-01-13T09:11:46+00:00" + "time": "2017-01-13 09:11:46" }, { "name": "knplabs/github-api", @@ -914,7 +915,7 @@ "gist", "github" ], - "time": "2019-01-28T19:31:35+00:00" + "time": "2019-01-28 19:31:35" }, { "name": "kylekatarnls/update-helper", @@ -959,7 +960,7 @@ } ], "description": "Update helper", - "time": "2019-07-29T11:03:54+00:00" + "time": "2019-07-29 11:03:54" }, { "name": "league/flysystem", @@ -1043,7 +1044,7 @@ "sftp", "storage" ], - "time": "2020-01-04T16:30:31+00:00" + "time": "2020-01-04 16:30:31" }, { "name": "league/flysystem-webdav", @@ -1090,7 +1091,7 @@ } ], "description": "Flysystem adapter for WebDAV", - "time": "2019-12-13T22:44:03+00:00" + "time": "2019-12-13 22:44:03" }, { "name": "league/oauth2-client", @@ -1157,7 +1158,7 @@ "oauth2", "single sign on" ], - "time": "2018-11-22T18:33:57+00:00" + "time": "2018-11-22 18:33:57" }, { "name": "matthiasmullie/minify", @@ -1217,7 +1218,7 @@ "minifier", "minify" ], - "time": "2019-12-19T07:54:47+00:00" + "time": "2019-12-19 07:54:47" }, { "name": "matthiasmullie/path-converter", @@ -1253,9 +1254,9 @@ "authors": [ { "name": "Matthias Mullie", - "role": "Developer", "email": "pathconverter@mullie.eu", - "homepage": "http://www.mullie.eu" + "homepage": "http://www.mullie.eu", + "role": "Developer" } ], "description": "Relative path converter", @@ -1266,7 +1267,7 @@ "paths", "relative" ], - "time": "2018-10-25T15:19:41+00:00" + "time": "2018-10-25 15:19:41" }, { "name": "monolog/monolog", @@ -1344,7 +1345,7 @@ "logging", "psr-3" ], - "time": "2019-12-20T14:15:16+00:00" + "time": "2019-12-20 14:15:16" }, { "name": "mtdowling/cron-expression", @@ -1389,7 +1390,7 @@ "schedule" ], "abandoned": "dragonmantank/cron-expression", - "time": "2019-12-28T04:23:06+00:00" + "time": "2019-12-28 04:23:06" }, { "name": "myclabs/php-enum", @@ -1434,7 +1435,7 @@ "keywords": [ "enum" ], - "time": "2019-02-04T21:18:49+00:00" + "time": "2019-02-04 21:18:49" }, { "name": "nesbot/carbon", @@ -1495,7 +1496,7 @@ "datetime", "time" ], - "time": "2019-10-14T05:51:36+00:00" + "time": "2019-10-14 05:51:36" }, { "name": "paragonie/constant_time_encoding", @@ -1557,7 +1558,7 @@ "hex2bin", "rfc4648" ], - "time": "2019-11-06T19:20:29+00:00" + "time": "2019-11-06 19:20:29" }, { "name": "paragonie/random_compat", @@ -1606,7 +1607,7 @@ "pseudorandom", "random" ], - "time": "2019-01-03T20:59:08+00:00" + "time": "2019-01-03 20:59:08" }, { "name": "php-http/cache-plugin", @@ -1662,7 +1663,7 @@ "httplug", "plugin" ], - "time": "2019-01-23T16:51:58+00:00" + "time": "2019-01-23 16:51:58" }, { "name": "php-http/client-common", @@ -1723,7 +1724,7 @@ "http", "httplug" ], - "time": "2019-11-18T08:54:36+00:00" + "time": "2019-11-18 08:54:36" }, { "name": "php-http/discovery", @@ -1787,7 +1788,7 @@ "message", "psr7" ], - "time": "2019-02-23T07:42:53+00:00" + "time": "2019-02-23 07:42:53" }, { "name": "php-http/guzzle6-adapter", @@ -1847,7 +1848,7 @@ "Guzzle", "http" ], - "time": "2016-05-10T06:13:32+00:00" + "time": "2016-05-10 06:13:32" }, { "name": "php-http/httplug", @@ -1903,7 +1904,7 @@ "client", "http" ], - "time": "2016-08-31T08:30:17+00:00" + "time": "2016-08-31 08:30:17" }, { "name": "php-http/message", @@ -1975,7 +1976,7 @@ "message", "psr-7" ], - "time": "2018-11-01T09:32:41+00:00" + "time": "2018-11-01 09:32:41" }, { "name": "php-http/message-factory", @@ -2025,7 +2026,7 @@ "stream", "uri" ], - "time": "2015-12-19T14:08:53+00:00" + "time": "2015-12-19 14:08:53" }, { "name": "php-http/promise", @@ -2075,7 +2076,7 @@ "keywords": [ "promise" ], - "time": "2016-01-26T13:27:02+00:00" + "time": "2016-01-26 13:27:02" }, { "name": "pragmarx/google2fa", @@ -2131,7 +2132,7 @@ "Two Factor Authentication", "google2fa" ], - "time": "2019-10-21T17:49:22+00:00" + "time": "2019-10-21 17:49:22" }, { "name": "psr/cache", @@ -2177,7 +2178,7 @@ "psr", "psr-6" ], - "time": "2016-08-06T20:24:11+00:00" + "time": "2016-08-06 20:24:11" }, { "name": "psr/container", @@ -2226,7 +2227,7 @@ "container-interop", "psr" ], - "time": "2017-02-14T16:28:37+00:00" + "time": "2017-02-14 16:28:37" }, { "name": "psr/http-message", @@ -2276,7 +2277,7 @@ "request", "response" ], - "time": "2016-08-06T14:39:51+00:00" + "time": "2016-08-06 14:39:51" }, { "name": "psr/log", @@ -2323,7 +2324,7 @@ "psr", "psr-3" ], - "time": "2019-11-01T11:05:21+00:00" + "time": "2019-11-01 11:05:21" }, { "name": "psr/simple-cache", @@ -2371,7 +2372,7 @@ "psr-16", "simple-cache" ], - "time": "2017-10-23T01:57:42+00:00" + "time": "2017-10-23 01:57:42" }, { "name": "ralouphie/getallheaders", @@ -2411,7 +2412,7 @@ } ], "description": "A polyfill for getallheaders.", - "time": "2016-02-11T07:05:27+00:00" + "time": "2016-02-11 07:05:27" }, { "name": "rbdwllr/reallysimplejwt", @@ -2463,7 +2464,7 @@ "jwt", "tokens" ], - "time": "2018-12-10T17:05:34+00:00" + "time": "2018-12-10 17:05:34" }, { "name": "sabre/dav", @@ -2542,7 +2543,7 @@ "framework", "iCalendar" ], - "time": "2020-01-10T07:52:45+00:00" + "time": "2020-01-10 07:52:45" }, { "name": "sabre/event", @@ -2602,7 +2603,7 @@ "reactor", "signal" ], - "time": "2018-03-05T13:55:47+00:00" + "time": "2018-03-05 13:55:47" }, { "name": "sabre/http", @@ -2658,7 +2659,7 @@ "keywords": [ "http" ], - "time": "2019-11-28T19:35:25+00:00" + "time": "2019-11-28 19:35:25" }, { "name": "sabre/uri", @@ -2708,7 +2709,7 @@ "uri", "url" ], - "time": "2019-09-09T23:00:25+00:00" + "time": "2019-09-09 23:00:25" }, { "name": "sabre/vobject", @@ -2804,7 +2805,7 @@ "xCal", "xCard" ], - "time": "2020-01-14T10:18:45+00:00" + "time": "2020-01-14 10:18:45" }, { "name": "sabre/xml", @@ -2866,7 +2867,7 @@ "dom", "xml" ], - "time": "2019-08-14T15:41:34+00:00" + "time": "2019-08-14 15:41:34" }, { "name": "simplesoftwareio/simple-qrcode", @@ -2927,7 +2928,7 @@ "qrcode", "wrapper" ], - "time": "2017-11-26T15:27:12+00:00" + "time": "2017-11-26 15:27:12" }, { "name": "splitbrain/php-archive", @@ -2981,7 +2982,7 @@ "unzip", "zip" ], - "time": "2018-09-09T12:13:53+00:00" + "time": "2018-09-09 12:13:53" }, { "name": "symfony/cache", @@ -3051,7 +3052,7 @@ "caching", "psr6" ], - "time": "2019-12-01T10:45:41+00:00" + "time": "2019-12-01 10:45:41" }, { "name": "symfony/config", @@ -3115,7 +3116,7 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-12-01T10:45:41+00:00" + "time": "2019-12-01 10:45:41" }, { "name": "symfony/debug", @@ -3171,7 +3172,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2019-10-24T15:33:53+00:00" + "time": "2019-10-24 15:33:53" }, { "name": "symfony/expression-language", @@ -3220,7 +3221,7 @@ ], "description": "Symfony ExpressionLanguage Component", "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "time": "2018-11-11 11:18:13" }, { "name": "symfony/filesystem", @@ -3270,7 +3271,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-11-25T16:36:22+00:00" + "time": "2019-11-25 16:36:22" }, { "name": "symfony/http-foundation", @@ -3324,7 +3325,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-11-28T12:52:59+00:00" + "time": "2019-11-28 12:52:59" }, { "name": "symfony/options-resolver", @@ -3378,7 +3379,7 @@ "configuration", "options" ], - "time": "2018-11-11T11:18:13+00:00" + "time": "2018-11-11 11:18:13" }, { "name": "symfony/polyfill-apcu", @@ -3434,7 +3435,7 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-11-27 13:56:44" }, { "name": "symfony/polyfill-ctype", @@ -3492,7 +3493,7 @@ "polyfill", "portable" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-11-27 13:56:44" }, { "name": "symfony/polyfill-mbstring", @@ -3551,7 +3552,7 @@ "portable", "shim" ], - "time": "2019-11-27T14:18:11+00:00" + "time": "2019-11-27 14:18:11" }, { "name": "symfony/polyfill-php56", @@ -3607,7 +3608,7 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-11-27 13:56:44" }, { "name": "symfony/polyfill-php70", @@ -3666,7 +3667,7 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-11-27 13:56:44" }, { "name": "symfony/polyfill-util", @@ -3718,7 +3719,7 @@ "polyfill", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-11-27 13:56:44" }, { "name": "symfony/property-access", @@ -3779,7 +3780,7 @@ "property path", "reflection" ], - "time": "2018-11-11T11:18:13+00:00" + "time": "2018-11-11 11:18:13" }, { "name": "symfony/routing", @@ -3855,7 +3856,7 @@ "uri", "url" ], - "time": "2019-12-01T08:33:36+00:00" + "time": "2019-12-01 08:33:36" }, { "name": "symfony/translation", @@ -3925,7 +3926,7 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2019-11-23T20:30:33+00:00" + "time": "2019-11-23 20:30:33" }, { "name": "symfony/twig-bridge", @@ -4016,7 +4017,7 @@ ], "description": "Symfony Twig Bridge", "homepage": "https://symfony.com", - "time": "2019-11-30T08:19:08+00:00" + "time": "2019-11-30 08:19:08" }, { "name": "symfony/yaml", @@ -4075,7 +4076,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-10-24T15:33:53+00:00" + "time": "2019-10-24 15:33:53" }, { "name": "touki/ftp", @@ -4114,7 +4115,7 @@ } ], "description": "A fully object oriented library for PHP FTP functions", - "time": "2017-01-04T08:59:38+00:00" + "time": "2017-01-04 08:59:38" }, { "name": "twig/extensions", @@ -4169,7 +4170,7 @@ "i18n", "text" ], - "time": "2018-12-05T18:34:18+00:00" + "time": "2018-12-05 18:34:18" }, { "name": "twig/twig", @@ -4234,10 +4235,873 @@ "keywords": [ "templating" ], - "time": "2019-12-28T07:12:03+00:00" + "time": "2019-12-28 07:12:03" } ], "packages-dev": [ + { + "name": "composer/package-versions-deprecated", + "version": "1.11.99", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855", + "reference": "c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2020-08-25 05:50:16" + }, + { + "name": "jean85/pretty-package-versions", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "e9f4324e88b8664be386d90cf60fbc202e1f7fc9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/e9f4324e88b8664be386d90cf60fbc202e1f7fc9", + "reference": "e9f4324e88b8664be386d90cf60fbc202e1f7fc9", + "shasum": "" + }, + "require": { + "composer/package-versions-deprecated": "^1.8.0", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A wrapper for ocramius/package-versions to get pretty versions strings", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "time": "2020-06-23 06:23:06" + }, + { + "name": "nette/bootstrap", + "version": "v2.4.6", + "source": { + "type": "git", + "url": "https://github.com/nette/bootstrap.git", + "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/bootstrap/zipball/268816e3f1bb7426c3a4ceec2bd38a036b532543", + "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543", + "shasum": "" + }, + "require": { + "nette/di": "~2.4.7", + "nette/utils": "~2.4", + "php": ">=5.6.0" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "latte/latte": "~2.2", + "nette/application": "~2.3", + "nette/caching": "~2.3", + "nette/database": "~2.3", + "nette/forms": "~2.3", + "nette/http": "~2.4.0", + "nette/mail": "~2.3", + "nette/robot-loader": "^2.4.2 || ^3.0", + "nette/safe-stream": "~2.2", + "nette/security": "~2.3", + "nette/tester": "~2.0", + "tracy/tracy": "^2.4.1" + }, + "suggest": { + "nette/robot-loader": "to use Configurator::createRobotLoader()", + "tracy/tracy": "to use Configurator::enableTracy()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "? Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", + "homepage": "https://nette.org", + "keywords": [ + "bootstrapping", + "configurator", + "nette" + ], + "time": "2018-05-17 12:52:20" + }, + { + "name": "nette/di", + "version": "v2.4.16", + "source": { + "type": "git", + "url": "https://github.com/nette/di.git", + "reference": "2d5c53d74ae4e65dc943a212d849e30bef011a4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/di/zipball/2d5c53d74ae4e65dc943a212d849e30bef011a4e", + "reference": "2d5c53d74ae4e65dc943a212d849e30bef011a4e", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "nette/neon": "^2.3.3 || ~3.0.0", + "nette/php-generator": "^2.6.1 || ^3.0.0", + "nette/utils": "^2.5.0 || ~3.0.0", + "php": ">=5.6.0" + }, + "conflict": { + "nette/bootstrap": "<2.4", + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.", + "homepage": "https://nette.org", + "keywords": [ + "compiled", + "di", + "dic", + "factory", + "ioc", + "nette", + "static" + ], + "time": "2019-11-19 18:25:17" + }, + { + "name": "nette/finder", + "version": "v2.4.2", + "source": { + "type": "git", + "url": "https://github.com/nette/finder.git", + "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/finder/zipball/ee951a656cb8ac622e5dd33474a01fd2470505a0", + "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0", + "shasum": "" + }, + "require": { + "nette/utils": "~2.4", + "php": ">=5.6.0" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "~2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "? Nette Finder: find files and directories with an intuitive API.", + "homepage": "https://nette.org", + "keywords": [ + "filesystem", + "glob", + "iterator", + "nette" + ], + "time": "2018-06-28 11:49:23" + }, + { + "name": "nette/neon", + "version": "v3.0.1", + "source": { + "type": "git", + "url": "https://github.com/nette/neon.git", + "reference": "5674a266495125d43d9fb58d6663b98bd827fa81" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/neon/zipball/5674a266495125d43d9fb58d6663b98bd827fa81", + "reference": "5674a266495125d43d9fb58d6663b98bd827fa81", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "ext-json": "*", + "php": ">=7.0" + }, + "require-dev": { + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🍸 Nette NEON: encodes and decodes NEON file format.", + "homepage": "https://ne-on.org", + "keywords": [ + "export", + "import", + "neon", + "nette", + "yaml" + ], + "time": "2020-03-04 11:45:23" + }, + { + "name": "nette/php-generator", + "version": "v3.0.5", + "source": { + "type": "git", + "url": "https://github.com/nette/php-generator.git", + "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/php-generator/zipball/ea90209c2e8a7cd087b2742ca553c047a8df5eff", + "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff", + "shasum": "" + }, + "require": { + "nette/utils": "^2.4.2 || ~3.0.0", + "php": ">=7.0" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "? Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.2 features.", + "homepage": "https://nette.org", + "keywords": [ + "code", + "nette", + "php", + "scaffolding" + ], + "time": "2018-08-09 14:32:27" + }, + { + "name": "nette/robot-loader", + "version": "v3.1.1", + "source": { + "type": "git", + "url": "https://github.com/nette/robot-loader.git", + "reference": "3e8d75d6d976e191bdf46752ca40a286671219d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/robot-loader/zipball/3e8d75d6d976e191bdf46752ca40a286671219d2", + "reference": "3e8d75d6d976e191bdf46752ca40a286671219d2", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "nette/finder": "^2.3 || ^3.0", + "nette/utils": "^2.4 || ^3.0", + "php": ">=5.6.0" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "? Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", + "homepage": "https://nette.org", + "keywords": [ + "autoload", + "class", + "interface", + "nette", + "trait" + ], + "time": "2019-03-01 20:23:02" + }, + { + "name": "nette/utils", + "version": "v2.5.4", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "b343b5749f8c2daa0d15f30380ccdba0579c2ed1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/b343b5749f8c2daa0d15f30380ccdba0579c2ed1", + "reference": "b343b5749f8c2daa0d15f30380ccdba0579c2ed1", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "~2.0", + "tracy/tracy": "^2.3" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize() and toAscii()", + "ext-intl": "for script transliteration in Strings::webalize() and toAscii()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-xml": "to use Strings::length() etc. when mbstring is not available" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/loader.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "time": "2019-11-19 00:32:02" + }, + { + "name": "nikic/php-parser", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2018-02-28 20:30:58" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "0.2", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "02f909f134fe06f0cd4790d8627ee24efbe84d6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/02f909f134fe06f0cd4790d8627ee24efbe84d6a", + "reference": "02f909f134fe06f0cd4790d8627ee24efbe84d6a", + "shasum": "" + }, + "require": { + "php": "~7.0" + }, + "require-dev": { + "consistence/coding-standard": "^2.0.0", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "phing/phing": "^2.16.0", + "phpstan/phpstan": "^0.9", + "phpunit/phpunit": "^6.3", + "slevomat/coding-standard": "^3.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "time": "2018-01-13 18:19:41" + }, + { + "name": "phpstan/phpstan", + "version": "0.9.3", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "884091282ad055da6ba86b5455be2d043922d882" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/884091282ad055da6ba86b5455be2d043922d882", + "reference": "884091282ad055da6ba86b5455be2d043922d882", + "shasum": "" + }, + "require": { + "jean85/pretty-package-versions": "^1.0.3", + "nette/bootstrap": "^2.4 || ^3.0", + "nette/di": "^2.4.7 || ^3.0", + "nette/robot-loader": "^3.0.1", + "nette/utils": "^2.4.5 || ^3.0", + "nikic/php-parser": "^3.1", + "php": "~7.0", + "phpstan/phpdoc-parser": "^0.2", + "symfony/console": "~3.2 || ~4.0", + "symfony/finder": "~3.2 || ~4.0" + }, + "require-dev": { + "consistence/coding-standard": "2.2.1", + "ext-gd": "*", + "ext-intl": "*", + "ext-mysqli": "*", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "phing/phing": "^2.16.0", + "phpstan/phpstan-php-parser": "^0.9", + "phpstan/phpstan-phpunit": "^0.9.3", + "phpstan/phpstan-strict-rules": "^0.9", + "phpunit/phpunit": "^6.5.4", + "slevomat/coding-standard": "4.0.0" + }, + "bin": [ + "bin/phpstan" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.9-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": [ + "src/", + "build/PHPStan" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "time": "2020-01-07 15:01:00" + }, + { + "name": "symfony/console", + "version": "v3.4.43", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "afc7189694d2c59546cf24ea606a236fa46a966e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/afc7189694d2c59546cf24ea606a236fa46a966e", + "reference": "afc7189694d2c59546cf24ea606a236fa46a966e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2020-07-06 08:57:31" + }, + { + "name": "symfony/finder", + "version": "v3.4.43", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "5ec813ccafa8164ef21757e8c725d3a57da59200" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/5ec813ccafa8164ef21757e8c725d3a57da59200", + "reference": "5ec813ccafa8164ef21757e8c725d3a57da59200", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2020-02-14 07:34:21" + }, { "name": "symfony/var-dumper", "version": "v3.4.36", @@ -4305,7 +5169,7 @@ "debug", "dump" ], - "time": "2019-10-10T11:03:19+00:00" + "time": "2019-10-10 11:03:19" }, { "name": "vrana/adminer", @@ -4343,7 +5207,7 @@ "keywords": [ "database" ], - "time": "2019-11-13T07:17:14+00:00" + "time": "2019-11-13 07:17:14" } ], "aliases": [], @@ -4352,6 +5216,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { + "ext-json": "*", "ext-curl": "*" }, "platform-dev": [] diff --git a/core/class/DB.class.php b/core/class/DB.class.php index 9e6feefca..1b1e1fc33 100644 --- a/core/class/DB.class.php +++ b/core/class/DB.class.php @@ -25,6 +25,10 @@ class DB const FETCH_TYPE_ROW = 0; const FETCH_TYPE_ALL = 1; + /** + * @return mixed + * @throws \NextDom\Exceptions\CoreException + */ public static function getLastInsertId() { return DBHelper::getLastInsertId(); @@ -35,6 +39,14 @@ public static function getConnection() return DBHelper::getConnection(); } + /** + * @param $_procName + * @param $_params + * @param $_fetch_type + * @param null $_className + * @param null $_fetch_opt + * @return mixed + */ public static function &CallStoredProc($_procName, $_params, $_fetch_type, $_className = NULL, $_fetch_opt = NULL) { return self::CallStoredProc($_procName, $_params, $_fetch_type, $_className, $_fetch_opt); @@ -84,11 +96,13 @@ public static function refresh($target) * Retourne une liste d'objets ou un objet en fonction de filtres * @param array $_filters Filtres à appliquer * @param $_object Objet sur lequel appliquer les filtres - * @return Objet ou liste d'objets correspondant à la requête + * @return array ou liste d'objets correspondant à la requête + * @throws ReflectionException + * @throws \NextDom\Exceptions\CoreException */ public static function getWithFilter(array $_filters, $_object) { - return self::getWithFilter($_filters, $_object); + return DBHelper::getWithFilter($_filters, $_object); } /** @@ -97,12 +111,18 @@ public static function getWithFilter(array $_filters, $_object) * @param object $target * @return boolean * @throws \NextDom\Exceptions\CoreException + * @throws ReflectionException */ public static function remove($target) { return DBHelper::remove($target); } + /** + * @param $_table + * @return mixed + * @throws \NextDom\Exceptions\CoreException + */ public static function checksum($_table) { return DBHelper::checksum($_table); @@ -114,6 +134,7 @@ public static function checksum($_table) * @param object $target * @return boolean * @throws \NextDom\Exceptions\CoreException + * @throws ReflectionException */ public static function lock($target) { @@ -122,11 +143,25 @@ public static function lock($target) /*************************DB ANALYZER***************************/ + /** + * @param $_class + * @param string $_prefix + * @return string + * @throws ReflectionException + */ public static function buildField($_class, $_prefix = '') { return DBHelper::buildField($_class, $_prefix); } + /** + * @param $_database + * @param string $_table + * @param false $_verbose + * @param int $_loop + * @return bool + * @throws Exception + */ public static function compareAndFix($_database, $_table = 'all', $_verbose = false, $_loop = 0) { return DBHelper::compareAndFix($_database, $_table, $_verbose, $_loop); diff --git a/core/class/scenario.class.php b/core/class/scenario.class.php index 82bd3ac3b..7f337736d 100644 --- a/core/class/scenario.class.php +++ b/core/class/scenario.class.php @@ -111,6 +111,7 @@ public static function byTrigger($_cmd_id, $_onlyEnable = true) * * @param mixed $_element_id * @return mixed + * @throws Exception */ public static function byElement($_element_id) { @@ -123,6 +124,7 @@ public static function byElement($_element_id) * @param mixed $_onlyEnable * @param mixed $_onlyVisible * @return mixed + * @throws Exception */ public static function byObjectId($_object_id, $_onlyEnable = true, $_onlyVisible = false) { @@ -134,6 +136,7 @@ public static function byObjectId($_object_id, $_onlyEnable = true, $_onlyVisibl * @param mixed $_event * @param mixed $_forceSyncMode * @return boolean + * @throws Exception */ public static function check($_event = null, $_forceSyncMode = false) { @@ -152,7 +155,7 @@ public static function control() */ public static function doIn($_options) { - ScenarioManager::doIn($_options, __FILE__); + ScenarioManager::doIn($_options); } /** diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/cleaningDb.php b/scripts/cleaningDb.php index 9966558cc..c8f71c382 100644 --- a/scripts/cleaningDb.php +++ b/scripts/cleaningDb.php @@ -62,7 +62,7 @@ foreach (CmdManager::all() as $cmd) { if (!is_object($cmd->getEqLogic())) { echo 'Remove cmd because no eqLogic found : ' . $cmd->getHumanName() . "\n"; - $cmd->remove(true); + $cmd->remove(); continue; } echo 'Cleaning cmd : ' . $cmd->getHumanName() . "\n"; @@ -95,7 +95,7 @@ continue; } } - $cmd->save(true); + $cmd->save(); } foreach (EqLogicManager::all() as $eqLogic) { @@ -172,4 +172,4 @@ echo $e->getMessage(); } -echo "[END CLEANING]\n"; \ No newline at end of file +echo "[END CLEANING]\n"; diff --git a/scripts/sick.php b/scripts/sick.php index ebed76fa9..87b9c52e0 100644 --- a/scripts/sick.php +++ b/scripts/sick.php @@ -63,7 +63,7 @@ try { require_once $install_dir . "/core/php/core.inc.php"; echo "OK\n"; -} catch (\Exeption $e) { +} catch (\Exception $e) { echo "ERREUR\n"; echo "Impossible de charger l'environnement de NextDom : " . $e->getMessage(); echo "\n"; @@ -105,11 +105,11 @@ $user = (new \user()) ->setLogin('admin') ->setPassword(sha512('admin')) - ->setProfils('admin', 1); + ->setProfils('admin'); $user->save(); echo "OK (admin/admin)\n"; } -} catch (Exeption $e) { +} catch (\Exception $e) { echo "ERREUR\n"; echo "Description : " . $e->getMessage(); echo "\n"; diff --git a/src/Ajax/CmdAjax.php b/src/Ajax/CmdAjax.php index e8dd90b61..d5907c018 100644 --- a/src/Ajax/CmdAjax.php +++ b/src/Ajax/CmdAjax.php @@ -374,6 +374,7 @@ public function changeHistoryPoint() * * @throws CoreException * @throws \ReflectionException + * @throws \Exception */ public function getHistory() { @@ -491,7 +492,7 @@ public function getHistory() $data[] = $infoHistory; } } else { - $histories = HistoryManager::getHistoryFromCalcul(NextDomHelper::fromHumanReadable($cmdId), $dateStart, $dateEnd, Utils::init('allowZero', false), Utils::init(AjaxParams::GROUPING_TYPE)); + $histories = HistoryManager::getHistoryFromCalcul(NextDomHelper::fromHumanReadable($cmdId), $dateStart, $dateEnd, Utils::init('allowZero', false)); if (is_array($histories)) { foreach ($histories as $datetime => $value) { $infoHistory = []; diff --git a/src/Ajax/NextDomAjax.php b/src/Ajax/NextDomAjax.php index b44906d22..c97b1311c 100644 --- a/src/Ajax/NextDomAjax.php +++ b/src/Ajax/NextDomAjax.php @@ -55,6 +55,7 @@ class NextDomAjax extends BaseAjax * Get documentation link * * @throws CoreException + * @throws \Exception */ public function getDocumentationUrl() { diff --git a/src/Ajax/PlanAjax.php b/src/Ajax/PlanAjax.php index b7e00ecda..7e5189915 100644 --- a/src/Ajax/PlanAjax.php +++ b/src/Ajax/PlanAjax.php @@ -30,6 +30,7 @@ use NextDom\Model\DataClass\UploadedImage; use NextDom\Model\Entity\Plan; use NextDom\Model\Entity\PlanHeader; +use NextDom\Helpers\FileSystemHelper; /** * Class PlanAjax @@ -271,7 +272,6 @@ public function uploadImage() * Upload image for static picture on plan * * @throws CoreException - * @throws \ReflectionException */ public function uploadImagePlan() { diff --git a/src/Ajax/UserAjax.php b/src/Ajax/UserAjax.php index 6460a4a52..02abad421 100644 --- a/src/Ajax/UserAjax.php +++ b/src/Ajax/UserAjax.php @@ -120,6 +120,12 @@ public function getApikey() $this->ajax->success(UserManager::getStoredUser()->getHash()); } + /** + * @throws CoreException + * @throws \PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException + * @throws \PragmaRX\Google2FA\Exceptions\InvalidCharactersException + * @throws \PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException + */ public function validateTwoFactorCode() { AuthentificationHelper::init(); @@ -128,7 +134,7 @@ public function validateTwoFactorCode() if ($currentUser !== null) { @session_start(); $currentUser->refresh(); - $result = $currentUser->validateTwoFactorCode(Utils::init(AjaxParams::CODE), ''); + $result = $currentUser->validateTwoFactorCode(Utils::init(AjaxParams::CODE)); if ($result && Utils::init('enableTwoFactorAuthentification') == 1) { $currentUser->setOptions(UserOption::TWO_FACTOR_AUTH, 1); $currentUser->save(); @@ -359,4 +365,4 @@ public function supportAccess() UserManager::supportAccess(Utils::init(AjaxParams::ENABLE)); $this->ajax->success(); } -} \ No newline at end of file +} diff --git a/src/Api/jeeApi.php b/src/Api/jeeApi.php index 00741b995..38a4f53b4 100644 --- a/src/Api/jeeApi.php +++ b/src/Api/jeeApi.php @@ -243,7 +243,7 @@ if (init('value') == '') { $dataStore = dataStore::byTypeLinkIdKey('scenario', -1, trim(init('name'))); if (is_object($dataStore)) { - echo $dataStore->getValue($_default); + echo $dataStore->getValue(); } } else { $dataStore = new dataStore(); @@ -400,7 +400,7 @@ if (is_object($_USER_GLOBAL) && $_USER_GLOBAL->getProfils() != 'admin') { throw new Exception(__('Vous n\'êtes pas autorisé à effectuer cette action ', __FILE__) . $jsonrpc->getMethod(), -32001); } - jeedom::update('', 0); + jeedom::update(''); $jsonrpc->makeSuccess('ok'); } @@ -1026,7 +1026,7 @@ } if ($jsonrpc->getMethod() == 'update::update') { - jeedom::update('', 0); + jeedom::update(''); $jsonrpc->makeSuccess('ok'); } diff --git a/src/Api/jeedom_functions.php b/src/Api/jeedom_functions.php index 7c1ef133a..0cedf7dc2 100644 --- a/src/Api/jeedom_functions.php +++ b/src/Api/jeedom_functions.php @@ -72,7 +72,10 @@ function resizeImage($contents, $width, $height) return Utils::resizeImage($contents, $width, $height); } -function getmicrotime() +/** + * @return float + */ +function getmicrotime(): float { return Utils::getMicrotime(); } @@ -98,18 +101,22 @@ function mySqlIsHere() } /** - * @param $e + * @param throwable $e * @return string * @throws Exception - * @deprecated see displayException */ -function displayExeption($e) +function displayExeption(\Throwable $e) { //@trigger_error('La fonction displayExeption devient displayException', E_USER_DEPRECATED); return Utils::displayException($e); } -function displayException($e) +/** + * @param $e + * @return string + * @throws Exception + */ +function displayException(\Throwable $e) { return Utils::displayException($e); } diff --git a/src/Api/proApi.php b/src/Api/proApi.php index f326f6234..668a692c2 100755 --- a/src/Api/proApi.php +++ b/src/Api/proApi.php @@ -649,7 +649,7 @@ } if ($jsonrpc->getMethod() == 'jeeNetwork::update') { - nextdom::update('', 0); + nextdom::update(''); $jsonrpc->makeSuccess('ok'); } @@ -733,7 +733,7 @@ } if ($jsonrpc->getMethod() == 'backup::restoreMarket') { - repo_market::backup_restore($params['backup'], true); + repo_market::backup_restore($params['backup']); $jsonrpc->makeSuccess(); } @@ -823,7 +823,7 @@ } if ($jsonrpc->getMethod() == 'update::update') { - nextdom::update('', 0); + nextdom::update(''); $jsonrpc->makeSuccess('ok'); } diff --git a/src/Api/start_cron.php b/src/Api/start_cron.php index 7a1566d2f..c861b9563 100644 --- a/src/Api/start_cron.php +++ b/src/Api/start_cron.php @@ -40,8 +40,8 @@ use NextDom\Managers\CronManager; use NextDom\Model\Entity\Cron; -const MAX_DURATION_TIME = 59; -const GARBAGE_COLLECTOR_LIMIT = 30; +define('MAX_DURATION_TIME', 59); +define('GARBAGE_COLLECTOR_LIMIT', 30); require_once __DIR__ . "/../../src/core.php"; @@ -68,10 +68,10 @@ function setCronErrorAndDie($cron, $msg, $startTime) /** * Set cron error on exception * - * @param Cron $cron Cron object + * @param Cron $cron Cron object * @param \Exception $e Exception informations - * @param string $logChannel Target log channel - * @param int $startTime Start time of the cron + * @param string $logChannel Target log channel + * @param int $startTime Start time of the cron * @throws \Exception */ function setCronErrorOnException($cron, $e, $logChannel, $startTime) @@ -197,7 +197,7 @@ function startCronTargetFunction($cron, $option, $startTime) * * @param int $cronId Id of the cron * @throws CoreException - * @throws \ReflectionException + * @throws \Exception */ function startSingleCron($cronId) { @@ -233,6 +233,7 @@ function startSingleCron($cronId) /** * Start all crons jobs + * @throws \Exception */ function startAllCrons() { diff --git a/src/Controller/Pages/AdministrationController.php b/src/Controller/Pages/AdministrationController.php index ecf8a8433..a507ebddc 100644 --- a/src/Controller/Pages/AdministrationController.php +++ b/src/Controller/Pages/AdministrationController.php @@ -126,7 +126,7 @@ function ($value) { return $value !== ''; } ) - ); + ); if ($memData[1] != 0) { $pageData['memoryLoad'] = round(100 * $memData[2] / $memData[1], 2); if ($memData[1] < 1024) { diff --git a/src/Helpers/DnsHelper.php b/src/Helpers/DnsHelper.php index 68524b675..e2ded60b6 100644 --- a/src/Helpers/DnsHelper.php +++ b/src/Helpers/DnsHelper.php @@ -28,28 +28,10 @@ public static function dnsCreate() try { $plugin = PluginManager::byId('openvpn'); if (!is_object($plugin)) { - $update = UpdateManager::byLogicalId('openvpn'); - if (!is_object($update)) { - $update = new Update(); - } - $update->setLogicalId('openvpn'); - $update->setSource('market'); - $update->setConfiguration('version', 'stable'); - $update->save(); - $update->doUpdate(); - $plugin = PluginManager::byId('openvpn'); + $plugin = self::updateOpenVpn(); } } catch (CoreException $e) { - $update = UpdateManager::byLogicalId('openvpn'); - if (!is_object($update)) { - $update = new Update(); - } - $update->setLogicalId('openvpn'); - $update->setSource('market'); - $update->setConfiguration('version', 'stable'); - $update->save(); - $update->doUpdate(); - $plugin = PluginManager::byId('openvpn'); + $plugin = self::updateOpenVpn(); } if (!is_object($plugin)) { throw new CoreException(__('Le plugin OpenVPN doit être installé')); @@ -244,4 +226,23 @@ public static function dns2Stop() return; } -} \ No newline at end of file + /** + * @return mixed|\NextDom\Model\Entity\Plugin + * @throws CoreException + * @throws \Throwable + */ + private static function updateOpenVpn() + { + $update = UpdateManager::byLogicalId('openvpn'); + if (!is_object($update)) { + $update = new Update(); + } + $update->setLogicalId('openvpn') + ->setSource('market') + ->setConfiguration('version', 'stable'); + $update->save(); + $update->doUpdate(); + return PluginManager::byId('openvpn'); + } + +} diff --git a/src/Helpers/FileSystemHelper.php b/src/Helpers/FileSystemHelper.php index a7c2ec51a..0ab4220c5 100644 --- a/src/Helpers/FileSystemHelper.php +++ b/src/Helpers/FileSystemHelper.php @@ -599,7 +599,7 @@ public static function createZip($source_arr, $destination, $_excludes = []) throw new CoreException('Extension php ZIP non chargée'); } $zip = new \ZipArchive(); - if (!$zip->open($destination, \ZIPARCHIVE::CREATE)) { + if (!$zip->open($destination, \ZipArchive::CREATE)) { throw new CoreException('Impossible de créer l\'archive ZIP dans le dossier de destination : ' . $destination); } foreach ($source_arr as $source) { diff --git a/src/Helpers/SystemHelper.php b/src/Helpers/SystemHelper.php index 95665a49b..83bc8802b 100755 --- a/src/Helpers/SystemHelper.php +++ b/src/Helpers/SystemHelper.php @@ -17,6 +17,7 @@ namespace NextDom\Helpers; +use NextDom\Exceptions\CoreException; /** * Class SystemHelper * @package NextDom\Helpers @@ -439,7 +440,7 @@ public static function getArch() } return $arch; } - + public static function getInstalledPackages($packagesManager) { if (isset(self::$_installPackage[$packagesManager])) { diff --git a/src/Helpers/TranslateHelper.php b/src/Helpers/TranslateHelper.php index 147f78770..6c1c71b00 100755 --- a/src/Helpers/TranslateHelper.php +++ b/src/Helpers/TranslateHelper.php @@ -174,7 +174,7 @@ public static function exec(string $content, string $filename = '', bool $backsl * @return mixed * @throws \Exception */ - public static function getTranslation($language): array + public static function getTranslation(): array { // Test si les traductions ont été mises en cache if (!self::$translationLoaded) { diff --git a/src/Helpers/Utils.php b/src/Helpers/Utils.php index b8c5472e5..e8f3e3c8a 100644 --- a/src/Helpers/Utils.php +++ b/src/Helpers/Utils.php @@ -780,7 +780,7 @@ public static function strToHex($string): string $hexCode = dechex($ord); $hex .= substr('0' . $hexCode, -2); } - return strToUpper($hex); + return strtoupper($hex); } /** @@ -1266,10 +1266,8 @@ public static function endsWith($haystack, $needle) * @param bool $ignoreDarkColor * @return array|string */ - public function getDominantColor($pathImg, $level = null, $ignoreDarkColor = false) + public static function getDominantColor($pathImg, $level = null, $ignoreDarkColor = false) { - - $colors = []; $i = imagecreatefromjpeg($pathImg); $imagesX = imagesx($i); diff --git a/src/Managers/CacheManager.php b/src/Managers/CacheManager.php index 40910e69a..8645ecd37 100755 --- a/src/Managers/CacheManager.php +++ b/src/Managers/CacheManager.php @@ -34,6 +34,7 @@ namespace NextDom\Managers; +use Doctrine\Common\Cache\FilesystemCache; use NextDom\Com\ComShell; use NextDom\Enums\CacheEngine; use NextDom\Enums\CacheKey; @@ -129,7 +130,7 @@ public static function stats($details = false) * * @param string $targetFolder Target folder * - * @return \Doctrine\Common\Cache\FilesystemCache + * @return FilesystemCache * * @throws \Exception */ @@ -137,13 +138,13 @@ public static function getDoctrineCache(string $targetFolder = '') { if ($targetFolder === '') { $targetFolder = self::getFolder(); } - return new \Doctrine\Common\Cache\FilesystemCache($targetFolder); + return new FilesystemCache($targetFolder); } /** * Get cache system * - * @return \Doctrine\Common\Cache\FilesystemCache|\Doctrine\Common\Cache\MemcachedCache|\Doctrine\Common\Cache\RedisCache|null Cache system + * @return FilesystemCache|\Doctrine\Common\Cache\MemcachedCache|\Doctrine\Common\Cache\RedisCache|null Cache system * @throws \Exception */ public static function getCache() @@ -228,6 +229,7 @@ public static function exists($key) /** * Clear cache + * @throws \Exception */ public static function flush() { @@ -246,14 +248,13 @@ public static function search(): array /** * Persist cache system + * @throws \Exception */ public static function persist() { switch (ConfigManager::byKey(CacheKey::CACHE_ENGINE)) { - case CacheEngine::FILESYSTEM: - $cacheDir = self::getFolder(); - break; case CacheEngine::PHPFILE: + case CacheEngine::FILESYSTEM: $cacheDir = self::getFolder(); break; default: @@ -437,19 +438,22 @@ public static function byKey($key) } return $cache; } - + + /** + * @throws \Exception + */ public static function flushWidget() { foreach (EqLogicManager::all() as $eqLogic) { try { $eqLogic->emptyCacheWidget(); - } catch (Exception $e) { + } catch (\Exception $e) { } } foreach (ScenarioManager::all() as $scenario) { try { $scenario->emptyCacheWidget(); - } catch (Exception $e) { + } catch (\Exception $e) { } } diff --git a/src/Model/Entity/Cmd.php b/src/Model/Entity/Cmd.php index 31a7a7f57..e5afdc02a 100644 --- a/src/Model/Entity/Cmd.php +++ b/src/Model/Entity/Cmd.php @@ -395,7 +395,7 @@ public function getHumanName($useTag = false, $prettify = false) } /** - * @param $_name + * @param $name * @return $this */ public function setName($name) @@ -612,6 +612,7 @@ public function setValue($_value) * @return bool * @throws CoreException * @throws \ReflectionException + * @throws \Exception */ public function save() { @@ -779,12 +780,13 @@ public function setIsHistorized($_isHistorized) } /** - * @param $_value - * @param bool $_allowDuring + * @param $_value + * @param bool $_allowDuring * @param string $_checkLevel * @return int|string * @throws CoreException * @throws \ReflectionException + * @throws \Exception */ public function checkAlertLevel($_value, $_allowDuring = true, $_checkLevel = 'none') { @@ -804,12 +806,12 @@ public function checkAlertLevel($_value, $_allowDuring = true, $_checkLevel = 'n if ($currentLevel != $this->getCache('alertLevel')) { if (!is_object($cron)) { if (!($currentLevel == 'warning' && $this->getCache('alertLevel') == 'danger')) { - $cron = new Cron(); - $cron->setClass(NextDomObj::CMD); - $cron->setFunction('duringAlertLevel'); - $cron->setOnce(1); - $cron->setOption([Common::CMD_ID => intval($this->getId()), 'level' => $currentLevel]); - $cron->setSchedule(CronManager::convertDateToCron($next)); + $cron = (new Cron()) + ->setClass(NextDomObj::CMD) + ->setFunction('duringAlertLevel') + ->setOnce(1) + ->setOption([Common::CMD_ID => intval($this->getId()), 'level' => $currentLevel]) + ->setSchedule(CronManager::convertDateToCron($next)); $cron->setLastRun(date(DateFormat::FULL)); $cron->save(); } else { //je suis en condition de warning et le cron n'existe pas mais j'etais en danger, je suppose que le cron a expiré @@ -869,6 +871,7 @@ public function setAlert($_key, $_value) * @param $_value * @throws CoreException * @throws \ReflectionException + * @throws \Exception */ public function actionAlertLevel($_level, $_value) { @@ -959,11 +962,12 @@ public function setUnite($_unite) } /** - * @param $eventValue + * @param $eventValue * @param null $_datetime - * @param int $eventLoop + * @param int $eventLoop * @throws CoreException * @throws \ReflectionException + * @throws \Exception */ public function event($eventValue, $_datetime = null, $eventLoop = 1) { @@ -1094,10 +1098,10 @@ public function setValueDate($_valueDate) public function addHistoryValue($_value, $_datetime = '') { if ($this->getIsHistorized() == 1 && ($_value == null || ($_value !== '' && $this->isType(CmdType::INFO) && $_value <= $this->getConfiguration(CmdConfigKey::MAX_VALUE, $_value) && $_value >= $this->getConfiguration(CmdConfigKey::MIN_VALUE, $_value)))) { - $history = new History(); - $history->setCmd_id($this->getId()); - $history->setValue($_value); - $history->setDatetime($_datetime); + $history =( new History()) + ->setCmd_id($this->getId()) + ->setValue($_value) + ->setDatetime($_datetime); $history->save($this); } } @@ -1116,10 +1120,10 @@ public function checkReturnState($_value) if (!is_object($cron)) { $cron = new cron(); } - $cron->setClass(NextDomObj::CMD); - $cron->setFunction('returnState'); - $cron->setOnce(1); - $cron->setOption([Common::CMD_ID => intval($this->getId())]); + $cron->setClass(NextDomObj::CMD) + ->setFunction('returnState') + ->setOnce(1) + ->setOption([Common::CMD_ID => intval($this->getId())]); $next = strtotime('+ ' . ($this->getConfiguration(CmdConfigKey::RETURN_STATE_TIME) + 1) . ' minutes ' . date(DateFormat::FULL)); $cron->setSchedule(CronManager::convertDateToCron($next)); $cron->setLastRun(date(DateFormat::FULL)); @@ -1131,6 +1135,7 @@ public function checkReturnState($_value) * @param $_value * @throws CoreException * @throws \ReflectionException + * @throws \Exception */ public function checkCmdAlert($_value) { @@ -1153,11 +1158,11 @@ public function checkCmdAlert($_value) return; } } - $cron->setClass(NextDomObj::CMD); - $cron->setFunction('cmdAlert'); - $cron->setOnce(1); - $cron->setOption([Common::CMD_ID => intval($this->getId())]); - $cron->setSchedule(CronManager::convertDateToCron($next)); + $cron->setClass(NextDomObj::CMD) + ->setFunction('cmdAlert') + ->setOnce(1) + ->setOption([Common::CMD_ID => intval($this->getId())]) + ->setSchedule(CronManager::convertDateToCron($next)); $cron->setLastRun(date(DateFormat::FULL)); $cron->save(); } else { @@ -1308,7 +1313,7 @@ public function getHtml($_key = '', $_default = '') */ public function setHtml($_key, $_value) { - if (in_array($_key, [CmdViewType::DASHBOARD, CmdViewType::DVIEW, CmdViewType::MVIEW, CmdViewType::DPLAN]) && $this->getWidgetTemplateCode($_key, true) == $_value) { + if (in_array($_key, [CmdViewType::DASHBOARD, CmdViewType::DVIEW, CmdViewType::MVIEW, CmdViewType::DPLAN]) && $this->getWidgetTemplateCode($_key) == $_value) { $_value = ''; } if ($this->getHtml($_key) != $_value) { @@ -1323,7 +1328,6 @@ public function setHtml($_key, $_value) * TODO: Déplacer dans CmdManager ??? * * @param string $viewVersion - * @param bool $_noCustom * @return array|bool|mixed|null|string * @throws \Exception */ @@ -1404,7 +1408,6 @@ public function getWidgetTemplateCode($viewVersion = CmdViewType::DASHBOARD) } } } - $templateCode = ''; if (!isset(self::$_templateArray[$templateVersion . '::' . $templateName])) { $templateCode = FileSystemHelper::getCoreTemplateFileContent($templateVersion, $templateName); if (empty($templateCode)) { diff --git a/src/Model/Entity/ScenarioSubElement.php b/src/Model/Entity/ScenarioSubElement.php index eac6f32c8..13211375b 100644 --- a/src/Model/Entity/ScenarioSubElement.php +++ b/src/Model/Entity/ScenarioSubElement.php @@ -116,7 +116,7 @@ public function getExpression() if (is_array($this->_expression) && count($this->_expression) > 0) { return $this->_expression; } - $this->_expression = ScenarioExpressionManager::byscenarioSubElementId($this->getId()); + $this->_expression = ScenarioExpressionManager::byScenarioSubElementId($this->getId()); return $this->_expression; } diff --git a/src/Model/Entity/User.php b/src/Model/Entity/User.php index 2c622eb3a..ccb0c1a72 100644 --- a/src/Model/Entity/User.php +++ b/src/Model/Entity/User.php @@ -189,8 +189,12 @@ public function isConnected() } /** - * @param string $_code - * @return bool + * @param $twoFactorCode + * @return bool|int + * @throws CoreException + * @throws \PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException + * @throws \PragmaRX\Google2FA\Exceptions\InvalidCharactersException + * @throws \PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException */ public function validateTwoFactorCode($twoFactorCode) { diff --git a/src/Model/Entity/Widget.php b/src/Model/Entity/Widget.php index e89a0f964..8a6982a4a 100644 --- a/src/Model/Entity/Widget.php +++ b/src/Model/Entity/Widget.php @@ -41,6 +41,8 @@ class Widget extends BaseEntity { const TABLE_NAME = NextDomObj::WIDGET; + private $filtres; + use NameEntity, TypeEntity, SubTypeEntity, @@ -119,7 +121,7 @@ public function setTest($_test) { } public function preInsert() { - + } public function preSave() { @@ -128,6 +130,11 @@ public function preSave() { } } + /** + * @throws CoreException + * @throws ReflectionException + * @throws \Exception + */ public function preUpdate() { $widget = WidgetManager::byId($this->getId()); if ($widget->getName() != $this->getName()) { @@ -140,11 +147,11 @@ public function preUpdate() { if ($cmd->getTemplate('mobile') == 'custom::' . $widget->getName()) { $cmd->setTemplate('mobile', 'custom::' . $this->getName()); } - $cmd->save(true); + $cmd->save(); } } } - if ($widget->getType() != $this->getType() || $widget->getSubType() != $this->getSubType()) { + if ($widget->getType() != $this->getType() || $widget->getSubtype() != $this->getSubtype()) { $usedBy = $widget->getUsedBy(); if (is_array($usedBy) && count($usedBy) > 0) { foreach ($usedBy as $cmd) { @@ -154,7 +161,7 @@ public function preUpdate() { if ($cmd->getTemplate('mobile') == 'custom::' . $widget->getName()) { $cmd->setTemplate('mobile', 'default'); } - $cmd->save(true); + $cmd->save(); } } } @@ -170,14 +177,15 @@ public function getFiltres($_key = '', $_default = '') { } /** - * @param $_key - * @param $_value + * @param $key + * @param $value * @return $this */ - public function setFiltres($_key, $_value) { - $filtres = Utils::setJsonAttr($this->filtres, $_key, $_value); - $this->updateChangeState($this->filtres, $filtres); - $this->filtres = $filtres; + public function setFiltres($key, $value) + { + $filters = Utils::setJsonAttr($this->filtres, $key, $value); + $this->updateChangeState($this->filtres, $filters); + $this->filtres = $filters; return $this; } @@ -191,7 +199,11 @@ public function save() { return true; } - public function postSave() { + /** + * @throws \Exception + */ + public function postSave() + { $usedBy = $this->getUsedBy(); if (is_array($usedBy) && count($usedBy) > 0) { foreach ($usedBy as $cmd) { @@ -203,11 +215,19 @@ public function postSave() { } } - public function preRemove() { - + public function preRemove() + { + } - public function remove() { + /** + * @return bool|void + * @throws CoreException + * @throws ReflectionException + * @throws \Exception + */ + public function remove() + { $usedBy = $this->getUsedBy(); if (is_array($usedBy) && count($usedBy) > 0) { foreach ($usedBy as $cmd) { @@ -217,15 +237,16 @@ public function remove() { if ($cmd->getTemplate('mobile') == 'custom::' . $this->getName()) { $cmd->setTemplate('mobile', 'default'); } - $cmd->save(true); + $cmd->save(); } } DBHelper::remove($this); } /** - * + * * @return Cmd[] + * @throws \Exception */ public function getUsedBy() { return array_merge( @@ -234,11 +255,13 @@ public function getUsedBy() { ); } - public function postRemove() { + public function postRemove() + { //WidgetManager::cleanWidget(); } - public function emptyTest() { + public function emptyTest() + { $this->test = null; } @@ -274,7 +297,7 @@ public function getLinkData(&$_data = ['node' => [], 'link' => []], $_level = 0, 'texty' => -14, 'textx' => 0, 'title' => $this->getHumanName(), - 'url' => 'index.php?v=d&p=widget&id=' . $this->getId(), + 'url' => 'index.php?' . http_build_query([ 'v' => 'd', 'p' => 'widget', 'id' => $this->getId() ]), ]; return null; } diff --git a/src/Repo/RepoMarket.php b/src/Repo/RepoMarket.php index e9c26e9a9..c2477a551 100644 --- a/src/Repo/RepoMarket.php +++ b/src/Repo/RepoMarket.php @@ -817,6 +817,11 @@ public static function backup_list() return array_reverse($backupList); } + /** + * @param $_backup + * @throws CoreException + * @throws \Exception + */ public static function backup_restore($_backup) { $backup_dir = calculPath(ConfigManager::byKey('backup::path')); @@ -909,14 +914,21 @@ public static function cron5() } } + /** + * @throws CoreException + * @throws \Exception + */ public static function sendHealth(){ $market = self::getJsonRpc(); - if (!$market->sendRequest('register::health', ['health' => SystemHealth::health()])) { + if (!$market->sendRequest('register::health', ['health' => NextDomHelper::health()])) { throw new CoreException($market->getError(), $market->getErrorCode()); } } - public static function monitoring_status() + /** + * @return bool + */ + public static function monitoring_status(): bool { if (!file_exists('/etc/zabbix/zabbix_agentd.conf')) { return false; @@ -927,6 +939,10 @@ public static function monitoring_status() return (count(SystemHelper::ps('zabbix')) > 0); } + /** + * @return bool + * @throws \Exception + */ public static function monitoring_allow() { if (ConfigManager::byKey('market::monitoringServer') == '') {