Skip to content

Commit

Permalink
adjust php-cs-fixer format
Browse files Browse the repository at this point in the history
  • Loading branch information
kmvan committed Dec 30, 2023
1 parent 5f0e2c5 commit b72ff53
Show file tree
Hide file tree
Showing 40 changed files with 240 additions and 248 deletions.
29 changes: 1 addition & 28 deletions .php-cs-fixer54.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,9 @@
'array_indentation' => true,
'array_syntax' => array('syntax' => 'long'),
'backtick_to_shell_exec' => true,
'binary_operator_spaces' => array('default' => 'align_single_space_minimal'),
// 'binary_operator_spaces' => array('default' => 'align_single_space_minimal'),
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => array(
'statements' => array(
'break',
'case',
'continue',
'declare',
'default',
'do',
'exit',
'for',
'foreach',
'goto',
'if',
'include',
'include_once',
'require',
'require_once',
'return',
'switch',
'throw',
'try',
'while',
'yield',
'yield_from',
),
),
'braces' => true,
'cast_spaces' => true,
'class_attributes_separation' => true,
Expand Down Expand Up @@ -82,7 +56,6 @@
'function_to_constant' => true,
'function_typehint_space' => true,
'global_namespace_import' => true,
// // 'heredoc_indentation' => false,
'heredoc_to_nowdoc' => true,
'implode_call' => true,
'include' => true,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@types/react-dom": "^18.2.18",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"core-js": "^3.34.0",
"css-loader": "^6.8.1",
"deep-sort-object": "^1.0.2",
"eslint": "^8.56.0",
Expand Down
16 changes: 8 additions & 8 deletions src/Components/Bootstrap/Conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ public function __construct()
{
EventsApi::on('conf', function (array $conf) {
$conf[$this->ID] = array(
'isDev' => XPROBER_IS_DEV,
'version' => ConfigApi::$APP_VERSION,
'appName' => ConfigApi::$APP_NAME,
'appUrl' => ConfigApi::$APP_URL,
'appConfigUrls' => ConfigApi::$APP_CONFIG_URLS,
'isDev' => XPROBER_IS_DEV,
'version' => ConfigApi::$APP_VERSION,
'appName' => ConfigApi::$APP_NAME,
'appUrl' => ConfigApi::$APP_URL,
'appConfigUrls' => ConfigApi::$APP_CONFIG_URLS,
'appConfigUrlDev' => ConfigApi::$APP_CONFIG_URL_DEV,
'authorUrl' => ConfigApi::$AUTHOR_URL,
'authorName' => ConfigApi::$AUTHOR_NAME,
'authorization' => isset($_SERVER['HTTP_AUTHORIZATION']) ? $_SERVER['HTTP_AUTHORIZATION'] : '',
'authorUrl' => ConfigApi::$AUTHOR_URL,
'authorName' => ConfigApi::$AUTHOR_NAME,
'authorization' => isset($_SERVER['HTTP_AUTHORIZATION']) ? $_SERVER['HTTP_AUTHORIZATION'] : '',
);

return $conf;
Expand Down
8 changes: 4 additions & 4 deletions src/Components/Bootstrap/Render.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ final class Render
{
public function __construct()
{
$appName = ConfigApi::$APP_NAME;
$version = ConfigApi::$APP_VERSION;
$appName = ConfigApi::$APP_NAME;
$version = ConfigApi::$APP_VERSION;
$scriptConf = json_encode(EventsApi::emit('conf', array()));
$styleUrl = \defined('XPROBER_IS_DEV') && XPROBER_IS_DEV ? 'app.css' : "?action=style&v={$version}";
$scriptUrl = \defined('XPROBER_IS_DEV') && XPROBER_IS_DEV ? 'app.js' : "?action=script&v={$version}";
$styleUrl = \defined('XPROBER_IS_DEV') && XPROBER_IS_DEV ? 'app.css' : "?action=style&v={$version}";
$scriptUrl = \defined('XPROBER_IS_DEV') && XPROBER_IS_DEV ? 'app.js' : "?action=script&v={$version}";

echo <<<HTML
<!DOCTYPE html>
Expand Down
16 changes: 8 additions & 8 deletions src/Components/Database/Conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ public function __construct()
$sqlite3Version = class_exists('SQLite3') ? SQLite3::version() : false;

$conf[$this->ID] = array(
'sqlite3' => $sqlite3Version ? $sqlite3Version['versionString'] : false,
'sqliteLibversion' => \function_exists('sqlite_libversion') ? sqlite_libversion() : false,
'sqlite3' => $sqlite3Version ? $sqlite3Version['versionString'] : false,
'sqliteLibversion' => \function_exists('sqlite_libversion') ? sqlite_libversion() : false,
'mysqliClientVersion' => \function_exists('mysqli_get_client_version') ? mysqli_get_client_version() : false,
'mongo' => class_exists('Mongo'),
'mongoDb' => class_exists('MongoDB'),
'postgreSql' => \function_exists('pg_connect'),
'paradox' => \function_exists('px_new'),
'msSql' => \function_exists('sqlsrv_server_info'),
'pdo' => class_exists('PDO') ? implode(',', PDO::getAvailableDrivers()) : false,
'mongo' => class_exists('Mongo'),
'mongoDb' => class_exists('MongoDB'),
'postgreSql' => \function_exists('pg_connect'),
'paradox' => \function_exists('px_new'),
'msSql' => \function_exists('sqlsrv_server_info'),
'pdo' => class_exists('PDO') ? implode(',', PDO::getAvailableDrivers()) : false,
);

return $conf;
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Events/EventsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static function emit()
{
$args = \func_get_args();

$name = $args[0];
$name = $args[0];
$return = isset($args[1]) ? $args[1] : null;

unset($args[0], $args[1]);
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Footer/Footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function __construct()
EventsApi::on('conf', function (array $conf) {
$conf[$this->ID] = array(
'memUsage' => memory_get_usage(),
'time' => microtime(true) - (\defined('XPROBER_TIMER') ? XPROBER_TIMER : 0),
'time' => microtime(true) - (\defined('XPROBER_TIMER') ? XPROBER_TIMER : 0),
);

return $conf;
Expand Down
2 changes: 1 addition & 1 deletion src/Components/MyInfo/ClientLocationIpv4.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct()
}

$response = new RestResponse();
$ip = filter_input(\INPUT_GET, 'ip', \FILTER_VALIDATE_IP, array(
$ip = filter_input(\INPUT_GET, 'ip', \FILTER_VALIDATE_IP, array(
'flags' => \FILTER_FLAG_IPV4,
));

Expand Down
6 changes: 3 additions & 3 deletions src/Components/MyInfo/Conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function __construct()
return $conf;
}

$ip = UtilsClientIp::getV4();
$ip = UtilsClientIp::getV4();
$ipv4 = filter_var($ip, \FILTER_VALIDATE_IP, array(
'flags' => \FILTER_FLAG_IPV4,
)) ?: '';
Expand All @@ -24,8 +24,8 @@ public function __construct()
)) ?: '';
$conf[$this->ID] = array(
'phpLanguage' => isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : '-',
'ipv4' => $ipv4,
'ipv6' => $ipv6,
'ipv4' => $ipv4,
'ipv6' => $ipv6,
);

return $conf;
Expand Down
2 changes: 1 addition & 1 deletion src/Components/NetworkStats/Conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct()
}

$conf[$this->ID] = array(
'networks' => UtilsNetwork::getStats(),
'networks' => UtilsNetwork::getStats(),
'timestamp' => time(),
);

Expand Down
2 changes: 1 addition & 1 deletion src/Components/NetworkStats/Fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function filter(array $items)
}

$items[$this->ID] = array(
'networks' => UtilsNetwork::getStats(),
'networks' => UtilsNetwork::getStats(),
'timestamp' => time(),
);

Expand Down
4 changes: 2 additions & 2 deletions src/Components/Nodes/Fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct()
// no break
case 'node':
EventsApi::emit('fetchNodeBefore');
$nodeId = filter_input(\INPUT_GET, 'nodeId', \FILTER_DEFAULT);
$nodeId = filter_input(\INPUT_GET, 'nodeId', \FILTER_DEFAULT);
$response = new RestResponse();

if ( ! $nodeId) {
Expand Down Expand Up @@ -57,7 +57,7 @@ private function getRemoteContent($url)
if (\function_exists('curl_init')) {
$ch = curl_init();
curl_setopt_array($ch, array(
\CURLOPT_URL => $url,
\CURLOPT_URL => $url,
\CURLOPT_RETURNTRANSFER => true,
));
$content = curl_exec($ch);
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Nodes/NodesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function getNodes()
}

return array(
'id' => $item[0],
'id' => $item[0],
'url' => $item[1],
);
}, $items));
Expand Down
48 changes: 24 additions & 24 deletions src/Components/PhpExtensions/Conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,31 @@ public function __construct()
}

$conf[$this->ID] = array(
'redis' => \extension_loaded('redis') && class_exists('Redis'),
'sqlite3' => \extension_loaded('sqlite3') && class_exists('Sqlite3'),
'memcache' => \extension_loaded('memcache') && class_exists('Memcache'),
'memcached' => \extension_loaded('memcached') && class_exists('Memcached'),
'opcache' => \function_exists('opcache_get_status'),
'opcacheEnabled' => $this->isOpcEnabled(),
'redis' => \extension_loaded('redis') && class_exists('Redis'),
'sqlite3' => \extension_loaded('sqlite3') && class_exists('Sqlite3'),
'memcache' => \extension_loaded('memcache') && class_exists('Memcache'),
'memcached' => \extension_loaded('memcached') && class_exists('Memcached'),
'opcache' => \function_exists('opcache_get_status'),
'opcacheEnabled' => $this->isOpcEnabled(),
'opcacheJitEnabled' => $jitEnabled,
'swoole' => \extension_loaded('swoole') && \function_exists('swoole_version'),
'imagick' => \extension_loaded('imagick') && class_exists('Imagick'),
'gmagick' => \extension_loaded('gmagick'),
'exif' => \extension_loaded('exif') && \function_exists('exif_imagetype'),
'fileinfo' => \extension_loaded('fileinfo'),
'simplexml' => \extension_loaded('simplexml'),
'sockets' => \extension_loaded('sockets') && \function_exists('socket_accept'),
'mysqli' => \extension_loaded('mysqli') && class_exists('mysqli'),
'zip' => \extension_loaded('zip') && class_exists('ZipArchive'),
'mbstring' => \extension_loaded('mbstring') && \function_exists('mb_substr'),
'phalcon' => \extension_loaded('phalcon'),
'xdebug' => \extension_loaded('xdebug'),
'zendOptimizer' => \function_exists('zend_optimizer_version'),
'ionCube' => \extension_loaded('ioncube loader'),
'sourceGuardian' => \extension_loaded('sourceguardian'),
'ldap' => \function_exists('ldap_connect'),
'curl' => \function_exists('curl_init'),
'loadedExtensions' => XconfigApi::isDisabled('phpExtensionsLoaded') ? array() : get_loaded_extensions(),
'swoole' => \extension_loaded('swoole') && \function_exists('swoole_version'),
'imagick' => \extension_loaded('imagick') && class_exists('Imagick'),
'gmagick' => \extension_loaded('gmagick'),
'exif' => \extension_loaded('exif') && \function_exists('exif_imagetype'),
'fileinfo' => \extension_loaded('fileinfo'),
'simplexml' => \extension_loaded('simplexml'),
'sockets' => \extension_loaded('sockets') && \function_exists('socket_accept'),
'mysqli' => \extension_loaded('mysqli') && class_exists('mysqli'),
'zip' => \extension_loaded('zip') && class_exists('ZipArchive'),
'mbstring' => \extension_loaded('mbstring') && \function_exists('mb_substr'),
'phalcon' => \extension_loaded('phalcon'),
'xdebug' => \extension_loaded('xdebug'),
'zendOptimizer' => \function_exists('zend_optimizer_version'),
'ionCube' => \extension_loaded('ioncube loader'),
'sourceGuardian' => \extension_loaded('sourceguardian'),
'ldap' => \function_exists('ldap_connect'),
'curl' => \function_exists('curl_init'),
'loadedExtensions' => XconfigApi::isDisabled('phpExtensionsLoaded') ? array() : get_loaded_extensions(),
);

return $conf;
Expand Down
26 changes: 13 additions & 13 deletions src/Components/PhpInfo/Conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ public function __construct()
}

$conf[$this->ID] = array(
'version' => \PHP_VERSION,
'sapi' => \PHP_SAPI,
'displayErrors' => (bool) \ini_get('display_errors'),
'errorReporting' => (int) \ini_get('error_reporting'),
'memoryLimit' => (string) \ini_get('memory_limit'),
'postMaxSize' => (string) \ini_get('post_max_size'),
'uploadMaxFilesize' => (string) \ini_get('upload_max_filesize'),
'maxInputVars' => (int) \ini_get('max_input_vars'),
'maxExecutionTime' => (int) \ini_get('max_execution_time'),
'version' => \PHP_VERSION,
'sapi' => \PHP_SAPI,
'displayErrors' => (bool) \ini_get('display_errors'),
'errorReporting' => (int) \ini_get('error_reporting'),
'memoryLimit' => (string) \ini_get('memory_limit'),
'postMaxSize' => (string) \ini_get('post_max_size'),
'uploadMaxFilesize' => (string) \ini_get('upload_max_filesize'),
'maxInputVars' => (int) \ini_get('max_input_vars'),
'maxExecutionTime' => (int) \ini_get('max_execution_time'),
'defaultSocketTimeout' => (int) \ini_get('default_socket_timeout'),
'allowUrlFopen' => (bool) \ini_get('allow_url_fopen'),
'smtp' => (bool) \ini_get('SMTP'),
'disableFunctions' => XconfigApi::isDisabled('phpDisabledFunctions') ? array() : array_filter(explode(',', (string) \ini_get('disable_functions'))),
'disableClasses' => XconfigApi::isDisabled('phpDisabledClasses') ? array() : array_filter(explode(',', (string) \ini_get('disable_classes'))),
'allowUrlFopen' => (bool) \ini_get('allow_url_fopen'),
'smtp' => (bool) \ini_get('SMTP'),
'disableFunctions' => XconfigApi::isDisabled('phpDisabledFunctions') ? array() : array_filter(explode(',', (string) \ini_get('disable_functions'))),
'disableClasses' => XconfigApi::isDisabled('phpDisabledClasses') ? array() : array_filter(explode(',', (string) \ini_get('disable_classes'))),
);

return $conf;
Expand Down
4 changes: 2 additions & 2 deletions src/Components/PhpInfo/FetchLatestPhpVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct()
}

$response = new RestResponse();
$content = file_get_contents('https://www.php.net/releases/?json');
$content = file_get_contents('https://www.php.net/releases/?json');

if ( ! $content) {
$response->setStatus(StatusCode::$NOT_FOUND)->end();
Expand All @@ -42,7 +42,7 @@ public function __construct()

$response->setData(array(
'version' => $version,
'date' => $versions[ConfigApi::$LATEST_PHP_STABLE_VERSION]['date'],
'date' => $versions[ConfigApi::$LATEST_PHP_STABLE_VERSION]['date'],
))->json()->end();
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Rest/RestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private function httpResponseCode($code)
599 => 'Network connect timeout error',
);

$msg = isset($statusCode[$code]) ? $statusCode[$code] : 'Unknow error';
$msg = isset($statusCode[$code]) ? $statusCode[$code] : 'Unknow error';
$protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');

header("{$protocol} {$code} {$msg}");
Expand Down
2 changes: 1 addition & 1 deletion src/Components/ServerBenchmark/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct()
private function render()
{
$remainingSeconds = $this->getRemainingSeconds();
$response = new RestResponse();
$response = new RestResponse();

if ($remainingSeconds) {
$response->setStatus(StatusCode::$TOO_MANY_REQUESTS);
Expand Down
14 changes: 7 additions & 7 deletions src/Components/ServerBenchmark/ServerBenchmarkApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public function getPointsByTime($time)

public function getCpuPoints()
{
$data = 'inn-studio.com';
$hash = array('md5', 'sha512', 'sha256', 'crc32');
$data = 'inn-studio.com';
$hash = array('md5', 'sha512', 'sha256', 'crc32');
$start = microtime(true);
$i = 0;
$i = 0;

while (microtime(true) - $start < .5) {
foreach ($hash as $v) {
Expand All @@ -80,7 +80,7 @@ public function getWritePoints()
return 0;
}

$i = 0;
$i = 0;
$start = microtime(true);

while (microtime(true) - $start < .5) {
Expand All @@ -102,8 +102,8 @@ public function getReadPoints()
return 0;
}

$i = 0;
$start = microtime(true);
$i = 0;
$start = microtime(true);
$filePath = "{$tmpDir}/innStudioIoBenchmark";

if ( ! file_exists($filePath)) {
Expand Down Expand Up @@ -147,7 +147,7 @@ private function cooldown()

private function getRecorder()
{
$path = $this->getTmpRecorderPath();
$path = $this->getTmpRecorderPath();
$defaults = array(
'expired' => 0,
'running' => 0,
Expand Down
Loading

0 comments on commit b72ff53

Please sign in to comment.