Unverified Commit 0eec7fe5 authored by alexpott's avatar alexpott

Issue #3138746 by jungle, rajandro, sja112, longwave, jameszhang023, quietone,...

Issue #3138746 by jungle, rajandro, sja112, longwave, jameszhang023, quietone, dww: Fix 45 "shouldBeCamelCased" and related typos in core
parent 23116573
......@@ -230,9 +230,9 @@
* Sample Database configuration format for a driver in a contributed module:
* @code
* $databases['default']['default'] = [
* 'driver' => 'mydriver',
* 'namespace' => 'Drupal\mymodule\Driver\Database\mydriver',
* 'autoload' => 'modules/mymodule/src/Driver/Database/mydriver/',
* 'driver' => 'my_driver',
* 'namespace' => 'Drupal\my_module\Driver\Database\my_driver',
* 'autoload' => 'modules/my_module/src/Driver/Database/my_driver/',
* 'database' => 'databasename',
* 'username' => 'sqlusername',
* 'password' => 'sqlpassword',
......
......@@ -382,10 +382,10 @@
* be an admin path). Here's an example using the configurable_language config
* entity:
* @code
* mymodule.myroute:
* path: '/admin/mypath/{configurable_language}'
* my_module.my_route:
* path: '/admin/my-path/{configurable_language}'
* defaults:
* _controller: '\Drupal\mymodule\MyController::myMethod'
* _controller: '\Drupal\my_module\MyController::myMethod'
* options:
* parameters:
* configurable_language:
......@@ -809,7 +809,7 @@
* arguments, but they all include an argument $container of type
* \Symfony\Component\DependencyInjection\ContainerInterface.
* If you are defining one of these classes, in the create() or
* createInstance() method, call $container->get('myservice.name') to
* createInstance() method, call $container->get('my_service.name') to
* instantiate a service. The results of these calls are generally passed to
* the class constructor and saved as member variables in the class.
* - For functions and class methods that do not have access to either of
......@@ -837,7 +837,7 @@
* @section sec_define Defining a service
* If your module needs to define a new service, here are the steps:
* - Choose a unique machine name for your service. Typically, this should
* start with your module name. Example: mymodule.myservice.
* start with your module name. Example: my_module.my_service.
* - Create a PHP interface to define what your service does.
* - Create a default class implementing your interface that provides your
* service. If your class needs to use existing services (such as database
......
......@@ -577,7 +577,7 @@ function template_preprocess_form_element_label(&$variables) {
* array('my_function_2', array()),
* ),
* 'finished' => 'my_finished_callback',
* 'file' => 'path_to_file_containing_myfunctions',
* 'file' => 'path_to_file_containing_my_functions',
* );
* batch_set($batch);
* // Only needed if not inside a form _submit handler.
......
......@@ -184,7 +184,7 @@ public function deleteAll() {
* {@inheritdoc}
*/
public function invalidate($cid) {
$this->invalidatebyHash($this->normalizeCid($cid));
$this->invalidateByHash($this->normalizeCid($cid));
}
/**
......@@ -193,7 +193,7 @@ public function invalidate($cid) {
* @param string $cidhash
* The hashed version of the original cache ID after being normalized.
*/
protected function invalidatebyHash($cidhash) {
protected function invalidateByHash($cidhash) {
if ($item = $this->getByHash($cidhash)) {
$item->expire = REQUEST_TIME - 1;
$this->writeItem($cidhash, $item);
......@@ -214,7 +214,7 @@ public function invalidateMultiple(array $cids) {
*/
public function invalidateAll() {
foreach ($this->storage()->listAll() as $cidhash) {
$this->invalidatebyHash($cidhash);
$this->invalidateByHash($cidhash);
}
}
......
......@@ -175,7 +175,7 @@
* try {
* $id = $connection->insert('example')
* ->fields(array(
* 'field1' => 'mystring',
* 'field1' => 'string',
* 'field2' => 5,
* ))
* ->execute();
......
......@@ -421,51 +421,51 @@ function hook_install_tasks(&$install_state) {
// Here, we define a variable to allow tasks to indicate that a particular,
// processor-intensive batch process needs to be triggered later on in the
// installation.
$myprofile_needs_batch_processing = \Drupal::state()->get('myprofile.needs_batch_processing', FALSE);
$my_profile_needs_batch_processing = \Drupal::state()->get('my_profile.needs_batch_processing', FALSE);
$tasks = [
// This is an example of a task that defines a form which the user who is
// installing the site will be asked to fill out. To implement this task,
// your profile would define a function named myprofile_data_import_form()
// your profile would define a function named my_profile_data_import_form()
// as a normal form API callback function, with associated validation and
// submit handlers. In the submit handler, in addition to saving whatever
// other data you have collected from the user, you might also call
// \Drupal::state()->set('myprofile.needs_batch_processing', TRUE) if the
// \Drupal::state()->set('my_profile.needs_batch_processing', TRUE) if the
// user has entered data which requires that batch processing will need to
// occur later on.
'myprofile_data_import_form' => [
'my_profile_data_import_form' => [
'display_name' => t('Data import options'),
'type' => 'form',
],
// Similarly, to implement this task, your profile would define a function
// named myprofile_settings_form() with associated validation and submit
// named my_profile_settings_form() with associated validation and submit
// handlers. This form might be used to collect and save additional
// information from the user that your profile needs. There are no extra
// steps required for your profile to act as an "installation wizard"; you
// can simply define as many tasks of type 'form' as you wish to execute,
// and the forms will be presented to the user, one after another.
'myprofile_settings_form' => [
'my_profile_settings_form' => [
'display_name' => t('Additional options'),
'type' => 'form',
],
// This is an example of a task that performs batch operations. To
// implement this task, your profile would define a function named
// myprofile_batch_processing() which returns a batch API array definition
// my_profile_batch_processing() which returns a batch API array definition
// that the installer will use to execute your batch operations. Due to the
// 'myprofile.needs_batch_processing' variable used here, this task will be
// 'my_profile.needs_batch_processing' variable used here, this task will be
// hidden and skipped unless your profile set it to TRUE in one of the
// previous tasks.
'myprofile_batch_processing' => [
'my_profile_batch_processing' => [
'display_name' => t('Import additional data'),
'display' => $myprofile_needs_batch_processing,
'display' => $my_profile_needs_batch_processing,
'type' => 'batch',
'run' => $myprofile_needs_batch_processing ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP,
'run' => $my_profile_needs_batch_processing ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP,
],
// This is an example of a task that will not be displayed in the list that
// the user sees. To implement this task, your profile would define a
// function named myprofile_final_site_setup(), in which additional,
// function named my_profile_final_site_setup(), in which additional,
// automated site setup operations would be performed. Since this is the
// last task defined by your profile, you should also use this function to
// call \Drupal::state()->delete('myprofile.needs_batch_processing') and
// call \Drupal::state()->delete('my_profile.needs_batch_processing') and
// clean up the state that was used above. If you want the user to pass
// to the final Drupal installation tasks uninterrupted, return no output
// from this function. Otherwise, return themed output that the user will
......@@ -473,7 +473,7 @@ function hook_install_tasks(&$install_state) {
// tasks are complete, with a link to reload the current page and therefore
// pass on to the final Drupal installation tasks when the user is ready to
// do so).
'myprofile_final_site_setup' => [],
'my_profile_final_site_setup' => [],
];
return $tasks;
}
......@@ -499,7 +499,7 @@ function hook_install_tasks(&$install_state) {
function hook_install_tasks_alter(&$tasks, $install_state) {
// Replace the entire site configuration form provided by Drupal core
// with a custom callback function defined by this installation profile.
$tasks['install_configure_form']['function'] = 'myprofile_install_configure_form';
$tasks['install_configure_form']['function'] = 'my_profile_install_configure_form';
}
/**
......@@ -647,7 +647,7 @@ function hook_update_N(&$sandbox) {
'not null' => FALSE,
];
$schema = Database::getConnection()->schema();
$schema->addField('mytable1', 'newcol', $spec);
$schema->addField('my_table', 'newcol', $spec);
// Example of what to do if there is an error during your update.
if ($some_error_condition_met) {
......@@ -660,26 +660,26 @@ function hook_update_N(&$sandbox) {
// This must be the first run. Initialize the sandbox.
$sandbox['progress'] = 0;
$sandbox['current_pk'] = 0;
$sandbox['max'] = Database::getConnection()->query('SELECT COUNT([myprimarykey]) FROM {mytable1}')->fetchField();
$sandbox['max'] = Database::getConnection()->query('SELECT COUNT([my_primary_key]) FROM {my_table}')->fetchField();
}
// Update in chunks of 20.
$records = Database::getConnection()->select('mytable1', 'm')
->fields('m', ['myprimarykey', 'otherfield'])
->condition('myprimarykey', $sandbox['current_pk'], '>')
$records = Database::getConnection()->select('my_table', 'm')
->fields('m', ['my_primary_key', 'other_field'])
->condition('my_primary_key', $sandbox['current_pk'], '>')
->range(0, 20)
->orderBy('myprimarykey', 'ASC')
->orderBy('my_primary_key', 'ASC')
->execute();
foreach ($records as $record) {
// Here, you would make an update something related to this record. In this
// example, some text is added to the other field.
Database::getConnection()->update('mytable1')
->fields(['otherfield' => $record->otherfield . '-suffix'])
->condition('myprimarykey', $record->myprimarykey)
Database::getConnection()->update('my_table')
->fields(['other_field' => $record->other_field . '-suffix'])
->condition('my_primary_key', $record->my_primary_key)
->execute();
$sandbox['progress']++;
$sandbox['current_pk'] = $record->myprimarykey;
$sandbox['current_pk'] = $record->my_primary_key;
}
$sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);
......
......@@ -70,7 +70,7 @@ protected function getEntitiesToView(EntityReferenceFieldItemListInterface $item
* {@inheritdoc}
*
* @see ::prepareView()
* @see ::getEntitiestoView()
* @see ::getEntitiesToView()
*/
public function view(FieldItemListInterface $items, $langcode = NULL) {
$elements = parent::view($items, $langcode);
......
......@@ -186,7 +186,7 @@
* @code
* function THEME_page_attachments_alter(array &$page) {
* if ($some_condition) {
* $page['#attached']['library'][] = 'mytheme/something';
* $page['#attached']['library'][] = 'my_theme/something';
* }
* }
* @endcode
......
......@@ -111,7 +111,7 @@
*
* If the route has placeholders (see @ref sec_placeholders above) the
* placeholders will be passed to the method (using reflection) by name.
* For example, the placeholder '{myvar}' in a route will become the $myvar
* For example, the placeholder '{my_var}' in a route will become the $my_var
* parameter to the method.
*
* Additionally, if a parameter is typed to one of the following special classes
......
......@@ -11,7 +11,7 @@
*
* This loader adds module and theme template paths as namespaces to the Twig
* filesystem loader so that templates can be referenced by namespace, like
* @block/block.html.twig or @mytheme/page.html.twig.
* @block/block.html.twig or @my_theme/page.html.twig.
*/
class FilesystemLoader extends TwigFilesystemLoader {
......
......@@ -462,7 +462,7 @@
// 1. /nojs/
// 2. /nojs$ - The end of a URL string.
// 3. /nojs? - Followed by a query (e.g. path/nojs?destination=foobar).
// 4. /nojs# - Followed by a fragment (e.g.: path/nojs#myfragment).
// 4. /nojs# - Followed by a fragment (e.g.: path/nojs#my-fragment).
const originalUrl = this.url;
/**
......
......@@ -144,7 +144,6 @@ bazinga
bazqux
bazs
beatle
becalled
beforeclose
beforecreate
beforeend
......@@ -355,7 +354,6 @@ data's
databasefilename
databasename
datapoint
dataprovider
datas
datatypes
datefield
......@@ -438,6 +436,7 @@ discoverability
displaymessage
displayname
distincted
distro
ditka
divs
dnumber
......@@ -528,7 +527,6 @@ enim
enoki
enregistrer
entit
entitiesto
entitynodeedit
entityreference
entitytype
......@@ -580,7 +578,6 @@ fieldable
fieldapi
fieldblock
fieldbody
fieldby
fieldgroups
fielditem
fieldlinks
......@@ -778,7 +775,6 @@ installable
instantiator
internal's
introspectable
invalidateby
invalidators
invalididentifier
invokable
......@@ -788,7 +784,6 @@ isam
isdst
isid
isinstallable
isnew
items's
itoa
itok
......@@ -862,7 +857,6 @@ libc
libellé
libicu
libmysqlclient
librariesby
libyaml
licious
lified
......@@ -1021,37 +1015,10 @@ muuh
muun
muuuh
myclabs
myclass
mydistro
mydriver
myeditor
myeditoroverride
myfragment
myfrontpage
myfunctions
mymenu
mymodule
mynewpassword
myothermenu
mypath
myprimarykey
myprofile
myproject
myrootuser
myroute
myselect
myservice
mysetting
mysite
mysqladmin
mysqldump
mystring
mytab
mytable
mytheme
mytype
myvalue
myvar
myverylongurl
myverylongurlexample
műveletek
......@@ -1120,9 +1087,6 @@ noschema
noslash
nosniff
nostart
nosuchcolumn
nosuchindex
nosuchtable
notag
notawordenglish
notawordgerman
......@@ -1175,11 +1139,6 @@ orgchart
origdir
oring
ossp
otherfield
otherjob
othername
otherpage
otherprofile
otsikko
outdata
outdent
......@@ -1694,7 +1653,6 @@ testkey
testlist
testload
testname
testnoschema
testproject
testproperty
testservice
......@@ -1906,7 +1864,6 @@ uri's
url's
urlalias
urldecoding
urlto
usecase
userid
userinfo
......
......@@ -156,7 +156,7 @@ public function testAccess($operation, $published, $reusable, $permissions, $par
}
/**
* Dataprovider for testAccess().
* Data provider for testAccess().
*/
public function providerTestAccess() {
$cases = [
......
......@@ -134,7 +134,7 @@ public function testMergeGroup($use_set_first) {
}
/**
* Dataprovider for all test methods.
* Data provider for all test methods.
*
* Provides test cases for calling setAccessDependency() or
* mergeAccessDependency() first. A call to either should behave the same on a
......
......@@ -2,4 +2,4 @@ testitem: 'Since this file at least has top level schema in config_test.schema.y
testlist:
- 'Direct string items are identified and other items are'
- 'recognized as undefined types.'
testnoschema: 12
test_no_schema: 12
......@@ -23,7 +23,7 @@
*/
function hook_editor_info_alter(array &$editors) {
$editors['some_other_editor']['label'] = t('A different name');
$editors['some_other_editor']['library']['module'] = 'myeditoroverride';
$editors['some_other_editor']['library']['module'] = 'my_editor_override';
}
/**
......
......@@ -28,7 +28,7 @@
*
* @code
* @Editor(
* id = "myeditor",
* id = "my_editor",
* label = @Translation("My Editor"),
* supports_content_filtering = FALSE,
* supports_inline_editing = FALSE,
......
......@@ -190,11 +190,11 @@ function hook_field_widget_info_alter(array &$info) {
* @see hook_field_widget_multivalue_form_alter()
*/
function hook_field_widget_form_alter(&$element, \Drupal\Core\Form\FormStateInterface $form_state, $context) {
// Add a css class to widget form elements for all fields of type mytype.
// Add a css class to widget form elements for all fields of type my_type.
$field_definition = $context['items']->getFieldDefinition();
if ($field_definition->getType() == 'mytype') {
if ($field_definition->getType() == 'my_type') {
// Be sure not to overwrite existing attributes.
$element['#attributes']['class'][] = 'myclass';
$element['#attributes']['class'][] = 'my-class';
}
}
......@@ -257,11 +257,11 @@ function hook_field_widget_WIDGET_TYPE_form_alter(&$element, \Drupal\Core\Form\F
* @see hook_field_widget_multivalue_WIDGET_TYPE_form_alter()
*/
function hook_field_widget_multivalue_form_alter(array &$elements, \Drupal\Core\Form\FormStateInterface $form_state, array $context) {
// Add a css class to widget form elements for all fields of type mytype.
// Add a css class to widget form elements for all fields of type my_type.
$field_definition = $context['items']->getFieldDefinition();
if ($field_definition->getType() == 'mytype') {
if ($field_definition->getType() == 'my_type') {
// Be sure not to overwrite existing attributes.
$elements['#attributes']['class'][] = 'myclass';
$elements['#attributes']['class'][] = 'my-class';
}
}
......
......@@ -122,7 +122,7 @@ public function testFieldAttachLoadMultiple() {
$values[$index][$field_name] = mt_rand(1, 127);
$entity->$field_name->setValue(['value' => $values[$index][$field_name]]);
}
$entity->enforceIsnew();
$entity->enforceIsNew();
$entity->save();
}
......
......@@ -91,7 +91,7 @@ function hook_field_widget_third_party_settings_form(\Drupal\Core\Field\WidgetIn
*/
function hook_field_formatter_settings_summary_alter(array &$summary, array $context) {
// Append a message to the summary when an instance of foo_formatter has
// mysetting set to TRUE for the current view mode.
// my_setting set to TRUE for the current view mode.
if ($context['formatter']->getPluginId() == 'foo_formatter') {
if ($context['formatter']->getThirdPartySetting('my_module', 'my_setting')) {
$summary[] = t('My setting enabled.');
......@@ -114,7 +114,7 @@ function hook_field_formatter_settings_summary_alter(array &$summary, array $con
*/
function hook_field_widget_settings_summary_alter(array &$summary, array $context) {
// Append a message to the summary when an instance of foo_widget has
// mysetting set to TRUE for the current view mode.
// my_setting set to TRUE for the current view mode.
if ($context['widget']->getPluginId() == 'foo_widget') {
if ($context['widget']->getThirdPartySetting('my_module', 'my_setting')) {
$summary[] = t('My setting enabled.');
......
......@@ -572,11 +572,11 @@ public function testPluginDependencies() {
// Create a new menu.
$this->drupalGet('admin/structure/menu/add');
$page->fillField('label', 'My Menu');
$page->fillField('id', 'mymenu');
$page->fillField('id', 'my-menu');
$page->pressButton('Save');
$this->drupalGet('admin/structure/menu/add');
$page->fillField('label', 'My Menu');
$page->fillField('id', 'myothermenu');
$page->fillField('id', 'my-other-menu');
$page->pressButton('Save');
$page->clickLink('Add link');
......@@ -595,7 +595,7 @@ public function testPluginDependencies() {
$assert_session->elementExists('css', '.layout--layout-test-dependencies-plugin');
$assert_session->elementExists('css', '.field--name-body');
$page->pressButton('Save layout');
$this->drupalPostForm('admin/structure/menu/manage/myothermenu/delete', [], 'Delete');
$this->drupalPostForm('admin/structure/menu/manage/my-other-menu/delete', [], 'Delete');
$this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default/layout');
$assert_session->elementNotExists('css', '.layout--layout-test-dependencies-plugin');
$assert_session->elementExists('css', '.field--name-body');
......@@ -617,17 +617,17 @@ public function testPluginDependencies() {
// Assert that the blocks are visible, and save the layout.
$assert_session->pageTextContains('Powered by Drupal');
$assert_session->pageTextContains('My Menu');
$assert_session->elementExists('css', '.block.menu--mymenu');
$assert_session->elementExists('css', '.block.menu--my-menu');
$page->pressButton('Save layout');
// Delete the menu.
$this->drupalPostForm('admin/structure/menu/manage/mymenu/delete', [], 'Delete');
$this->drupalPostForm('admin/structure/menu/manage/my-menu/delete', [], 'Delete');
// Ensure that the menu block is gone, but that the other block remains.
$this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default/layout');
$assert_session->pageTextContains('Powered by Drupal');
$assert_session->pageTextNotContains('My Menu');
$assert_session->elementNotExists('css', '.block.menu--mymenu');
$assert_session->elementNotExists('css', '.block.menu--my-menu');
}
/**
......
......@@ -46,7 +46,7 @@ protected function setUp(): void {
}
/**
* Dataprovider for testGetSectionStorageForEntity().
* Data provider for testGetSectionStorageForEntity().
*/
public function providerTestGetSectionStorageForEntity() {
$data = [];
......@@ -119,7 +119,7 @@ public function testGetSectionStorageForEntity($entity_type_id, $values, $expect
}
/**
* Dataprovider for testOriginalEntityUsesDefaultStorage().
* Data provider for testOriginalEntityUsesDefaultStorage().
*/
public function providerTestOriginalEntityUsesDefaultStorage() {
return [
......
......@@ -43,7 +43,7 @@ class BlockComponentRenderArrayTest extends UnitTestCase {
protected $blockManager;
/**
* Dataprovider for test functions that should test block types.
* Data provider for test functions that should test block types.
*/
public function providerBlockTypes() {
return [
......
......@@ -18,7 +18,7 @@
class LayoutEntityHelperTraitTest extends UnitTestCase {
/**
* Dataprovider method for tests that need sections with inline blocks.
* Data provider method for tests that need sections with inline blocks.
*/
public function providerSectionsWithInlineComponents() {
$components = [];
......
......@@ -125,8 +125,8 @@ function locale_translation_project_list() {
*
* Custom modules or themes can bring their own gettext translation file. To
* enable import of this file the module or theme defines "interface translation
* project = myproject" in its .info.yml file. This function will add a project
* "myproject" to the info data.
* project = my_project" in its .info.yml file. This function will add a project
* "my_project" to the info data.
*
* @param \Drupal\Core\Extension\Extension[] $data
* Array of .info.yml file data.
......
......@@ -70,8 +70,8 @@ protected function setUp(): void {
public function testNodeQueryAlterLowLevelWithAccess() {
// User with access should be able to view 4 nodes.
try {
$query = Database::getConnection()->select('node', 'mytab')
->fields('mytab');
$query = Database::getConnection()->select('node', 'n')
->fields('n');
$query->addTag('node_access');
$query->addMetaData('op', 'view');
$query->addMetaData('account', $this->accessUser);
......@@ -111,8 +111,8 @@ public function testNodeQueryAlterWithRevisions() {
public function testNodeQueryAlterLowLevelNoAccess() {
// User without access should be able to view 0 nodes.
try {
$query = Database::getConnection()->select('node', 'mytab')
->fields('mytab');
$query = Database::getConnection()->select('node', 'n')
->fields('n');
$query->addTag('node_access');
$query->addMetaData('op', 'view');
$query->addMetaData('account', $this->noAccessUser);
......@@ -134,8 +134,8 @@ public function testNodeQueryAlterLowLevelNoAccess() {
public function testNodeQueryAlterLowLevelEditAccess() {
// User with view-only access should not be able to edit nodes.
try {