Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rescue Master Branch PR: ENH Various changes via static analysis tooling #10463

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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