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 @@ ...@@ -230,9 +230,9 @@
* Sample Database configuration format for a driver in a contributed module: * Sample Database configuration format for a driver in a contributed module:
* @code * @code
* $databases['default']['default'] = [ * $databases['default']['default'] = [
* 'driver' => 'mydriver', * 'driver' => 'my_driver',
* 'namespace' => 'Drupal\mymodule\Driver\Database\mydriver', * 'namespace' => 'Drupal\my_module\Driver\Database\my_driver',
* 'autoload' => 'modules/mymodule/src/Driver/Database/mydriver/', * 'autoload' => 'modules/my_module/src/Driver/Database/my_driver/',
* 'database' => 'databasename', * 'database' => 'databasename',
* 'username' => 'sqlusername', * 'username' => 'sqlusername',
* 'password' => 'sqlpassword', * 'password' => 'sqlpassword',
......
...@@ -382,10 +382,10 @@ ...@@ -382,10 +382,10 @@
* be an admin path). Here's an example using the configurable_language config * be an admin path). Here's an example using the configurable_language config
* entity: * entity:
* @code * @code
* mymodule.myroute: * my_module.my_route:
* path: '/admin/mypath/{configurable_language}' * path: '/admin/my-path/{configurable_language}'
* defaults: * defaults:
* _controller: '\Drupal\mymodule\MyController::myMethod' * _controller: '\Drupal\my_module\MyController::myMethod'
* options: * options:
* parameters: * parameters:
* configurable_language: * configurable_language:
...@@ -809,7 +809,7 @@ ...@@ -809,7 +809,7 @@
* arguments, but they all include an argument $container of type * arguments, but they all include an argument $container of type
* \Symfony\Component\DependencyInjection\ContainerInterface. * \Symfony\Component\DependencyInjection\ContainerInterface.
* If you are defining one of these classes, in the create() or * 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 * instantiate a service. The results of these calls are generally passed to
* the class constructor and saved as member variables in the class. * the class constructor and saved as member variables in the class.
* - For functions and class methods that do not have access to either of * - For functions and class methods that do not have access to either of
...@@ -837,7 +837,7 @@ ...@@ -837,7 +837,7 @@
* @section sec_define Defining a service * @section sec_define Defining a service
* If your module needs to define a new service, here are the steps: * If your module needs to define a new service, here are the steps:
* - Choose a unique machine name for your service. Typically, this should * - 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 PHP interface to define what your service does.
* - Create a default class implementing your interface that provides your * - Create a default class implementing your interface that provides your
* service. If your class needs to use existing services (such as database * service. If your class needs to use existing services (such as database
......
...@@ -577,7 +577,7 @@ function template_preprocess_form_element_label(&$variables) { ...@@ -577,7 +577,7 @@ function template_preprocess_form_element_label(&$variables) {
* array('my_function_2', array()), * array('my_function_2', array()),
* ), * ),
* 'finished' => 'my_finished_callback', * 'finished' => 'my_finished_callback',
* 'file' => 'path_to_file_containing_myfunctions', * 'file' => 'path_to_file_containing_my_functions',
* ); * );
* batch_set($batch); * batch_set($batch);
* // Only needed if not inside a form _submit handler. * // Only needed if not inside a form _submit handler.
......
...@@ -184,7 +184,7 @@ public function deleteAll() { ...@@ -184,7 +184,7 @@ public function deleteAll() {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function invalidate($cid) { public function invalidate($cid) {
$this->invalidatebyHash($this->normalizeCid($cid)); $this->invalidateByHash($this->normalizeCid($cid));
} }
/** /**
...@@ -193,7 +193,7 @@ public function invalidate($cid) { ...@@ -193,7 +193,7 @@ public function invalidate($cid) {
* @param string $cidhash * @param string $cidhash
* The hashed version of the original cache ID after being normalized. * The hashed version of the original cache ID after being normalized.
*/ */
protected function invalidatebyHash($cidhash) { protected function invalidateByHash($cidhash) {
if ($item = $this->getByHash($cidhash)) { if ($item = $this->getByHash($cidhash)) {
$item->expire = REQUEST_TIME - 1; $item->expire = REQUEST_TIME - 1;
$this->writeItem($cidhash, $item); $this->writeItem($cidhash, $item);
...@@ -214,7 +214,7 @@ public function invalidateMultiple(array $cids) { ...@@ -214,7 +214,7 @@ public function invalidateMultiple(array $cids) {
*/ */
public function invalidateAll() { public function invalidateAll() {
foreach ($this->storage()->listAll() as $cidhash) { foreach ($this->storage()->listAll() as $cidhash) {
$this->invalidatebyHash($cidhash); $this->invalidateByHash($cidhash);
} }
} }
......
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
* try { * try {
* $id = $connection->insert('example') * $id = $connection->insert('example')
* ->fields(array( * ->fields(array(
* 'field1' => 'mystring', * 'field1' => 'string',
* 'field2' => 5, * 'field2' => 5,
* )) * ))
* ->execute(); * ->execute();
......
...@@ -421,51 +421,51 @@ function hook_install_tasks(&$install_state) { ...@@ -421,51 +421,51 @@ function hook_install_tasks(&$install_state) {
// Here, we define a variable to allow tasks to indicate that a particular, // 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 // processor-intensive batch process needs to be triggered later on in the
// installation. // 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 = [ $tasks = [
// This is an example of a task that defines a form which the user who is // 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, // 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 // as a normal form API callback function, with associated validation and
// submit handlers. In the submit handler, in addition to saving whatever // submit handlers. In the submit handler, in addition to saving whatever
// other data you have collected from the user, you might also call // 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 // user has entered data which requires that batch processing will need to
// occur later on. // occur later on.
'myprofile_data_import_form' => [ 'my_profile_data_import_form' => [
'display_name' => t('Data import options'), 'display_name' => t('Data import options'),
'type' => 'form', 'type' => 'form',
], ],
// Similarly, to implement this task, your profile would define a function // 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 // handlers. This form might be used to collect and save additional
// information from the user that your profile needs. There are no extra // information from the user that your profile needs. There are no extra
// steps required for your profile to act as an "installation wizard"; you // 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, // 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. // and the forms will be presented to the user, one after another.
'myprofile_settings_form' => [ 'my_profile_settings_form' => [
'display_name' => t('Additional options'), 'display_name' => t('Additional options'),
'type' => 'form', 'type' => 'form',
], ],
// This is an example of a task that performs batch operations. To // This is an example of a task that performs batch operations. To
// implement this task, your profile would define a function named // 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 // 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 // hidden and skipped unless your profile set it to TRUE in one of the
// previous tasks. // previous tasks.
'myprofile_batch_processing' => [ 'my_profile_batch_processing' => [
'display_name' => t('Import additional data'), 'display_name' => t('Import additional data'),
'display' => $myprofile_needs_batch_processing, 'display' => $my_profile_needs_batch_processing,
'type' => 'batch', '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 // 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 // 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 // automated site setup operations would be performed. Since this is the
// last task defined by your profile, you should also use this function to // 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 // 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 // to the final Drupal installation tasks uninterrupted, return no output
// from this function. Otherwise, return themed output that the user will // from this function. Otherwise, return themed output that the user will
...@@ -473,7 +473,7 @@ function hook_install_tasks(&$install_state) { ...@@ -473,7 +473,7 @@ function hook_install_tasks(&$install_state) {
// tasks are complete, with a link to reload the current page and therefore // 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 // pass on to the final Drupal installation tasks when the user is ready to
// do so). // do so).
'myprofile_final_site_setup' => [], 'my_profile_final_site_setup' => [],
]; ];
return $tasks; return $tasks;
} }
...@@ -499,7 +499,7 @@ function hook_install_tasks(&$install_state) { ...@@ -499,7 +499,7 @@ function hook_install_tasks(&$install_state) {
function hook_install_tasks_alter(&$tasks, $install_state) { function hook_install_tasks_alter(&$tasks, $install_state) {
// Replace the entire site configuration form provided by Drupal core // Replace the entire site configuration form provided by Drupal core
// with a custom callback function defined by this installation profile. // 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) { ...@@ -647,7 +647,7 @@ function hook_update_N(&$sandbox) {
'not null' => FALSE, 'not null' => FALSE,
]; ];
$schema = Database::getConnection()->schema(); $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. // Example of what to do if there is an error during your update.
if ($some_error_condition_met) { if ($some_error_condition_met) {
...@@ -660,26 +660,26 @@ function hook_update_N(&$sandbox) { ...@@ -660,26 +660,26 @@ function hook_update_N(&$sandbox) {
// This must be the first run. Initialize the sandbox. // This must be the first run. Initialize the sandbox.
$sandbox['progress'] = 0; $sandbox['progress'] = 0;
$sandbox['current_pk'] = 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. // Update in chunks of 20.
$records = Database::getConnection()->select('mytable1', 'm') $records = Database::getConnection()->select('my_table', 'm')
->fields('m', ['myprimarykey', 'otherfield']) ->fields('m', ['my_primary_key', 'other_field'])
->condition('myprimarykey', $sandbox['current_pk'], '>') ->condition('my_primary_key', $sandbox['current_pk'], '>')
->range(0, 20) ->range(0, 20)
->orderBy('myprimarykey', 'ASC') ->orderBy('my_primary_key', 'ASC')
->execute(); ->execute();
foreach ($records as $record) { foreach ($records as $record) {
// Here, you would make an update something related to this record. In this // Here, you would make an update something related to this record. In this
// example, some text is added to the other field. // example, some text is added to the other field.
Database::getConnection()->update('mytable1') Database::getConnection()->update('my_table')
->fields(['otherfield' => $record->otherfield . '-suffix']) ->fields(['other_field' => $record->other_field . '-suffix'])
->condition('myprimarykey', $record->myprimarykey) ->condition('my_primary_key', $record->my_primary_key)
->execute(); ->execute();
$sandbox['progress']++; $sandbox['progress']++;
$sandbox['current_pk'] = $record->myprimarykey; $sandbox['current_pk'] = $record->my_primary_key;
} }
$sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']); $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);
......
...@@ -70,7 +70,7 @@ protected function getEntitiesToView(EntityReferenceFieldItemListInterface $item ...@@ -70,7 +70,7 @@ protected function getEntitiesToView(EntityReferenceFieldItemListInterface $item
* {@inheritdoc} * {@inheritdoc}
* *
* @see ::prepareView() * @see ::prepareView()
* @see ::getEntitiestoView() * @see ::getEntitiesToView()
*/ */
public function view(FieldItemListInterface $items, $langcode = NULL) { public function view(FieldItemListInterface $items, $langcode = NULL) {
$elements = parent::view($items, $langcode); $elements = parent::view($items, $langcode);
......
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
* @code * @code
* function THEME_page_attachments_alter(array &$page) { * function THEME_page_attachments_alter(array &$page) {
* if ($some_condition) { * if ($some_condition) {
* $page['#attached']['library'][] = 'mytheme/something'; * $page['#attached']['library'][] = 'my_theme/something';
* } * }
* } * }
* @endcode * @endcode
......
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
* *
* If the route has placeholders (see @ref sec_placeholders above) the * If the route has placeholders (see @ref sec_placeholders above) the
* placeholders will be passed to the method (using reflection) by name. * 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. * parameter to the method.
* *
* Additionally, if a parameter is typed to one of the following special classes * Additionally, if a parameter is typed to one of the following special classes
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* This loader adds module and theme template paths as namespaces to the Twig * This loader adds module and theme template paths as namespaces to the Twig
* filesystem loader so that templates can be referenced by namespace, like * 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 { class FilesystemLoader extends TwigFilesystemLoader {
......
...@@ -462,7 +462,7 @@ ...@@ -462,7 +462,7 @@
// 1. /nojs/ // 1. /nojs/
// 2. /nojs$ - The end of a URL string. // 2. /nojs$ - The end of a URL string.
// 3. /nojs? - Followed by a query (e.g. path/nojs?destination=foobar). // 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; const originalUrl = this.url;
/** /**
......
...@@ -144,7 +144,6 @@ bazinga ...@@ -144,7 +144,6 @@ bazinga
bazqux bazqux
bazs bazs
beatle beatle
becalled
beforeclose beforeclose
beforecreate beforecreate
beforeend beforeend
...@@ -355,7 +354,6 @@ data's ...@@ -355,7 +354,6 @@ data's
databasefilename databasefilename
databasename databasename
datapoint datapoint
dataprovider
datas datas
datatypes datatypes
datefield datefield
...@@ -438,6 +436,7 @@ discoverability ...@@ -438,6 +436,7 @@ discoverability
displaymessage displaymessage
displayname displayname
distincted distincted
distro
ditka ditka
divs divs
dnumber dnumber
...@@ -528,7 +527,6 @@ enim ...@@ -528,7 +527,6 @@ enim
enoki enoki
enregistrer enregistrer
entit entit
entitiesto
entitynodeedit entitynodeedit
entityreference entityreference
entitytype entitytype
...@@ -580,7 +578,6 @@ fieldable ...@@ -580,7 +578,6 @@ fieldable
fieldapi fieldapi
fieldblock fieldblock
fieldbody fieldbody
fieldby
fieldgroups fieldgroups
fielditem fielditem
fieldlinks fieldlinks
...@@ -778,7 +775,6 @@ installable ...@@ -778,7 +775,6 @@ installable
instantiator instantiator
internal's internal's
introspectable introspectable
invalidateby
invalidators invalidators
invalididentifier invalididentifier
invokable invokable
...@@ -788,7 +784,6 @@ isam ...@@ -788,7 +784,6 @@ isam
isdst isdst
isid isid
isinstallable isinstallable
isnew
items's items's
itoa itoa
itok itok
...@@ -862,7 +857,6 @@ libc ...@@ -862,7 +857,6 @@ libc
libellé libellé
libicu libicu
libmysqlclient libmysqlclient
librariesby
libyaml libyaml
licious licious
lified lified
...@@ -1021,37 +1015,10 @@ muuh ...@@ -1021,37 +1015,10 @@ muuh
muun muun
muuuh muuuh
myclabs myclabs
myclass
mydistro
mydriver
myeditor
myeditoroverride
myfragment
myfrontpage
myfunctions
mymenu
mymodule mymodule
mynewpassword
myothermenu
mypath
myprimarykey
myprofile
myproject
myrootuser
myroute
myselect
myservice
mysetting
mysite mysite
mysqladmin mysqladmin
mysqldump mysqldump
mystring
mytab
mytable
mytheme
mytype
myvalue
myvar
myverylongurl myverylongurl
myverylongurlexample myverylongurlexample
műveletek műveletek
...@@ -1120,9 +1087,6 @@ noschema ...@@ -1120,9 +1087,6 @@ noschema
noslash noslash
nosniff nosniff
nostart nostart
nosuchcolumn
nosuchindex
nosuchtable
notag notag
notawordenglish notawordenglish
notawordgerman notawordgerman
...@@ -1175,11 +1139,6 @@ orgchart ...@@ -1175,11 +1139,6 @@ orgchart
origdir origdir
oring oring
ossp ossp
otherfield
otherjob
othername
otherpage
otherprofile
otsikko otsikko
outdata outdata
outdent outdent
...@@ -1694,7 +1653,6 @@ testkey ...@@ -1694,7 +1653,6 @@ testkey
testlist testlist
testload testload
testname testname
testnoschema
testproject testproject
testproperty testproperty
testservice testservice
...@@ -1906,7 +1864,6 @@ uri's ...@@ -1906,7 +1864,6 @@ uri's
url's url's
urlalias urlalias
urldecoding urldecoding
urlto
usecase usecase
userid userid
userinfo userinfo
......
...@@ -156,7 +156,7 @@ public function testAccess($operation, $published, $reusable, $permissions, $par ...@@ -156,7 +156,7 @@ public function testAccess($operation, $published, $reusable, $permissions, $par
} }
/** /**
* Dataprovider for testAccess(). * Data provider for testAccess().
*/ */
public function providerTestAccess() { public function providerTestAccess() {
$cases = [ $cases = [
......
...@@ -134,7 +134,7 @@ public function testMergeGroup($use_set_first) { ...@@ -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 * Provides test cases for calling setAccessDependency() or
* mergeAccessDependency() first. A call to either should behave the same on a * 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 ...@@ -2,4 +2,4 @@ testitem: 'Since this file at least has top level schema in config_test.schema.y
testlist: testlist:
- 'Direct string items are identified and other items are' - 'Direct string items are identified and other items are'
- 'recognized as undefined types.'