Skip to content

Commit

Permalink
Fix code quality issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Graham committed Sep 7, 2023
1 parent 2b53f69 commit e4f73a6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/src/Revolution/Processors/Context/GetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function initialize()
'exclude' => 'creator',
]);
$this->isGridFilter = $this->getProperty('isGridFilter', false);

$this->canCreate = $this->modx->hasPermission('new_context');
$this->canUpdate = $this->modx->hasPermission('edit_context');
$this->canDelete = $this->modx->hasPermission('delete_context');
Expand Down
26 changes: 21 additions & 5 deletions core/src/Revolution/Sources/modMediaSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ public function uploadObjectsToContainer($container, array $objects = [])
continue;
}

if ((boolean)$this->xpdo->getOption('upload_translit')) {
if ((bool)$this->xpdo->getOption('upload_translit')) {

Check warning on line 1128 in core/src/Revolution/Sources/modMediaSource.php

View check run for this annotation

Codecov / codecov/patch

core/src/Revolution/Sources/modMediaSource.php#L1128

Added line #L1128 was not covered by tests
$newName = $this->xpdo->filterPathSegment($file['name']);

// If the file name is different after filtering, call OnFileManagerFileRename
Expand Down Expand Up @@ -1718,10 +1718,26 @@ public function clearCache(array $options = [])
$c->select($this->xpdo->escape('key'));

$options[xPDO::OPT_CACHE_KEY] = $this->getOption('cache_media_sources_key', $options, 'media_sources');
$options[xPDO::OPT_CACHE_HANDLER] = $this->getOption('cache_media_sources_handler', $options, $this->getOption(xPDO::OPT_CACHE_HANDLER, $options));
$options[xPDO::OPT_CACHE_FORMAT] = (int)$this->getOption('cache_media_sources_format', $options, $this->getOption(xPDO::OPT_CACHE_FORMAT, $options, xPDOCacheManager::CACHE_PHP));
$options[xPDO::OPT_CACHE_ATTEMPTS] = (int)$this->getOption('cache_media_sources_attempts', $options, $this->getOption(xPDO::OPT_CACHE_ATTEMPTS, $options, 10));
$options[xPDO::OPT_CACHE_ATTEMPT_DELAY] = (int)$this->getOption('cache_media_sources_attempt_delay', $options, $this->getOption(xPDO::OPT_CACHE_ATTEMPT_DELAY, $options, 1000));
$options[xPDO::OPT_CACHE_HANDLER] = $this->getOption(
'cache_media_sources_handler',
$options,
$this->getOption(xPDO::OPT_CACHE_HANDLER, $options)
);
$options[xPDO::OPT_CACHE_FORMAT] = (int)$this->getOption(
'cache_media_sources_format',
$options, $this->getOption(xPDO::OPT_CACHE_FORMAT,

Check failure on line 1728 in core/src/Revolution/Sources/modMediaSource.php

View workflow job for this annotation

GitHub Actions / phpcs

Only one argument is allowed per line in a multi-line function call

Check failure on line 1728 in core/src/Revolution/Sources/modMediaSource.php

View workflow job for this annotation

GitHub Actions / phpcs

Opening parenthesis of a multi-line function call must be the last content on the line
$options, xPDOCacheManager::CACHE_PHP)

Check failure on line 1729 in core/src/Revolution/Sources/modMediaSource.php

View workflow job for this annotation

GitHub Actions / phpcs

Only one argument is allowed per line in a multi-line function call

Check failure on line 1729 in core/src/Revolution/Sources/modMediaSource.php

View workflow job for this annotation

GitHub Actions / phpcs

Closing parenthesis of a multi-line function call must be on a line by itself
);
$options[xPDO::OPT_CACHE_ATTEMPTS] = (int)$this->getOption(
'cache_media_sources_attempts',
$options,
$this->getOption(xPDO::OPT_CACHE_ATTEMPTS, $options, 10)
);
$options[xPDO::OPT_CACHE_ATTEMPT_DELAY] = (int)$this->getOption(
'cache_media_sources_attempt_delay',
$options,
$this->getOption(xPDO::OPT_CACHE_ATTEMPT_DELAY, $options, 1000)
);

Check warning on line 1740 in core/src/Revolution/Sources/modMediaSource.php

View check run for this annotation

Codecov / codecov/patch

core/src/Revolution/Sources/modMediaSource.php#L1721-L1740

Added lines #L1721 - L1740 were not covered by tests

if ($c->prepare() && $c->stmt->execute()) {
while ($row = $c->stmt->fetch(PDO::FETCH_ASSOC)) {
Expand Down

0 comments on commit e4f73a6

Please sign in to comment.