Function getToInstall
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function getToInstall(): array
{
$data = self::get();
if (\Config\Developer::$updaterDevMode) {
$where = ['like', 'from_version', self::$version . '.%', false];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method get
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function get(): array
{
$fullVer = \explode('.', \App\Version::get());
array_pop($fullVer);
self::$version = \implode('.', $fullVer);
Function get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function get(): array
{
$fullVer = \explode('.', \App\Version::get());
array_pop($fullVer);
self::$version = \implode('.', $fullVer);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Missing class import via use statement (line '49', column '15'). Open
throw new \App\Exceptions\AppException('Error with connection |' . $response->getStatusCode());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '126', column '9'). Open
(new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url, ['sink' => $path]);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '46', column '21'). Open
$response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '81', column '17'). Open
$query = (new \App\Db\Query())->from('yetiforce_updates')->where($where)->andWhere(['result' => 1]);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class '\App\Json' in method 'get'. Open
return \App\Json::read($file);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Log' in method 'get'. Open
\App\Log::endProfile("GET|Updater::get|{$url}", __NAMESPACE__);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Settings_ModuleManager_Module_Model' in method 'isDownloaded'. Open
return \file_exists(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \Settings_ModuleManager_Module_Model::getUploadDirectory() . \DIRECTORY_SEPARATOR . $package['hash'] . '.zip');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Json' in method 'get'. Open
$body = \App\Json::isEmpty($body) ? [] : \App\Json::decode($body);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Json' in method 'get'. Open
\App\Json::save($file, $return);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Log' in method 'get'. Open
\App\Log::beginProfile("GET|Updater::get|{$url}", __NAMESPACE__);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Log' in method 'get'. Open
\App\Log::warning('Error - ' . __CLASS__ . ' - ' . $ex->getMessage());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Version' in method 'getToInstall'. Open
$where = ['from_version' => \App\Version::get()];
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Version' in method 'getToInstall'. Open
if ($row['fromVersion'] !== \App\Version::get()) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Log' in method 'download'. Open
\App\Log::beginProfile("GET|Updater::download|{$url}", __NAMESPACE__);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Log' in method 'download'. Open
\App\Log::warning('Error - ' . __CLASS__ . ' - ' . $ex->getMessage());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Version' in method 'get'. Open
$fullVer = \explode('.', \App\Version::get());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method getToInstall uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$where = ['from_version' => \App\Version::get()];
foreach ($data as $key => $row) {
if ($row['fromVersion'] !== \App\Version::get()) {
unset($data[$key]);
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Settings_ModuleManager_Module_Model' in method 'download'. Open
$uploadDir = \Settings_ModuleManager_Module_Model::getUploadDirectory();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Json' in method 'get'. Open
$body = \App\Json::isEmpty($body) ? [] : \App\Json::decode($body);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Log' in method 'download'. Open
\App\Log::endProfile("GET|Updater::download|{$url}", __NAMESPACE__);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\RequestHttp' in method 'download'. Open
(new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url, ['sink' => $path]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\RequestHttp' in method 'get'. Open
$response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Call to method beginProfile
from undeclared class \App\Log
Open
\App\Log::beginProfile("GET|Updater::get|{$url}", __NAMESPACE__);
- Exclude checks
Call to method request
from undeclared class \GuzzleHttp\Client
Open
(new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url, ['sink' => $path]);
- Exclude checks
Call to method warning
from undeclared class \App\Log
Open
\App\Log::warning('Error - ' . __CLASS__ . ' - ' . $ex->getMessage());
- Exclude checks
Call to method warning
from undeclared class \App\Log
Open
\App\Log::warning('Error - ' . __CLASS__ . ' - ' . $ex->getMessage());
- Exclude checks
Reference to static property updaterDevMode
from undeclared class \Config\Developer
Open
if (\Config\Developer::$updaterDevMode) {
- Exclude checks
Call to method __construct
from undeclared class \GuzzleHttp\Client
Open
$response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url);
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$query = (new \App\Db\Query())->from('yetiforce_updates')->where($where)->andWhere(['result' => 1]);
- Exclude checks
Reference to static property updaterDevMode
from undeclared class \Config\Developer
Open
if (\Config\Developer::$updaterDevMode) {
- Exclude checks
Call to method beginProfile
from undeclared class \App\Log
Open
\App\Log::beginProfile("GET|Updater::download|{$url}", __NAMESPACE__);
- Exclude checks
Call to method request
from undeclared class \GuzzleHttp\Client
Open
$response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url);
- Exclude checks
Reference to static property updaterDevMode
from undeclared class \Config\Developer
Open
$updaterMode = \Config\Developer::$updaterDevMode ? 'developer' : 'master';
- Exclude checks
Call to method endProfile
from undeclared class \App\Log
Open
\App\Log::endProfile("GET|Updater::download|{$url}", __NAMESPACE__);
- Exclude checks
Call to method __construct
from undeclared class \GuzzleHttp\Client
Open
(new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url, ['sink' => $path]);
- Exclude checks
Call to method endProfile
from undeclared class \App\Log
Open
\App\Log::endProfile("GET|Updater::get|{$url}", __NAMESPACE__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fullVer = \explode('.', \App\Version::get());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$version = \implode('.', $fullVer);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$where = ['from_version' => \App\Version::get()];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::beginProfile("GET|Updater::get|{$url}", __NAMESPACE__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\file_exists($file) && filemtime($file) > strtotime('-5 minute')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$data = self::get();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::warning('Error - ' . __CLASS__ . ' - ' . $ex->getMessage());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($data as $key => $row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
array_pop($fullVer);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
try {
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
$url = "https://github.com/YetiForceCompany/UpdatePackages/raw/{$updaterMode}/YetiForce%20CRM%20{$fullVer[0]}.x.x/Updater.json";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (200 !== $response->getStatusCode()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$body = \App\Json::isEmpty($body) ? [] : \App\Json::decode($body);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get updates to install.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return = $body[self::$version];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$where = ['like', 'from_version', self::$version . '.%', false];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$file = ROOT_DIRECTORY . '/app_data/SystemUpdater.json';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url = "https://github.com/YetiForceCompany/UpdatePackages/raw/{$updaterMode}/YetiForce%20CRM%20{$fullVer[0]}.x.x/Updater.json";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\AppException('Error with connection |' . $response->getStatusCode());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$body = $response->getBody();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\Config\Developer::$updaterDevMode) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private static $version = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* System version for updates.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$updaterMode = \Config\Developer::$updaterDevMode ? 'developer' : 'master';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Json::save($file, $return);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getToInstall(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function get(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} catch (\Throwable $ex) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($data[$key]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::warning('Error - ' . __CLASS__ . ' - ' . $ex->getMessage());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$updates[$row['name']] = $row;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string[] $package
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$path = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . $uploadDir . \DIRECTORY_SEPARATOR . $package['hash'] . '.zip';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::beginProfile("GET|Updater::download|{$url}", __NAMESPACE__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Json::read($file);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::endProfile("GET|Updater::get|{$url}", __NAMESPACE__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($body && isset($body[self::$version])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get list of available updates.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
try {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url = $package['url'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($dataReader as $row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$updates = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($data[$key]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::endProfile("GET|Updater::download|{$url}", __NAMESPACE__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($updates[$row['label']])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function isDownloaded(array $package): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uploadDir = \Settings_ModuleManager_Module_Model::getUploadDirectory();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($row['fromVersion'] !== \App\Version::get()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url = \str_replace('raw/master', 'raw/developer', $url);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $data;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \file_exists(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \Settings_ModuleManager_Module_Model::getUploadDirectory() . \DIRECTORY_SEPARATOR . $package['hash'] . '.zip');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
(new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url, ['sink' => $path]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} catch (\Throwable $ex) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query = (new \App\Db\Query())->from('yetiforce_updates')->where($where)->andWhere(['result' => 1]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['hash'] = \md5($row['label']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Check if the package has been downloaded.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Line exceeds 120 characters; contains 179 characters Open
return \file_exists(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \Settings_ModuleManager_Module_Model::getUploadDirectory() . \DIRECTORY_SEPARATOR . $package['hash'] . '.zip');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Download package.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\Config\Developer::$updaterDevMode) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = $query->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($data as $key => &$row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string[] $package
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function download(array $package)
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$path = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . $uploadDir . \DIRECTORY_SEPARATOR . $package['hash'] . '.zip';
- Exclude checks