Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
6ab5a3aa
Commit
6ab5a3aa
authored
Apr 30, 2016
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2715741
by Mile23, pfrenssen: Fix 'Drupal.Classes.FullyQualifiedNamespace' coding standard
parent
3eeaeb64
Changes
57
Hide whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
212 additions
and
121 deletions
+212
-121
core/includes/common.inc
core/includes/common.inc
+2
-1
core/includes/form.inc
core/includes/form.inc
+4
-3
core/lib/Drupal/Core/DrupalKernel.php
core/lib/Drupal/Core/DrupalKernel.php
+4
-2
core/lib/Drupal/Core/PageCache/DefaultRequestPolicy.php
core/lib/Drupal/Core/PageCache/DefaultRequestPolicy.php
+4
-2
core/modules/aggregator/src/Tests/ItemCacheTagsTest.php
core/modules/aggregator/src/Tests/ItemCacheTagsTest.php
+2
-1
core/modules/big_pipe/src/Tests/BigPipePlaceholderTestCases.php
...odules/big_pipe/src/Tests/BigPipePlaceholderTestCases.php
+2
-1
core/modules/big_pipe/src/Tests/BigPipeTest.php
core/modules/big_pipe/src/Tests/BigPipeTest.php
+1
-1
core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipeTestController.php
...tests/modules/big_pipe_test/src/BigPipeTestController.php
+2
-1
core/modules/big_pipe/tests/src/Unit/Render/Placeholder/BigPipeStrategyTest.php
...tests/src/Unit/Render/Placeholder/BigPipeStrategyTest.php
+2
-1
core/modules/comment/src/Tests/CommentCacheTagsTest.php
core/modules/comment/src/Tests/CommentCacheTagsTest.php
+1
-1
core/modules/config/tests/config_install_dependency_test/config_install_dependency_test.module
...all_dependency_test/config_install_dependency_test.module
+3
-1
core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module
.../modules/contact_storage_test/contact_storage_test.module
+2
-1
core/modules/field/field.module
core/modules/field/field.module
+4
-3
core/modules/field/tests/fixtures/update/drupal-8.views_entity_reference_plugins-2429191.php
...pdate/drupal-8.views_entity_reference_plugins-2429191.php
+3
-2
core/modules/field/tests/modules/field_test/field_test.module
.../modules/field/tests/modules/field_test/field_test.module
+3
-2
core/modules/field/tests/modules/field_third_party_test/field_third_party_test.module
...ules/field_third_party_test/field_third_party_test.module
+5
-2
core/modules/filter/tests/src/Kernel/FilterAPITest.php
core/modules/filter/tests/src/Kernel/FilterAPITest.php
+3
-3
core/modules/forum/forum.module
core/modules/forum/forum.module
+2
-1
core/modules/locale/locale.bulk.inc
core/modules/locale/locale.bulk.inc
+2
-2
core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php
...es/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php
+1
-1
core/modules/node/tests/modules/node_access_test/node_access_test.module
...de/tests/modules/node_access_test/node_access_test.module
+2
-1
core/modules/node/tests/modules/node_test/node_test.module
core/modules/node/tests/modules/node_test/node_test.module
+2
-1
core/modules/node/tests/src/Kernel/NodeFieldOverridesTest.php
.../modules/node/tests/src/Kernel/NodeFieldOverridesTest.php
+2
-1
core/modules/responsive_image/responsive_image.module
core/modules/responsive_image/responsive_image.module
+5
-3
core/modules/shortcut/src/Tests/ShortcutCacheTagsTest.php
core/modules/shortcut/src/Tests/ShortcutCacheTagsTest.php
+2
-1
core/modules/simpletest/src/TestBase.php
core/modules/simpletest/src/TestBase.php
+2
-1
core/modules/simpletest/src/WebTestBase.php
core/modules/simpletest/src/WebTestBase.php
+2
-1
core/modules/simpletest/tests/src/Unit/TestInfoParsingTest.php
...modules/simpletest/tests/src/Unit/TestInfoParsingTest.php
+3
-3
core/modules/system/src/Tests/Ajax/DialogTest.php
core/modules/system/src/Tests/Ajax/DialogTest.php
+2
-1
core/modules/system/src/Tests/System/FloodTest.php
core/modules/system/src/Tests/System/FloodTest.php
+4
-2
core/modules/system/src/Tests/TypedData/TypedDataTest.php
core/modules/system/src/Tests/TypedData/TypedDataTest.php
+22
-14
core/modules/system/system.module
core/modules/system/system.module
+1
-1
core/modules/system/tests/fixtures/update/drupal-8.block-context-manager-2354889.php
...ixtures/update/drupal-8.block-context-manager-2354889.php
+4
-3
core/modules/system/tests/fixtures/update/drupal-8.local-actions-tasks-into-blocks-507488.php
...pdate/drupal-8.local-actions-tasks-into-blocks-507488.php
+2
-1
core/modules/system/tests/fixtures/update/drupal-8.page-title-into-block-2476947.php
...ixtures/update/drupal-8.page-title-into-block-2476947.php
+2
-1
core/modules/system/tests/fixtures/update/drupal-8.seven-secondary-local-tasks-block-2569529.php
...te/drupal-8.seven-secondary-local-tasks-block-2569529.php
+2
-1
core/modules/system/tests/fixtures/update/drupal-8.site-branding-into-block-2005546.php
...ures/update/drupal-8.site-branding-into-block-2005546.php
+2
-1
core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2455125.php
...tures/update/drupal-8.views-entity-views-data-2455125.php
+2
-1
core/modules/system/tests/fixtures/update/drupal-8.without_automated_cron.php
...tests/fixtures/update/drupal-8.without_automated_cron.php
+3
-1
core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
...stem/tests/modules/ajax_forms_test/ajax_forms_test.module
+31
-17
core/modules/system/tests/modules/entity_test_operation/entity_test_operation.module
...odules/entity_test_operation/entity_test_operation.module
+2
-1
core/modules/system/tests/modules/module_test/src/Controller/ModuleTestController.php
...dules/module_test/src/Controller/ModuleTestController.php
+3
-1
core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
...s/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
+2
-1
core/modules/taxonomy/tests/modules/taxonomy_crud/taxonomy_crud.module
...taxonomy/tests/modules/taxonomy_crud/taxonomy_crud.module
+3
-1
core/modules/views/src/Tests/Plugin/DisplayExtenderTest.php
core/modules/views/src/Tests/Plugin/DisplayExtenderTest.php
+2
-1
core/modules/views/tests/fixtures/update/argument-placeholder.php
...ules/views/tests/fixtures/update/argument-placeholder.php
+5
-2
core/modules/views/tests/fixtures/update/duplicate-field-handler.php
...s/views/tests/fixtures/update/duplicate-field-handler.php
+5
-2
core/modules/views/tests/modules/views_test_data/views_test_data.module
...iews/tests/modules/views_test_data/views_test_data.module
+3
-1
core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
+12
-9
core/modules/views_ui/views_ui.theme.inc
core/modules/views_ui/views_ui.theme.inc
+4
-2
core/phpcs.xml.dist
core/phpcs.xml.dist
+1
-0
core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php
.../tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php
+9
-5
core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php
.../Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php
+3
-2
core/tests/Drupal/Tests/Core/PageCache/NoSessionOpenTest.php
core/tests/Drupal/Tests/Core/PageCache/NoSessionOpenTest.php
+2
-2
core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php
.../Drupal/Tests/Core/ParamConverter/EntityConverterTest.php
+2
-1
core/tests/bootstrap.php
core/tests/bootstrap.php
+3
-1
core/themes/bartik/bartik.theme
core/themes/bartik/bartik.theme
+2
-1
No files found.
core/includes/common.inc
View file @
6ab5a3aa
...
...
@@ -14,6 +14,7 @@
use
Drupal\Component\Utility\SortArray
;
use
Drupal\Component\Utility\UrlHelper
;
use
Drupal\Core\Cache\Cache
;
use
Drupal\Core\Render\Element\Link
;
use
Drupal\Core\Render\Markup
;
use
Drupal\Core\StringTranslation\TranslatableMarkup
;
use
Drupal\Core\PhpStorage\PhpStorageFactory
;
...
...
@@ -748,7 +749,7 @@ function drupal_clear_js_cache() {
* Use \Drupal\Core\Render\Element\Link::preRenderLink().
*/
function
drupal_pre_render_link
(
$element
)
{
return
Element\
Link
::
preRenderLink
(
$element
);
return
Link
::
preRenderLink
(
$element
);
}
/**
...
...
core/includes/form.inc
View file @
6ab5a3aa
...
...
@@ -7,6 +7,7 @@
use
Drupal\Component\Utility\UrlHelper
;
use
Drupal\Core\Render\Element
;
use
Drupal\Core\Render\Element\RenderElement
;
use
Drupal\Core\Template\Attribute
;
use
Drupal\Core\Url
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
...
...
@@ -29,7 +30,7 @@
function
template_preprocess_select
(
&
$variables
)
{
$element
=
$variables
[
'element'
];
Element
::
setAttributes
(
$element
,
array
(
'id'
,
'name'
,
'size'
));
Element\
RenderElement
::
setAttributes
(
$element
,
array
(
'form-select'
));
RenderElement
::
setAttributes
(
$element
,
array
(
'form-select'
));
$variables
[
'attributes'
]
=
$element
[
'#attributes'
];
$variables
[
'options'
]
=
form_select_options
(
$element
);
...
...
@@ -191,7 +192,7 @@ function form_get_options($element, $key) {
function
template_preprocess_fieldset
(
&
$variables
)
{
$element
=
$variables
[
'element'
];
Element
::
setAttributes
(
$element
,
array
(
'id'
));
Element\
RenderElement
::
setAttributes
(
$element
);
RenderElement
::
setAttributes
(
$element
);
$variables
[
'attributes'
]
=
isset
(
$element
[
'#attributes'
])
?
$element
[
'#attributes'
]
:
array
();
$variables
[
'prefix'
]
=
isset
(
$element
[
'#field_prefix'
])
?
$element
[
'#field_prefix'
]
:
NULL
;
$variables
[
'suffix'
]
=
isset
(
$element
[
'#field_suffix'
])
?
$element
[
'#field_suffix'
]
:
NULL
;
...
...
@@ -376,7 +377,7 @@ function template_preprocess_form(&$variables) {
function
template_preprocess_textarea
(
&
$variables
)
{
$element
=
$variables
[
'element'
];
Element
::
setAttributes
(
$element
,
array
(
'id'
,
'name'
,
'rows'
,
'cols'
,
'placeholder'
));
Element\
RenderElement
::
setAttributes
(
$element
,
array
(
'form-textarea'
));
RenderElement
::
setAttributes
(
$element
,
array
(
'form-textarea'
));
$variables
[
'wrapper_attributes'
]
=
new
Attribute
();
$variables
[
'attributes'
]
=
new
Attribute
(
$element
[
'#attributes'
]);
$variables
[
'value'
]
=
$element
[
'#value'
];
...
...
core/lib/Drupal/Core/DrupalKernel.php
View file @
6ab5a3aa
...
...
@@ -2,6 +2,7 @@
namespace
Drupal\Core
;
use
Drupal\Component\Assertion\Handle
;
use
Drupal\Component\FileCache\FileCacheFactory
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Component\Utility\UrlHelper
;
...
...
@@ -18,6 +19,7 @@
use
Drupal\Core\Language\Language
;
use
Drupal\Core\Site\Settings
;
use
Symfony\Cmf\Component\Routing\RouteObjectInterface
;
use
Symfony\Component\ClassLoader\ApcClassLoader
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\DependencyInjection\ParameterBag\ParameterBag
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
...
...
@@ -923,7 +925,7 @@ public static function bootEnvironment() {
assert_options
(
ASSERT_ACTIVE
,
TRUE
);
// Now synchronize PHP 5 and 7's handling of assertions as much as
// possible.
\
Drupal\Component\Assertion\
Handle
::
register
();
Handle
::
register
();
// Log fatal errors to the test site directory.
ini_set
(
'log_errors'
,
1
);
...
...
@@ -978,7 +980,7 @@ protected function initializeSettings(Request $request) {
&&
Settings
::
get
(
'class_loader_auto_detect'
,
TRUE
)
&&
extension_loaded
(
'apc'
))
{
$prefix
=
Settings
::
getApcuPrefix
(
'class_loader'
,
$this
->
root
);
$apc_loader
=
new
\
Symfony\Component\ClassLoader\
ApcClassLoader
(
$prefix
,
$this
->
classLoader
);
$apc_loader
=
new
ApcClassLoader
(
$prefix
,
$this
->
classLoader
);
$this
->
classLoader
->
unregister
();
$apc_loader
->
register
();
$this
->
classLoader
=
$apc_loader
;
...
...
core/lib/Drupal/Core/PageCache/DefaultRequestPolicy.php
View file @
6ab5a3aa
...
...
@@ -2,6 +2,8 @@
namespace
Drupal\Core\PageCache
;
use
Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod
;
use
Drupal\Core\PageCache\RequestPolicy\NoSessionOpen
;
use
Drupal\Core\Session\SessionConfigurationInterface
;
/**
...
...
@@ -20,8 +22,8 @@ class DefaultRequestPolicy extends ChainRequestPolicy {
* The session configuration.
*/
public
function
__construct
(
SessionConfigurationInterface
$session_configuration
)
{
$this
->
addPolicy
(
new
RequestPolicy\
CommandLineOrUnsafeMethod
());
$this
->
addPolicy
(
new
RequestPolicy\
NoSessionOpen
(
$session_configuration
));
$this
->
addPolicy
(
new
CommandLineOrUnsafeMethod
());
$this
->
addPolicy
(
new
NoSessionOpen
(
$session_configuration
));
}
}
core/modules/aggregator/src/Tests/ItemCacheTagsTest.php
View file @
6ab5a3aa
...
...
@@ -4,6 +4,7 @@
use
Drupal\aggregator\Entity\Feed
;
use
Drupal\aggregator\Entity\Item
;
use
Drupal\Core\Cache\CacheBackendInterface
;
use
Drupal\system\Tests\Entity\EntityCacheTagsTestBase
;
use
Drupal\user\Entity\Role
;
use
Drupal\user\RoleInterface
;
...
...
@@ -63,7 +64,7 @@ protected function createEntity() {
*/
public
function
testEntityCreation
()
{
// Create a cache entry that is tagged with a feed cache tag.
\
Drupal
::
cache
(
'render'
)
->
set
(
'foo'
,
'bar'
,
\
Drupal\Core\Cache\
CacheBackendInterface
::
CACHE_PERMANENT
,
$this
->
entity
->
getCacheTags
());
\
Drupal
::
cache
(
'render'
)
->
set
(
'foo'
,
'bar'
,
CacheBackendInterface
::
CACHE_PERMANENT
,
$this
->
entity
->
getCacheTags
());
// Verify a cache hit.
$this
->
verifyRenderCache
(
'foo'
,
array
(
'aggregator_feed:1'
));
...
...
core/modules/big_pipe/src/Tests/BigPipePlaceholderTestCases.php
View file @
6ab5a3aa
...
...
@@ -9,6 +9,7 @@
use
Drupal\big_pipe
\
Render\BigPipeMarkup
;
use
Drupal\Core\Session\AccountInterface
;
use
Drupal\Core\StringTranslation\PluralTranslatableMarkup
;
use
Drupal\Core\Url
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
...
@@ -93,7 +94,7 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf
'theme'
=>
'classy'
,
'libraries'
=>
'big_pipe/big_pipe,classy/base,classy/messages,core/drupal.active-link,core/html5shiv,core/normalize,system/base'
,
],
'pluralDelimiter'
=>
\
Drupal\Core\StringTranslation\
PluralTranslatableMarkup
::
DELIMITER
,
'pluralDelimiter'
=>
PluralTranslatableMarkup
::
DELIMITER
,
'user'
=>
[
'uid'
=>
'1'
,
'permissionsHash'
=>
$container
->
get
(
'user_permissions_hash_generator'
)
->
generate
(
$user
),
...
...
core/modules/big_pipe/src/Tests/BigPipeTest.php
View file @
6ab5a3aa
...
...
@@ -361,7 +361,7 @@ protected function getTestCases() {
$csrf_token_seed
=
unserialize
(
explode
(
'_sf2_meta|'
,
$session_data
)[
1
])[
's'
];
$this
->
container
->
get
(
'session_manager.metadata_bag'
)
->
setCsrfTokenSeed
(
$csrf_token_seed
);
return
\
Drupal\big_pipe\Tests\
BigPipePlaceholderTestCases
::
cases
(
$this
->
container
,
$this
->
rootUser
);
return
BigPipePlaceholderTestCases
::
cases
(
$this
->
container
,
$this
->
rootUser
);
}
/**
...
...
core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipeTestController.php
View file @
6ab5a3aa
...
...
@@ -3,6 +3,7 @@
namespace
Drupal\big_pipe_test
;
use
Drupal\big_pipe
\
Render\BigPipeMarkup
;
use
Drupal\big_pipe
\
Tests\BigPipePlaceholderTestCases
;
use
Drupal\big_pipe_test
\
EventSubscriber\BigPipeTestSubscriber
;
class
BigPipeTestController
{
...
...
@@ -15,7 +16,7 @@ class BigPipeTestController {
public
function
test
()
{
$build
=
[];
$cases
=
\
Drupal\big_pipe\Tests\
BigPipePlaceholderTestCases
::
cases
(
\
Drupal
::
getContainer
());
$cases
=
BigPipePlaceholderTestCases
::
cases
(
\
Drupal
::
getContainer
());
// 1. HTML placeholder: status messages. Drupal renders those automatically,
// so all that we need to do in this controller is set a message.
...
...
core/modules/big_pipe/tests/src/Unit/Render/Placeholder/BigPipeStrategyTest.php
View file @
6ab5a3aa
...
...
@@ -3,6 +3,7 @@
namespace
Drupal\Tests\big_pipe\Unit\Render\Placeholder
;
use
Drupal\big_pipe
\
Render\Placeholder\BigPipeStrategy
;
use
Drupal\big_pipe
\
Tests\BigPipePlaceholderTestCases
;
use
Drupal\Core\Routing\RouteMatchInterface
;
use
Drupal\Core\Session\SessionConfigurationInterface
;
use
Drupal\Tests\UnitTestCase
;
...
...
@@ -61,7 +62,7 @@ public function testProcessPlaceholders(array $placeholders, $method, $route_mat
* @see \Drupal\big_pipe\Tests\BigPipePlaceholderTestCases
*/
public
function
placeholdersProvider
()
{
$cases
=
\
Drupal\big_pipe\Tests\
BigPipePlaceholderTestCases
::
cases
();
$cases
=
BigPipePlaceholderTestCases
::
cases
();
// Generate $placeholders variable as expected by
// \Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface::processPlaceholders().
...
...
core/modules/comment/src/Tests/CommentCacheTagsTest.php
View file @
6ab5a3aa
...
...
@@ -82,7 +82,7 @@ protected function createEntity() {
'entity_id'
=>
$this
->
entityTestCamelid
->
id
(),
'entity_type'
=>
'entity_test'
,
'field_name'
=>
'comment'
,
'status'
=>
\
Drupal\comment\
CommentInterface
::
PUBLISHED
,
'status'
=>
CommentInterface
::
PUBLISHED
,
));
$comment
->
save
();
...
...
core/modules/config/tests/config_install_dependency_test/config_install_dependency_test.module
View file @
6ab5a3aa
...
...
@@ -5,10 +5,12 @@
* Provides hook implementations for testing purposes.
*/
use
Drupal\Core\Entity\EntityInterface
;
/**
* Implements hook_ENTITY_TYPE_create.
*/
function
config_install_dependency_test_config_test_create
(
\
Drupal\Core\Entity\
EntityInterface
$entity
)
{
function
config_install_dependency_test_config_test_create
(
EntityInterface
$entity
)
{
// Add an enforced dependency on this module so that we can test if this is
// possible during module installation.
$entity
->
setEnforcedDependencies
([
'module'
=>
[
'config_install_dependency_test'
]]);
...
...
core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module
View file @
6ab5a3aa
...
...
@@ -6,13 +6,14 @@
*/
use
Drupal\contact\ContactFormInterface
;
use
Drupal\Core\Entity\EntityTypeInterface
;
use
Drupal\Core\Field\BaseFieldDefinition
;
use
Drupal\Core\Form\FormStateInterface
;
/**
* Implements hook_entity_base_field_info().
*/
function
contact_storage_test_entity_base_field_info
(
\
Drupal\Core\Entity\
EntityTypeInterface
$entity_type
)
{
function
contact_storage_test_entity_base_field_info
(
EntityTypeInterface
$entity_type
)
{
if
(
$entity_type
->
id
()
==
'contact_message'
)
{
$fields
=
array
();
...
...
core/modules/field/field.module
View file @
6ab5a3aa
...
...
@@ -7,6 +7,7 @@
use
Drupal\Core\Config\ConfigImporter
;
use
Drupal\Core\Entity\EntityTypeInterface
;
use
Drupal\Core\Entity\DynamicallyFieldableEntityStorageInterface
;
use
Drupal\field\ConfigImporterFieldPurger
;
use
Drupal\field\Entity\FieldConfig
;
use
Drupal\field\Entity\FieldStorageConfig
;
use
Drupal\field\FieldConfigInterface
;
...
...
@@ -168,7 +169,7 @@ function field_cron() {
/**
* Implements hook_entity_field_storage_info().
*/
function
field_entity_field_storage_info
(
\
Drupal\Core\Entity\
EntityTypeInterface
$entity_type
)
{
function
field_entity_field_storage_info
(
EntityTypeInterface
$entity_type
)
{
if
(
\
Drupal
::
entityManager
()
->
getStorage
(
$entity_type
->
id
())
instanceof
DynamicallyFieldableEntityStorageInterface
)
{
// Query by filtering on the ID as this is more efficient than filtering
// on the entity_type property directly.
...
...
@@ -301,7 +302,7 @@ function _field_create_entity_from_ids($ids) {
* Implements hook_config_import_steps_alter().
*/
function
field_config_import_steps_alter
(
&
$sync_steps
,
ConfigImporter
$config_importer
)
{
$field_storages
=
\
Drupal\field\
ConfigImporterFieldPurger
::
getFieldStoragesToPurge
(
$field_storages
=
ConfigImporterFieldPurger
::
getFieldStoragesToPurge
(
$config_importer
->
getStorageComparer
()
->
getSourceStorage
()
->
read
(
'core.extension'
),
$config_importer
->
getStorageComparer
()
->
getChangelist
(
'delete'
)
);
...
...
@@ -327,7 +328,7 @@ function field_form_config_admin_import_form_alter(&$form, FormStateInterface $f
$user_input
=
$form_state
->
getUserInput
();
$storage_comparer
=
$form_state
->
get
(
'storage_comparer'
);
if
(
$storage_comparer
&&
empty
(
$user_input
))
{
$field_storages
=
\
Drupal\field\
ConfigImporterFieldPurger
::
getFieldStoragesToPurge
(
$field_storages
=
ConfigImporterFieldPurger
::
getFieldStoragesToPurge
(
$storage_comparer
->
getSourceStorage
()
->
read
(
'core.extension'
),
$storage_comparer
->
getChangelist
(
'delete'
)
);
...
...
core/modules/field/tests/fixtures/update/drupal-8.views_entity_reference_plugins-2429191.php
View file @
6ab5a3aa
...
...
@@ -8,6 +8,7 @@
use
Drupal\Core\Database\Database
;
use
Drupal\Component\Serialization\Yaml
;
use
Drupal\field\Entity\FieldStorageConfig
;
$connection
=
Database
::
getConnection
();
...
...
@@ -59,8 +60,8 @@
->
execute
()
->
fetchField
();
$installed
=
unserialize
(
$installed
);
$installed
[
'field_ref_views_select_2429191'
]
=
new
\
Drupal\field\Entity\
FieldStorageConfig
(
$field_ref_views_select_2429191
);
$installed
[
'field_ref_autocreate_2412569'
]
=
new
\
Drupal\field\Entity\
FieldStorageConfig
(
$field_ref_autocreate_2412569
);
$installed
[
'field_ref_views_select_2429191'
]
=
new
FieldStorageConfig
(
$field_ref_views_select_2429191
);
$installed
[
'field_ref_autocreate_2412569'
]
=
new
FieldStorageConfig
(
$field_ref_autocreate_2412569
);
$connection
->
update
(
'key_value'
)
->
condition
(
'collection'
,
'entity.definitions.installed'
)
->
condition
(
'name'
,
'node.field_storage_definitions'
)
...
...
core/modules/field/tests/modules/field_test/field_test.module
View file @
6ab5a3aa
...
...
@@ -13,8 +13,9 @@
* test helper functions
*/
use
Drupal\
field\FieldStorageConfig
Interface
;
use
Drupal\
Core\Entity\EntityType
Interface
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\field\FieldStorageConfigInterface
;
require_once
__DIR__
.
'/field_test.entity.inc'
;
require_once
__DIR__
.
'/field_test.field.inc'
;
...
...
@@ -149,7 +150,7 @@ function field_test_entity_extra_field_info_alter(&$info) {
/**
* Implements hook_entity_bundle_field_info_alter().
*/
function
field_test_entity_bundle_field_info_alter
(
&
$fields
,
\
Drupal\Core\Entity\
EntityTypeInterface
$entity_type
,
$bundle
)
{
function
field_test_entity_bundle_field_info_alter
(
&
$fields
,
EntityTypeInterface
$entity_type
,
$bundle
)
{
if
((
$field_name
=
\
Drupal
::
state
()
->
get
(
'field_test_set_constraint'
,
FALSE
))
&&
$entity_type
->
id
()
==
'entity_test'
&&
$bundle
==
'entity_test'
&&
!
empty
(
$fields
[
$field_name
]))
{
$fields
[
$field_name
]
->
setPropertyConstraints
(
'value'
,
[
'Range'
=>
[
...
...
core/modules/field/tests/modules/field_third_party_test/field_third_party_test.module
View file @
6ab5a3aa
...
...
@@ -5,12 +5,15 @@
* Test module.
*/
use
Drupal\Core\Field\FieldDefinitionInterface
;
use
Drupal\Core\Field\FormatterInterface
;
use
Drupal\Core\Field\WidgetInterface
;
use
Drupal\Core\Form\FormStateInterface
;
/**
* Implements hook_field_widget_third_party_settings_form().
*/
function
field_third_party_test_field_widget_third_party_settings_form
(
\
Drupal\Core\Field\
WidgetInterface
$plugin
,
\
Drupal\Core\Field\
FieldDefinitionInterface
$field_definition
,
$form_mode
,
$form
,
FormStateInterface
$form_state
)
{
function
field_third_party_test_field_widget_third_party_settings_form
(
WidgetInterface
$plugin
,
FieldDefinitionInterface
$field_definition
,
$form_mode
,
$form
,
FormStateInterface
$form_state
)
{
$element
[
'field_test_widget_third_party_settings_form'
]
=
array
(
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'3rd party widget settings form'
),
...
...
@@ -30,7 +33,7 @@ function field_third_party_test_field_widget_settings_summary_alter(&$summary, $
/**
* Implements hook_field_formatter_third_party_settings_form().
*/
function
field_third_party_test_field_formatter_third_party_settings_form
(
\
Drupal\Core\Field\
FormatterInterface
$plugin
,
\
Drupal\Core\Field\
FieldDefinitionInterface
$field_definition
,
$view_mode
,
$form
,
FormStateInterface
$form_state
)
{
function
field_third_party_test_field_formatter_third_party_settings_form
(
FormatterInterface
$plugin
,
FieldDefinitionInterface
$field_definition
,
$view_mode
,
$form
,
FormStateInterface
$form_state
)
{
$element
[
'field_test_field_formatter_third_party_settings_form'
]
=
array
(
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'3rd party formatter settings form'
),
...
...
core/modules/filter/tests/src/Kernel/FilterAPITest.php
View file @
6ab5a3aa
...
...
@@ -207,7 +207,7 @@ function testFilterFormatAPI() {
// Test on nonsensical_restricted_html, where the allowed attribute values
// contain asterisks, which do not have any meaning, but which we also
// cannot prevent because configuration can be modified outside of forms.
$nonsensical_restricted_html
=
\
Drupal\filter\Entity\
FilterFormat
::
create
(
array
(
$nonsensical_restricted_html
=
FilterFormat
::
create
(
array
(
'format'
=>
'nonsensical_restricted_html'
,
'name'
=>
'Nonsensical Restricted HTML'
,
'filters'
=>
array
(
...
...
@@ -468,7 +468,7 @@ public function assertFilterFormatViolation(ConstraintViolationListInterface $vi
*/
public
function
testDependencyRemoval
()
{
$this
->
installSchema
(
'user'
,
array
(
'users_data'
));
$filter_format
=
\
Drupal\filter\Entity\
FilterFormat
::
load
(
'filtered_html'
);
$filter_format
=
FilterFormat
::
load
(
'filtered_html'
);
// Disable the filter_test_restrict_tags_and_attributes filter plugin but
// have custom configuration so that the filter plugin is still configured
...
...
@@ -498,7 +498,7 @@ public function testDependencyRemoval() {
// Verify the filter format still exists but the dependency and filter is
// gone.
\
Drupal
::
entityManager
()
->
getStorage
(
'filter_format'
)
->
resetCache
();
$filter_format
=
\
Drupal\filter\Entity\
FilterFormat
::
load
(
'filtered_html'
);
$filter_format
=
FilterFormat
::
load
(
'filtered_html'
);
$this
->
assertEqual
([],
$filter_format
->
getDependencies
());
// Use the get method since the FilterFormat::filters() method only returns
// existing plugins.
...
...
core/modules/forum/forum.module
View file @
6ab5a3aa
...
...
@@ -8,6 +8,7 @@
use
Drupal\comment\CommentInterface
;
use
Drupal\comment\Plugin\Field\FieldType\CommentItemInterface
;
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Entity\EntityTypeInterface
;
use
Drupal\Core\Url
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Routing\RouteMatchInterface
;
...
...
@@ -134,7 +135,7 @@ function forum_uri($forum) {
/**
* Implements hook_entity_bundle_field_info_alter().
*/
function
forum_entity_bundle_field_info_alter
(
&
$fields
,
\
Drupal\Core\Entity\
EntityTypeInterface
$entity_type
,
$bundle
)
{
function
forum_entity_bundle_field_info_alter
(
&
$fields
,
EntityTypeInterface
$entity_type
,
$bundle
)
{
if
(
$entity_type
->
id
()
==
'node'
&&
!
empty
(
$fields
[
'taxonomy_forums'
]))
{
$fields
[
'taxonomy_forums'
]
->
addConstraint
(
'ForumLeaf'
,
[]);
}
...
...
core/modules/locale/locale.bulk.inc
View file @
6ab5a3aa
...
...
@@ -340,7 +340,7 @@ function locale_translate_batch_refresh(&$context) {
// Clear cache and force refresh of JavaScript translations.
_locale_refresh_translations
(
$context
[
'sandbox'
][
'refresh'
][
'languages'
],
$next
);
// Check whether we need to refresh configuration objects.
if
(
$names
=
\
Drupal\locale\
Locale
::
config
()
->
getStringNames
(
$next
))
{
if
(
$names
=
Locale
::
config
()
->
getStringNames
(
$next
))
{
$context
[
'sandbox'
][
'refresh'
][
'names_finished'
]
=
$context
[
'finished'
];
$context
[
'sandbox'
][
'refresh'
][
'names'
]
=
$names
;
}
...
...
@@ -533,7 +533,7 @@ function locale_translate_delete_translation_files(array $projects = array(), ar
*/
function
locale_config_batch_update_components
(
array
$options
,
array
$langcodes
=
array
(),
array
$components
=
array
())
{
$langcodes
=
$langcodes
?
$langcodes
:
array_keys
(
\
Drupal
::
languageManager
()
->
getLanguages
());
if
(
$langcodes
&&
$names
=
\
Drupal\locale\
Locale
::
config
()
->
getComponentNames
(
$components
))
{
if
(
$langcodes
&&
$names
=
Locale
::
config
()
->
getComponentNames
(
$components
))
{
return
locale_config_batch_build
(
$names
,
$langcodes
,
$options
);
}
}
...
...
core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php
View file @
6ab5a3aa
...
...
@@ -67,7 +67,7 @@ protected function setUp() {
// @see locale_system_update()
locale_system_set_config_langcodes
();
$langcodes
=
array_keys
(
\
Drupal
::
languageManager
()
->
getLanguages
());
$names
=
\
Drupal\locale\
Locale
::
config
()
->
getComponentNames
();
$names
=
Locale
::
config
()
->
getComponentNames
();
Locale
::
config
()
->
updateConfigTranslations
(
$names
,
$langcodes
);
$this
->
configFactory
=
$this
->
container
->
get
(
'config.factory'
);
...
...
core/modules/node/tests/modules/node_access_test/node_access_test.module
View file @
6ab5a3aa
...
...
@@ -19,6 +19,7 @@
* @see \Drupal\node\Tests\NodeAccessBaseTableTest
*/
use
Drupal\Core\Session\AccountInterface
;
use
Drupal\Core\Access\AccessResult
;
use
Drupal\field\Entity\FieldStorageConfig
;
use
Drupal\field\Entity\FieldConfig
;
...
...
@@ -144,7 +145,7 @@ function node_access_test_add_field(NodeTypeInterface $type) {
/**
* Implements hook_node_access().
*/
function
node_access_test_node_access
(
\
Drupal\node\
NodeInterface
$node
,
$op
,
\
Drupal\Core\Session\
AccountInterface
$account
)
{
function
node_access_test_node_access
(
NodeInterface
$node
,
$op
,
AccountInterface
$account
)
{
$secret_catalan
=
\
Drupal
::
state
()
->
get
(
'node_access_test_secret_catalan'
)
?:
0
;
if
(
$secret_catalan
&&
$node
->
language
()
->
getId
()
==
'ca'
)
{
...
...
core/modules/node/tests/modules/node_test/node_test.module
View file @
6ab5a3aa
...
...
@@ -8,6 +8,7 @@
* interaction with the Node module.
*/
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Entity\Display\EntityViewDisplayInterface
;
use
Drupal\Core\Session\AccountInterface
;
use
Drupal\node\NodeInterface
;
...
...
@@ -151,7 +152,7 @@ function node_test_node_update(NodeInterface $node) {
/**
* Implements hook_entity_view_mode_alter().
*/
function
node_test_entity_view_mode_alter
(
&
$view_mode
,
Drupal\Core\Entity\
EntityInterface
$entity
,
$context
)
{
function
node_test_entity_view_mode_alter
(
&
$view_mode
,
EntityInterface
$entity
,
$context
)
{
// Only alter the view mode if we are on the test callback.
$change_view_mode
=
\
Drupal
::
state
()
->
get
(
'node_test_change_view_mode'
)
?:
''
;
if
(
$change_view_mode
)
{
...
...
core/modules/node/tests/src/Kernel/NodeFieldOverridesTest.php
View file @
6ab5a3aa
...
...
@@ -2,6 +2,7 @@
namespace
Drupal\Tests\node\Kernel
;
use
Drupal\user\UserInterface
;
use
Drupal\Core\Field\Entity\BaseFieldOverride
;
use
Drupal\KernelTests\Core\Entity\EntityKernelTestBase
;
use
Drupal\node\Entity\Node
;
...
...
@@ -56,7 +57,7 @@ public function testFieldOverrides() {
/** @var \Drupal\node\NodeInterface $node */
$node
=
Node
::
create
([
'type'
=>
'ponies'
]);
$owner
=
$node
->
getOwner
();
$this
->
assertTrue
(
$owner
instanceof
\
Drupal\user\
UserInterface
);
$this
->
assertTrue
(
$owner
instanceof
UserInterface
);
$this
->
assertEqual
(
$owner
->
id
(),
$this
->
user
->
id
());
}
...
...
core/modules/responsive_image/responsive_image.module
View file @
6ab5a3aa
...
...
@@ -5,6 +5,8 @@
* Responsive image display formatter for image fields.
*/
use
Drupal\Core\Template\Attribute
;
use
Drupal\Core\Logger\RfcLogLevel
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Core\Routing\RouteMatchInterface
;
use
Drupal\image\Entity\ImageStyle
;
...
...
@@ -162,7 +164,7 @@ function template_preprocess_responsive_image(&$variables) {
// execution.
if
(
!
$responsive_image_style
)
{
$variables
[
'img_element'
]
=
[];
\
Drupal
::
logger
(
'responsive_image'
)
->
log
(
\
Drupal\Core\Logger\
RfcLogLevel
::
ERROR
,
'Failed to load responsive image style: “@style“ while displaying responsive image.'
,
[
'@style'
=>
$variables
[
'responsive_image_style_id'
]]);
\
Drupal
::
logger
(
'responsive_image'
)
->
log
(
RfcLogLevel
::
ERROR
,
'Failed to load responsive image style: “@style“ while displaying responsive image.'
,
[
'@style'
=>
$variables
[
'responsive_image_style_id'
]]);
return
;
}
// Retrieve all breakpoints and multipliers and reverse order of breakpoints.
...
...
@@ -411,7 +413,7 @@ function responsive_image_build_source_attributes(ImageInterface $image, array $
}
// Sort the srcset from small to large image width or multiplier.
ksort
(
$srcset
);
$source_attributes
=
new
\
Drupal\Core\Template\
Attribute
(
array
(
$source_attributes
=
new
Attribute
(
array
(
'srcset'
=>
implode
(
', '
,
array_unique
(
$srcset
)),
));
$media_query
=
trim
(
$breakpoint
->
getMediaQuery
());
...
...
@@ -494,7 +496,7 @@ function _responsive_image_image_style_url($style_name, $path) {
return
'data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='
;
}
$entity
=
ImageStyle
::
load
(
$style_name
);
if
(
$entity
instanceof
Drupal\image\Entity\
ImageStyle
)
{
if
(
$entity
instanceof
ImageStyle
)
{
return
file_url_transform_relative
(
$entity
->
buildUrl
(
$path
));
}
return
file_url_transform_relative
(
file_create_url
(
$path
));
...
...
core/modules/shortcut/src/Tests/ShortcutCacheTagsTest.php
View file @
6ab5a3aa
...
...
@@ -2,6 +2,7 @@
namespace
Drupal\shortcut\Tests
;
use
Drupal\Core\Cache\CacheBackendInterface
;
use
Drupal\shortcut\Entity\Shortcut
;
use
Drupal\system\Tests\Entity\EntityCacheTagsTestBase
;
use
Drupal\user\Entity\Role
;
...
...
@@ -55,7 +56,7 @@ protected function createEntity() {
public
function
testEntityCreation
()
{
// Create a cache entry that is tagged with a shortcut set cache tag.
$cache_tags
=
[
'config:shortcut.set.default'
];
\
Drupal
::
cache
(
'render'
)
->
set
(
'foo'
,
'bar'
,
\
Drupal\Core\Cache\
CacheBackendInterface
::
CACHE_PERMANENT
,
$cache_tags
);
\
Drupal
::
cache
(
'render'
)
->
set
(
'foo'
,
'bar'
,
CacheBackendInterface
::
CACHE_PERMANENT
,
$cache_tags
);
// Verify a cache hit.
$this
->
verifyRenderCache
(
'foo'
,
$cache_tags
);
...
...
core/modules/simpletest/src/TestBase.php
View file @
6ab5a3aa
...
...
@@ -2,6 +2,7 @@
namespace
Drupal\simpletest
;
use
Drupal\Component\Assertion\Handle
;
use
Drupal\Component\Render\MarkupInterface
;
use
Drupal\Component\Utility\Crypt
;
use
Drupal\Component\Utility\SafeMarkup
;
...
...
@@ -1019,7 +1020,7 @@ public function run(array $methods = array()) {
// Force assertion failures to be thrown as AssertionError for PHP 5 & 7
// compatibility.
\
Drupal\Component\Assertion\
Handle
::
register
();
Handle
::
register
();
set_error_handler
(
array
(
$this
,
'errorHandler'
));
// Iterate through all the methods in this class, unless a specific list of
...
...
core/modules/simpletest/src/WebTestBase.php
View file @
6ab5a3aa
...
...
@@ -27,6 +27,7 @@
use
Drupal\Core\Url
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\Yaml\Yaml
as
SymfonyYaml
;
use
Zend\Diactoros\Uri
;
/**
...
...
@@ -635,7 +636,7 @@ protected function prepareSettings() {
copy
(
$settings_services_file
,
$directory
.
'/services.yml'
);
if
(
$this
->
strictConfigSchema
)
{
// Add a listener to validate configuration schema on save.
$yaml
=
new
\
Symfony
\Component\Yaml\
Yaml
();
$yaml
=
new
SymfonyYaml
();
$content
=
file_get_contents
(
$directory
.
'/services.yml'
);
$services
=
$yaml
->
parse
(
$content
);
$services
[
'services'
][
'simpletest.config_schema_checker'
]
=
[
...
...
core/modules/simpletest/tests/src/Unit/TestInfoParsingTest.php
View file @
6ab5a3aa
...
...
@@ -25,7 +25,7 @@ class TestInfoParsingTest extends UnitTestCase {
* @dataProvider infoParserProvider
*/
public
function
testTestInfoParser
(
$expected
,
$classname
,
$doc_comment
=
NULL
)
{
$info
=
\
Drupal\simpletest\
TestDiscovery
::
getTestInfo
(
$classname
,
$doc_comment
);
$info
=
TestDiscovery
::
getTestInfo
(
$classname
,
$doc_comment
);
$this
->
assertEquals
(
$expected
,
$info
);
}
...
...
@@ -245,7 +245,7 @@ public function testTestInfoParserMissingGroup() {
* Bulk delete storages and fields, and clean up afterwards.
*/
EOT;
\
Drupal\simpletest\
TestDiscovery
::
getTestInfo
(
$classname
,
$doc_comment
);
TestDiscovery
::
getTestInfo
(
$classname
,
$doc_comment
);
}
/**
...
...
@@ -258,7 +258,7 @@ public function testTestInfoParserMissingSummary() {
* @group field
*/
EOT;
$info
=
\
Drupal\simpletest\
TestDiscovery
::
getTestInfo
(
$classname
,
$doc_comment
);
$info
=
TestDiscovery
::
getTestInfo
(
$classname
,
$doc_comment
);
$this
->
assertEmpty
(
$info
[
'description'
]);
}
...
...
core/modules/system/src/Tests/Ajax/DialogTest.php
View file @
6ab5a3aa
...
...
@@ -2,6 +2,7 @@
namespace
Drupal\system\Tests\Ajax
;
use
Drupal\ajax_test
\
Controller\AjaxTestController
;
use
Drupal\Core\EventSubscriber\MainContentViewSubscriber
;
use
Drupal\Core\Form\FormBuilderInterface
;
use
Drupal\Core\Url
;
...
...
@@ -29,7 +30,7 @@ public function testDialog() {
$this
->
drupalGet
(
'ajax-test/dialog'
);
// Set up variables for this test.
$dialog_renderable
=
\
Drupal\ajax_test\Controller\
AjaxTestController
::
dialogContents
();