Skip to content

Commit

Permalink
Update vimeo/psalm requirement from 3.12.2 to 3.16 (#3873)
Browse files Browse the repository at this point in the history
* Update vimeo/psalm requirement from 3.12.2 to 3.16

Updates the requirements on [vimeo/psalm](https://github.com/vimeo/psalm) to permit the latest version.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](vimeo/psalm@3.12.2...3.16)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gregor Harlan <mail@gh01.de>
  • Loading branch information
dependabot[bot] and gharlan committed Sep 18, 2020
1 parent a37b13a commit d67f785
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 47 deletions.
Binary file modified .github/tests-visual/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/redaxo.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"phpunit/phpunit": "^9.3",
"psalm/plugin-phpunit": "0.12.1",
"psalm/plugin-symfony": "1.4.1",
"vimeo/psalm": "3.12.2"
"vimeo/psalm": "3.16"
},
"replace": {
"erusev/parsedown": "1.7.4",
Expand Down
29 changes: 14 additions & 15 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,33 +59,32 @@
<DeprecatedMethod>
<errorLevel type="info">
<referencedMethod name="rex_string::versionCompare"/>
<referencedMethod name="PHPUnit\Framework\Assert::assertDirectoryNotExists"/>
<referencedMethod name="PHPUnit\Framework\Assert::assertFileNotExists"/>
</errorLevel>
</DeprecatedMethod>
<DocblockTypeContradiction errorLevel="info" />
<InternalClass errorLevel="info" />
<InternalMethod errorLevel="info" />
<InternalProperty errorLevel="info" />
<InternalClass errorLevel="info" />
<MissingClosureParamType errorLevel="info" />
<MissingClosureReturnType errorLevel="info" />
<MissingReturnType errorLevel="info" />
<MissingConstructor>
<errorLevel type="suppress">
<file name="vendor/phpunit/phpunit/src/Framework/TestCase.php" />
</errorLevel>
</MissingConstructor>
<MissingParamType errorLevel="info" />
<MissingPropertyType errorLevel="info" />
<MissingReturnType errorLevel="info" />
<PropertyNotSetInConstructor errorLevel="info" />
<MissingClosureParamType errorLevel="info" />
<MissingParamType errorLevel="info" />
<RedundantCondition errorLevel="info" />
<DocblockTypeContradiction errorLevel="info" />
<RedundantConditionGivenDocblockType errorLevel="info" />
<UnresolvableInclude errorLevel="info" />
<RawObjectIteration>
<errorLevel type="info">
<file name="redaxo/src/core/lib/api_function.php"/>
</errorLevel>
</RawObjectIteration>
<MissingConstructor>
<errorLevel type="suppress">
<file name="vendor/phpunit/phpunit/src/Framework/TestCase.php" />
</errorLevel>
</MissingConstructor>
<RedundantCondition errorLevel="info" />
<RedundantConditionGivenDocblockType errorLevel="info" />
<UnresolvableInclude errorLevel="suppress" />
<UnsafeInstantiation errorLevel="info" />
<!-- level 3 issues - points to possible deficiencies in logic, higher false-positives -->
<PossiblyNullArgument errorLevel="info" />
<PossiblyNullReference errorLevel="info" />
Expand Down
6 changes: 3 additions & 3 deletions redaxo/src/addons/debug/lib/extensions/sql_debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
*/
class rex_sql_debug extends rex_sql
{
public function setQuery($qry, array $params = [], array $options = [])
public function setQuery($query, array $params = [], array $options = [])
{
try {
$timer = new rex_timer();
parent::setQuery($qry, $params, $options);
parent::setQuery($query, $params, $options);

// to prevent double entries, log only if no params are passed
if (empty($params)) {
rex_debug_clockwork::getInstance()
->addDatabaseQuery($qry, $params, $timer->getDelta(), ['connection' => $this->DBID] + rex_debug::getTrace());
->addDatabaseQuery($query, $params, $timer->getDelta(), ['connection' => $this->DBID] + rex_debug::getTrace());
}
} catch (rex_exception $e) {
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
Expand Down
5 changes: 5 additions & 0 deletions redaxo/src/addons/install/lib/api/api_core_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,14 @@ private function checkRequirements($temppath, $version, array $addons)
// ---- update "version", "requires" and "conflicts" properties
$coreVersion = rex::getVersion();
rex::setProperty('version', $version);

/** @psalm-var SplObjectStorage<rex_package_interface, string> $versions */
$versions = new SplObjectStorage();
/** @psalm-var SplObjectStorage<rex_package_interface, array> $requirements */
$requirements = new SplObjectStorage();
/** @psalm-var SplObjectStorage<rex_package_interface, array> $conflicts */
$conflicts = new SplObjectStorage();

foreach ($addons as $addonkey => $config) {
$addon = rex_addon::get($addonkey);
$addonPath = $temppath . 'addons/' . $addonkey . '/';
Expand Down
3 changes: 3 additions & 0 deletions redaxo/src/addons/install/lib/package/package_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@ private function checkRequirements($config)
$temppath = rex_path::addon('.new.' . $this->addonkey);

// ---- update "version", "requires" and "conflicts" properties
/** @psalm-var SplObjectStorage<rex_package, string> $versions */
$versions = new SplObjectStorage();
/** @psalm-var SplObjectStorage<rex_package, array> $requirements */
$requirements = new SplObjectStorage();
/** @psalm-var SplObjectStorage<rex_package, array> $conflicts */
$conflicts = new SplObjectStorage();

$requirements[$this->addon] = $this->addon->getProperty('requires', []);
Expand Down
2 changes: 1 addition & 1 deletion redaxo/src/addons/metainfo/lib/handler/article_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function buildFilterCondition(array $params)
return $restrictionsCondition;
}

protected function renderFormItem($field, $tag, $tag_attr, $id, $label, $labelIt, $typeLabel)
protected function renderFormItem($field, $tag, $tag_attr, $id, $label, $labelIt, $inputType)
{
return $field;
}
Expand Down
4 changes: 2 additions & 2 deletions redaxo/src/addons/metainfo/lib/handler/category_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ protected function buildFilterCondition(array $params)
return $restrictionsCondition;
}

public function renderFormItem($field, $tag, $tag_attr, $id, $label, $labelIt, $typeLabel)
public function renderFormItem($field, $tag, $tag_attr, $id, $label, $labelIt, $inputType)
{
$element = $field;

if ('legend' == $typeLabel) {
if ('legend' == $inputType) {
$element = '<h3 class="form-legend">' . $label . '</h3>';
}

Expand Down
4 changes: 2 additions & 2 deletions redaxo/src/addons/metainfo/lib/handler/clang_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ protected function buildFilterCondition(array $params)
{
}

public function renderFormItem($field, $tag, $tag_attr, $id, $label, $labelIt, $typeLabel)
public function renderFormItem($field, $tag, $tag_attr, $id, $label, $labelIt, $inputType)
{
$element = $field;

if ('legend' == $typeLabel) {
if ('legend' == $inputType) {
$element = '<h3 class="form-legend">' . $label . '</h3>';
}

Expand Down
2 changes: 1 addition & 1 deletion redaxo/src/addons/metainfo/lib/handler/media_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ protected function handleSave(array $params, rex_sql $sqlFields)
return $params;
}

protected function renderFormItem($field, $tag, $tag_attr, $id, $label, $labelIt, $typeLabel)
protected function renderFormItem($field, $tag, $tag_attr, $id, $label, $labelIt, $inputType)
{
return $field;
}
Expand Down
4 changes: 2 additions & 2 deletions redaxo/src/addons/structure/lib/select_category.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ public function get()
return parent::get();
}

protected function outGroup($parent_id, $level = 0)
protected function outGroup($parentId, $level = 0)
{
if ($level > 100) {
// nur mal so zu sicherheit .. man weiss nie ;)
throw new rex_exception('select->_outGroup overflow');
}

$ausgabe = '';
$group = $this->getGroup($parent_id);
$group = $this->getGroup($parentId);
if (!is_array($group)) {
return '';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,11 @@ public function getArticle($curctype = -1)
* Method which gets called, before the slices of the article are processed.
*
* @param string $articleContent The content of the article
* @param int $module_id A module id
* @param int $moduleId A module id
*
* @return string
*/
protected function preArticle($articleContent, $module_id)
protected function preArticle($articleContent, $moduleId)
{
// nichts tun
return $articleContent;
Expand All @@ -420,11 +420,11 @@ protected function preArticle($articleContent, $module_id)
* Method which gets called, after all slices have been processed.
*
* @param string $articleContent The content of the article
* @param int $module_id A module id
* @param int $moduleId A module id
*
* @return string
*/
protected function postArticle($articleContent, $module_id)
protected function postArticle($articleContent, $moduleId)
{
// nichts tun
return $articleContent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ private function getModuleSelect($sliceId)
/**
* {@inheritdoc}
*/
protected function preArticle($articleContent, $module_id)
protected function preArticle($articleContent, $moduleId)
{
// ---------- moduleselect: nur module nehmen auf die der user rechte hat
if ('edit' == $this->mode) {
Expand All @@ -330,21 +330,21 @@ protected function preArticle($articleContent, $module_id)
}
}

return parent::preArticle($articleContent, $module_id);
return parent::preArticle($articleContent, $moduleId);
}

/**
* {@inheritdoc}
*/
protected function postArticle($articleContent, $moduleIdToAdd)
protected function postArticle($articleContent, $moduleId)
{
// special identifier for the slot behind the last slice
$LCTSL_ID = -1;

// ----- add module im edit mode
if ('edit' == $this->mode) {
if ('add' == $this->function && $this->slice_id == $LCTSL_ID) {
$slice_content = $this->addSlice($LCTSL_ID, $moduleIdToAdd);
$slice_content = $this->addSlice($LCTSL_ID, $moduleId);
} else {
// ----- BLOCKAUSWAHL - SELECT
$slice_content = $this->getModuleSelect($LCTSL_ID);
Expand All @@ -360,28 +360,28 @@ protected function postArticle($articleContent, $moduleIdToAdd)
/**
* @return string
*/
protected function addSlice($sliceId, $moduleIdToAdd)
protected function addSlice($sliceId, $moduleId)
{
$MOD = rex_sql::factory();
$MOD->setQuery('SELECT * FROM ' . rex::getTablePrefix() . 'module WHERE id="' . $moduleIdToAdd . '"');
$MOD->setQuery('SELECT * FROM ' . rex::getTablePrefix() . 'module WHERE id="' . $moduleId . '"');

if (1 != $MOD->getRows()) {
$slice_content = rex_view::error(rex_i18n::msg('module_doesnt_exist'));
} else {
$initDataSql = rex_sql::factory();
$initDataSql
->setValue('module_id', $moduleIdToAdd)
->setValue('module_id', $moduleId)
->setValue('ctype_id', $this->ctype);

// ----- PRE VIEW ACTION [ADD]
$action = new rex_article_action($moduleIdToAdd, 'add', $initDataSql);
$action = new rex_article_action($moduleId, 'add', $initDataSql);
$action->setRequestValues();
$action->exec(rex_article_action::PREVIEW);
// ----- / PRE VIEW ACTION

$moduleInput = $this->replaceVars($initDataSql, $MOD->getValue('input'));

$moduleInput = $this->getStreamOutput('module/' . $moduleIdToAdd . '/input', $moduleInput);
$moduleInput = $this->getStreamOutput('module/' . $moduleId . '/input', $moduleInput);

$msg = '';
if ('' != $this->warning) {
Expand Down Expand Up @@ -409,7 +409,7 @@ protected function addSlice($sliceId, $moduleIdToAdd)
<fieldset>
<legend>' . rex_i18n::msg('add_block') . '</legend>
<input type="hidden" name="function" value="add" />
<input type="hidden" name="module_id" value="' . $moduleIdToAdd . '" />
<input type="hidden" name="module_id" value="' . $moduleId . '" />
<input type="hidden" name="save" value="1" />
<div class="rex-slice-input">
Expand Down
1 change: 1 addition & 0 deletions redaxo/src/core/lib/packages/addons/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public function activate()
return false;
}

/** @psalm-var SplObjectStorage<rex_plugin, rex_plugin_manager> $plugins */
$plugins = new SplObjectStorage();
// create the managers for all available plugins
foreach ($this->package->getAvailablePlugins() as $plugin) {
Expand Down
6 changes: 6 additions & 0 deletions redaxo/src/core/lib/packages/plugins/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public function __construct($name, rex_addon $addon)
* @throws InvalidArgumentException
*
* @return rex_plugin_interface If the plugin exists, a `rex_plugin` is returned, otherwise a `rex_null_plugin`
*
* @psalm-suppress ParamNameMismatch
*/
public static function get($addon, $plugin = null)
{
Expand All @@ -58,6 +60,8 @@ public static function get($addon, $plugin = null)
* @throws RuntimeException if the plugin does not exist
*
* @return self
*
* @psalm-suppress ParamNameMismatch
*/
public static function require(string $addon, string $plugin = null): rex_package
{
Expand All @@ -75,6 +79,8 @@ public static function require(string $addon, string $plugin = null): rex_packag
* @param string $plugin Name of the plugin
*
* @return bool
*
* @psalm-suppress ParamNameMismatch
*/
public static function exists($addon, $plugin = null)
{
Expand Down
8 changes: 4 additions & 4 deletions redaxo/src/core/lib/util/markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,16 @@ final class rex_parsedown_with_toc extends ParsedownExtra
public $bottomLevel = 3;
public $headers = [];

protected function blockHeader($line)
protected function blockHeader($Line)
{
$block = parent::blockHeader($line);
$block = parent::blockHeader($Line);

return $this->handleHeader($block);
}

protected function blockSetextHeader($line, array $block = null)
protected function blockSetextHeader($Line, array $Block = null)
{
$block = parent::blockSetextHeader($line, $block);
$block = parent::blockSetextHeader($Line, $Block);

return $this->handleHeader($block);
}
Expand Down

0 comments on commit d67f785

Please sign in to comment.