Skip to content

Commit

Permalink
Merge pull request #10463 from creative-commoners/pulls/4/rescue-mast…
Browse files Browse the repository at this point in the history
…er-static-analysis

Rescue Master Branch PR: ENH Various changes via static analysis tooling
  • Loading branch information
emteknetnz authored Aug 24, 2022
2 parents a753173 + 94d1ac8 commit f14c60c
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Core/Manifest/ClassManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ public function regenerate($includeTests, array $ignoredCIConfigs = [])
'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);
},
]);
Expand Down
2 changes: 1 addition & 1 deletion src/Forms/ConfirmedPasswordField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Forms/FormField.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ public function extraClass()
//
// 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);
Expand Down
2 changes: 2 additions & 0 deletions src/Forms/GridField/GridField_ActionMenuLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace SilverStripe\Forms\GridField;

use SilverStripe\ORM\DataObject;

/**
* Allows GridField_ActionMenuItem to act as a link
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Forms/NullableField.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function setName($name)
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,
Expand Down
1 change: 1 addition & 0 deletions src/ORM/Connect/MySQLDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
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;
Expand Down
10 changes: 5 additions & 5 deletions src/ORM/Connect/MySQLSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,23 @@ public function alterTable(

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);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/ORM/DatabaseAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
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;
Expand Down
2 changes: 1 addition & 1 deletion src/View/Parsers/ShortcodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static function set_active($identifier)
* - 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)
Expand Down
2 changes: 1 addition & 1 deletion src/View/ThemeManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function getCacheKey($includeTests = false)
}

/**
* @return \string[]
* @return string[]
*/
public function getThemes()
{
Expand Down

0 comments on commit f14c60c

Please sign in to comment.