Merge pull request #10463 from creative-commoners/pulls/4/rescue-master-static-analysis

Rescue Master Branch PR: ENH Various changes via static analysis tooling
This commit is contained in:
Steve Boyd 2022-08-25 09:50:13 +12:00 committed by GitHub
commit f14c60ceb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 14 additions and 12 deletions

View File

@ -563,7 +563,7 @@ class ClassManifest
'ignore_files' => ['index.php', 'cli-script.php'],
'ignore_tests' => !$includeTests,
'ignored_ci_configs' => $ignoredCIConfigs,
'file_callback' => function ($basename, $pathname, $depth) use ($includeTests, $finder) {
'file_callback' => function ($basename, $pathname, $depth) use ($includeTests) {
$this->handleFile($basename, $pathname, $includeTests);
},
]);

View File

@ -123,7 +123,7 @@ class ConfirmedPasswordField extends FormField
* @param string $name
* @param string $title
* @param mixed $value
* @param Form $form
* @param Form $form Ignored for ConfirmedPasswordField.
* @param boolean $showOnClick
* @param string $titleConfirmField Alternate title (not localizeable)
*/

View File

@ -589,7 +589,7 @@ class FormField extends RequestHandler
//
// CSS class needs to be different from the one rendered through {@link FieldHolder()}.
if ($this->getMessage()) {
$classes[] .= 'holder-' . $this->getMessageType();
$classes[] = 'holder-' . $this->getMessageType();
}
return implode(' ', $classes);

View File

@ -2,6 +2,8 @@
namespace SilverStripe\Forms\GridField;
use SilverStripe\ORM\DataObject;
/**
* Allows GridField_ActionMenuItem to act as a link
*/

View File

@ -169,7 +169,7 @@ class NullableField extends FormField
public function debug()
{
$result = sprintf(
'%s (%s: $s : <span style="color: red">%s</span>) = ',
'%s (%s: %s : <span style="color: red">%s</span>) = ',
static::class,
$this->name,
$this->title,

View File

@ -6,6 +6,7 @@ use SilverStripe\Assets\File;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Convert;
use SilverStripe\Dev\Deprecation;
use SilverStripe\ORM\PaginatedList;
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\ArrayList;

View File

@ -78,23 +78,23 @@ class MySQLSchemaManager extends DBSchemaManager
if ($newFields) {
foreach ($newFields as $k => $v) {
$alterList[] .= "ADD \"$k\" $v";
$alterList[] = "ADD \"$k\" $v";
}
}
if ($newIndexes) {
foreach ($newIndexes as $k => $v) {
$alterList[] .= "ADD " . $this->getIndexSqlDefinition($k, $v);
$alterList[] = "ADD " . $this->getIndexSqlDefinition($k, $v);
}
}
if ($alteredFields) {
foreach ($alteredFields as $k => $v) {
$alterList[] .= "CHANGE \"$k\" \"$k\" $v";
$alterList[] = "CHANGE \"$k\" \"$k\" $v";
}
}
if ($alteredIndexes) {
foreach ($alteredIndexes as $k => $v) {
$alterList[] .= "DROP INDEX \"$k\"";
$alterList[] .= "ADD " . $this->getIndexSqlDefinition($k, $v);
$alterList[] = "DROP INDEX \"$k\"";
$alterList[] = "ADD " . $this->getIndexSqlDefinition($k, $v);
}
}

View File

@ -12,7 +12,6 @@ use SilverStripe\Core\Injector\Injector;
use SilverStripe\Core\Manifest\ClassLoader;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Dev\DevelopmentAdmin;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\Connect\DatabaseException;
use SilverStripe\ORM\Connect\TableBuilder;
use SilverStripe\ORM\FieldType\DBClassName;

View File

@ -99,7 +99,7 @@ class ShortcodeParser
* - An associative array of extra information about the shortcode being parsed.
*
* @param string $shortcode The shortcode tag to map to the callback - normally in lowercase_underscore format.
* @param callback $callback The callback to replace the shortcode with.
* @param callable $callback The callback to replace the shortcode with.
* @return $this
*/
public function register($shortcode, $callback)

View File

@ -124,7 +124,7 @@ class ThemeManifest implements ThemeList
}
/**
* @return \string[]
* @return string[]
*/
public function getThemes()
{