mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #9293 from open-sausages/pulls/4.3/psr2-fix
PSR2 linting fixes
This commit is contained in:
commit
c7597ad265
@ -285,18 +285,19 @@ class CoreKernel implements Kernel
|
|||||||
|
|
||||||
// Build error response
|
// Build error response
|
||||||
$dv = new DebugView();
|
$dv = new DebugView();
|
||||||
$body =
|
$body = implode([
|
||||||
$dv->renderHeader() .
|
$dv->renderHeader(),
|
||||||
$dv->renderInfo(
|
$dv->renderInfo(
|
||||||
"Configuration Error",
|
"Configuration Error",
|
||||||
Director::absoluteBaseURL()
|
Director::absoluteBaseURL()
|
||||||
) .
|
),
|
||||||
$dv->renderParagraph(
|
$dv->renderParagraph(
|
||||||
'You need to replace your _ss_environment.php file with a .env file, or with environment variables.<br><br>'
|
'You need to replace your _ss_environment.php file with a .env file, or with environment variables.<br><br>'
|
||||||
. 'See the <a href="https://docs.silverstripe.org/en/4/getting_started/environment_management/">'
|
. 'See the <a href="https://docs.silverstripe.org/en/4/getting_started/environment_management/">'
|
||||||
. 'Environment Management</a> docs for more information.'
|
. 'Environment Management</a> docs for more information.'
|
||||||
) .
|
),
|
||||||
$dv->renderFooter();
|
$dv->renderFooter()
|
||||||
|
]);
|
||||||
|
|
||||||
// Raise error
|
// Raise error
|
||||||
$response = new HTTPResponse($body, 500);
|
$response = new HTTPResponse($body, 500);
|
||||||
|
@ -2102,12 +2102,11 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
// If we haven't been written yet, we can't save these relations, so use a list that handles this case
|
// If we haven't been written yet, we can't save these relations, so use a list that handles this case
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
if (!isset($this->unsavedRelations[$componentName])) {
|
if (!isset($this->unsavedRelations[$componentName])) {
|
||||||
$this->unsavedRelations[$componentName] =
|
$this->unsavedRelations[$componentName] = new UnsavedRelationList(
|
||||||
new UnsavedRelationList(
|
$manyManyComponent['parentClass'],
|
||||||
$manyManyComponent['parentClass'],
|
$componentName,
|
||||||
$componentName,
|
$manyManyComponent['childClass']
|
||||||
$manyManyComponent['childClass']
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return $this->unsavedRelations[$componentName];
|
return $this->unsavedRelations[$componentName];
|
||||||
}
|
}
|
||||||
|
@ -268,15 +268,15 @@ class PermissionCheckboxSetField extends FormField
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this->readonly) {
|
if ($this->readonly) {
|
||||||
|
$message = _t(
|
||||||
|
'SilverStripe\\Security\\Permission.UserPermissionsIntro',
|
||||||
|
'Assigning groups to this user will adjust the permissions they have.'
|
||||||
|
. ' See the groups section for details of permissions on individual groups.'
|
||||||
|
);
|
||||||
|
|
||||||
return
|
return
|
||||||
"<ul id=\"{$this->ID()}\" class=\"optionset checkboxsetfield{$this->extraClass()}\">\n" .
|
"<ul id=\"{$this->ID()}\" class=\"optionset checkboxsetfield{$this->extraClass()}\">\n" .
|
||||||
"<li class=\"help\">" .
|
"<li class=\"help\">" . $message . "</li>" .
|
||||||
_t(
|
|
||||||
'SilverStripe\\Security\\Permission.UserPermissionsIntro',
|
|
||||||
'Assigning groups to this user will adjust the permissions they have.'
|
|
||||||
. ' See the groups section for details of permissions on individual groups.'
|
|
||||||
) .
|
|
||||||
"</li>" .
|
|
||||||
$options .
|
$options .
|
||||||
"</ul>\n";
|
"</ul>\n";
|
||||||
} else {
|
} else {
|
||||||
|
@ -41,13 +41,17 @@ if (!defined('BASE_PATH')) {
|
|||||||
define('BASE_PATH', call_user_func(function () {
|
define('BASE_PATH', call_user_func(function () {
|
||||||
// Determine BASE_PATH based on the composer autoloader
|
// Determine BASE_PATH based on the composer autoloader
|
||||||
foreach (debug_backtrace() as $backtraceItem) {
|
foreach (debug_backtrace() as $backtraceItem) {
|
||||||
if (isset($backtraceItem['file'])
|
if (!isset($backtraceItem['file'])) {
|
||||||
&& preg_match(
|
continue;
|
||||||
'#^(?<base>.*)(/|\\\\)vendor(/|\\\\)composer(/|\\\\)autoload_real.php#',
|
}
|
||||||
$backtraceItem['file'],
|
|
||||||
$matches
|
$matched = preg_match(
|
||||||
)
|
'#^(?<base>.*)(/|\\\\)vendor(/|\\\\)composer(/|\\\\)autoload_real.php#',
|
||||||
) {
|
$backtraceItem['file'],
|
||||||
|
$matches
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($matched) {
|
||||||
return realpath($matches['base']) ?: DIRECTORY_SEPARATOR;
|
return realpath($matches['base']) ?: DIRECTORY_SEPARATOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1039,11 +1039,9 @@ class DataListTest extends SapphireTest
|
|||||||
->leftJoin(
|
->leftJoin(
|
||||||
'DataObjectTest_Team',
|
'DataObjectTest_Team',
|
||||||
'"DataObjectTest_Team"."ID" = "DataObjectTest_TeamComment"."TeamID"'
|
'"DataObjectTest_Team"."ID" = "DataObjectTest_TeamComment"."TeamID"'
|
||||||
)->filter(
|
)->filter([
|
||||||
array(
|
|
||||||
'Title' => 'Team 1'
|
'Title' => 'Team 1'
|
||||||
)
|
]);
|
||||||
);
|
|
||||||
|
|
||||||
$this->assertEquals(2, $list->count());
|
$this->assertEquals(2, $list->count());
|
||||||
$values = $list->column('Name');
|
$values = $list->column('Name');
|
||||||
|
Loading…
Reference in New Issue
Block a user