Issue #3420582 by quietone: Fix spelling of 11 function words

merge-requests/6153/head^2
Dave Long 2024-02-18 11:29:17 +00:00
parent 5b79fe260c
commit acdd40a533
No known key found for this signature in database
GPG Key ID: ED52AE211E142771
28 changed files with 62 additions and 65 deletions

View File

@ -11,6 +11,8 @@ use Drupal\Core\Test\TestDatabase;
use Drupal\Core\Utility\Error; use Drupal\Core\Utility\Error;
use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\StringTranslation\TranslatableMarkup;
// cspell:ignore htkey
/** /**
* Error reporting level: display no errors. * Error reporting level: display no errors.
*/ */

View File

@ -1004,7 +1004,7 @@ final class DocParser
private function PlainValue() private function PlainValue()
{ {
if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) { if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) {
return $this->Arrayx(); return $this->ArrayX();
} }
if ($this->lexer->isNextToken(DocLexer::T_AT)) { if ($this->lexer->isNextToken(DocLexer::T_AT)) {
@ -1070,7 +1070,7 @@ final class DocParser
* *
* @return array * @return array
*/ */
private function Arrayx() private function ArrayX()
{ {
$array = $values = array(); $array = $values = array();

View File

@ -3,7 +3,7 @@
namespace Drupal\Component\Utility; namespace Drupal\Component\Utility;
/** /**
* Wraps __toString in a trait to avoid some fatals. * Wraps __toString in a trait to avoid some fatal errors.
*/ */
trait ToStringTrait { trait ToStringTrait {

View File

@ -45,7 +45,7 @@ abstract class Element extends TypedData {
* The typed config manager. This must be an instance of * The typed config manager. This must be an instance of
* \Drupal\Core\Config\TypedConfigManagerInterface. If it is not, then this * \Drupal\Core\Config\TypedConfigManagerInterface. If it is not, then this
* method will error when assertions are enabled. We can not narrow the * method will error when assertions are enabled. We can not narrow the
* typehint as this will cause PHP errors. * type hint as this will cause PHP errors.
* *
* @return $this * @return $this
*/ */

View File

@ -50,7 +50,7 @@
* all operations have finished, this is passed to callback_batch_finished() * all operations have finished, this is passed to callback_batch_finished()
* where results may be referenced to display information to the end-user, * where results may be referenced to display information to the end-user,
* such as how many total items were processed. * such as how many total items were processed.
* It is discouraged to typehint this parameter as an array, to allow an * It is discouraged to type hint this parameter as an array, to allow an
* object implement \ArrayAccess to be passed. * object implement \ArrayAccess to be passed.
*/ */
function callback_batch_operation($multiple_params, &$context) { function callback_batch_operation($multiple_params, &$context) {

View File

@ -102,7 +102,7 @@ class PrivateTempStore {
* The data associated with the key, or NULL if the key does not exist. * The data associated with the key, or NULL if the key does not exist.
*/ */
public function get($key) { public function get($key) {
$key = $this->createkey($key); $key = $this->createKey($key);
if (($object = $this->storage->get($key)) && ($object->owner == $this->getOwner())) { if (($object = $this->storage->get($key)) && ($object->owner == $this->getOwner())) {
return $object->data; return $object->data;
} }
@ -132,7 +132,7 @@ class PrivateTempStore {
} }
} }
$key = $this->createkey($key); $key = $this->createKey($key);
if (!$this->lockBackend->acquire($key)) { if (!$this->lockBackend->acquire($key)) {
$this->lockBackend->wait($key); $this->lockBackend->wait($key);
if (!$this->lockBackend->acquire($key)) { if (!$this->lockBackend->acquire($key)) {
@ -160,7 +160,7 @@ class PrivateTempStore {
* NULL otherwise. * NULL otherwise.
*/ */
public function getMetadata($key) { public function getMetadata($key) {
$key = $this->createkey($key); $key = $this->createKey($key);
// Fetch the key/value pair and its metadata. // Fetch the key/value pair and its metadata.
$object = $this->storage->get($key); $object = $this->storage->get($key);
if ($object) { if ($object) {
@ -184,7 +184,7 @@ class PrivateTempStore {
* Thrown when a lock for the backend storage could not be acquired. * Thrown when a lock for the backend storage could not be acquired.
*/ */
public function delete($key) { public function delete($key) {
$key = $this->createkey($key); $key = $this->createKey($key);
if (!$object = $this->storage->get($key)) { if (!$object = $this->storage->get($key)) {
return TRUE; return TRUE;
} }
@ -211,7 +211,7 @@ class PrivateTempStore {
* @return string * @return string
* The unique key for the user. * The unique key for the user.
*/ */
protected function createkey($key) { protected function createKey($key) {
return $this->getOwner() . ':' . $key; return $this->getOwner() . ':' . $key;
} }

View File

@ -9,7 +9,6 @@ adminforms
afterclose afterclose
aftercreate aftercreate
ahah ahah
ajaxcallback
ajaxing ajaxing
allwords allwords
alphadecimal alphadecimal
@ -20,7 +19,6 @@ applix
archiver archiver
archivers archivers
arrakis arrakis
arrayx
arrowrefresh arrowrefresh
arrowreturn arrowreturn
arrowreturnthick arrowreturnthick
@ -163,7 +161,6 @@ controlgroup
conv conv
corge corge
cpio cpio
createkey
createrole createrole
createuser createuser
crema crema
@ -274,7 +271,6 @@ falsey
falsish falsish
fapi fapi
fastcgi fastcgi
fatals
favourite favourite
favstar favstar
fcgi fcgi
@ -336,7 +332,6 @@ hoglet
hookname hookname
hosters hosters
hrefs hrefs
htkey
htmlcorrector htmlcorrector
httpheader httpheader
httplug httplug
@ -350,7 +345,6 @@ idekey
iframes iframes
iframeupload iframeupload
imagecache imagecache
imagecreatefrom
imagetextalternative imagetextalternative
indexname indexname
inited inited
@ -426,7 +420,6 @@ mank
maryjane maryjane
matchout matchout
mathematica mathematica
maxage
maximumred maximumred
maxlifetime maxlifetime
maynot maynot
@ -798,9 +791,6 @@ testcase
testcontent testcontent
testcontextawareblock testcontextawareblock
testdialog testdialog
testfilter
testfunc
testfunction
testgroups testgroups
testkey testkey
testlogger testlogger
@ -852,7 +842,6 @@ troopal
truecolor truecolor
twistie twistie
twocol twocol
typehint
tzid tzid
uids uids
ulwa ulwa

View File

@ -161,14 +161,14 @@ class ContentModerationConfigureEntityTypesForm extends FormBase {
'#button_type' => 'primary', '#button_type' => 'primary',
'#value' => $this->t('Save'), '#value' => $this->t('Save'),
'#ajax' => [ '#ajax' => [
'callback' => [$this, 'ajaxcallback'], 'callback' => [$this, 'ajaxCallback'],
], ],
]; ];
$form['actions']['cancel'] = [ $form['actions']['cancel'] = [
'#type' => 'button', '#type' => 'button',
'#value' => $this->t('Cancel'), '#value' => $this->t('Cancel'),
'#ajax' => [ '#ajax' => [
'callback' => [$this, 'ajaxcallback'], 'callback' => [$this, 'ajaxCallback'],
], ],
]; ];

View File

@ -73,7 +73,7 @@ class FieldFile extends ProcessPluginBase implements ContainerFactoryPluginInter
// means the file referenced by the current field item did not migrate for // means the file referenced by the current field item did not migrate for
// some reason -- file migration is notoriously brittle -- and we do NOT // some reason -- file migration is notoriously brittle -- and we do NOT
// want to send invalid file references into the field system (it causes // want to send invalid file references into the field system (it causes
// fatals), so return an empty item instead. // fatal errors), so return an empty item instead.
$lookup_result = $this->migrateLookup->lookup('d6_file', [$value['fid']]); $lookup_result = $this->migrateLookup->lookup('d6_file', [$value['fid']]);
if ($lookup_result) { if ($lookup_result) {
return [ return [

View File

@ -42,12 +42,12 @@ class FilterHtmlTest extends UnitTestCase {
* @param string $expected * @param string $expected
* The expected output string. * The expected output string.
*/ */
public function testfilterAttributes($html, $expected) { public function testFilterAttributes($html, $expected) {
$this->assertSame($expected, $this->filter->filterAttributes($html)); $this->assertSame($expected, $this->filter->filterAttributes($html));
} }
/** /**
* Provides data for testfilterAttributes. * Provides data for testFilterAttributes.
* *
* @return array * @return array
* An array of test data. * An array of test data.

View File

@ -268,7 +268,7 @@ class PageCacheTest extends BrowserTestBase {
// Until bubbling of max-age up to the response is supported, verify that // Until bubbling of max-age up to the response is supported, verify that
// a custom #cache max-age set on an element does not affect page max-age. // a custom #cache max-age set on an element does not affect page max-age.
$this->drupalLogout(); $this->drupalLogout();
$this->drupalGet('system-test/cache_maxage_page'); $this->drupalGet('system-test/cache_max_age_page');
$this->assertSession()->responseHeaderEquals('Cache-Control', 'max-age=300, public'); $this->assertSession()->responseHeaderEquals('Cache-Control', 'max-age=300, public');
} }

View File

@ -247,7 +247,7 @@ class RequestHandler implements ContainerInjectionInterface {
// methods historically receive the unserialized request body as the N+1th // methods historically receive the unserialized request body as the N+1th
// method argument, where N is the number of route parameters specified on // method argument, where N is the number of route parameters specified on
// the accompanying route. To be able to use the argument resolver, which is // the accompanying route. To be able to use the argument resolver, which is
// not based on position but on name and typehint, specify commonly used // not based on position but on name and type hint, specify commonly used
// names here. Similarly, those methods receive the original stored object // names here. Similarly, those methods receive the original stored object
// as the first method argument. // as the first method argument.

View File

@ -15,7 +15,7 @@ use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
// cspell:ignore rrggbb // cspell:ignore imagecreatefrom rrggbb
/** /**
* Defines the GD2 toolkit for image manipulation within Drupal. * Defines the GD2 toolkit for image manipulation within Drupal.

View File

@ -5,10 +5,10 @@ error_test.generate_warnings:
requirements: requirements:
_access: 'TRUE' _access: 'TRUE'
error_test.generate_fatals: error_test.generate_fatal_errors:
path: '/error-test/generate-fatals' path: '/error-test/generate-fatal-errors'
defaults: defaults:
_controller: '\Drupal\error_test\Controller\ErrorTestController::generateFatals' _controller: '\Drupal\error_test\Controller\ErrorTestController::generateFatalErrors'
requirements: requirements:
_access: 'TRUE' _access: 'TRUE'

View File

@ -56,9 +56,9 @@ class ErrorTestController extends ControllerBase {
} }
/** /**
* Generate fatals to test the error handler. * Generate fatal errors to test the error handler.
*/ */
public function generateFatals() { public function generateFatalErrors() {
$function = function (array $test) { $function = function (array $test) {
}; };

View File

@ -263,7 +263,7 @@ class SystemTestController extends ControllerBase implements TrustedCallbackInte
/** /**
* Set cache max-age on the returned render array. * Set cache max-age on the returned render array.
*/ */
public function system_test_cache_maxage_page() { public function system_test_cache_max_age_page() {
$build['main'] = [ $build['main'] = [
'#cache' => ['max-age' => 90], '#cache' => ['max-age' => 90],
'message' => [ 'message' => [

View File

@ -76,10 +76,10 @@ system_test.cache_tags_page:
requirements: requirements:
_access: 'TRUE' _access: 'TRUE'
system_test.cache_maxage_page: system_test.cache_max_age_page:
path: '/system-test/cache_maxage_page' path: '/system-test/cache_max_age_page'
defaults: defaults:
_controller: '\Drupal\system_test\Controller\SystemTestController::system_test_cache_maxage_page' _controller: '\Drupal\system_test\Controller\SystemTestController::system_test_cache_max_age_page'
requirements: requirements:
_access: 'TRUE' _access: 'TRUE'

View File

@ -18,14 +18,14 @@ class TestExtension extends AbstractExtension {
* A key/value array that defines custom Twig functions. The key denotes the * A key/value array that defines custom Twig functions. The key denotes the
* function name used in the tag, e.g.: * function name used in the tag, e.g.:
* @code * @code
* {{ testfunc() }} * {{ custom_function() }}
* @endcode * @endcode
* *
* The value is a standard PHP callback that defines what the function does. * The value is a standard PHP callback that defines what the function does.
*/ */
public function getFunctions() { public function getFunctions() {
return [ return [
'testfunc' => new TwigFunction('testfunc', ['Drupal\twig_extension_test\TwigExtension\TestExtension', 'testFunction']), 'custom_function' => new TwigFunction('custom_function', ['Drupal\twig_extension_test\TwigExtension\TestExtension', 'testFunction']),
]; ];
} }
@ -36,14 +36,14 @@ class TestExtension extends AbstractExtension {
* A key/value array that defines custom Twig filters. The key denotes the * A key/value array that defines custom Twig filters. The key denotes the
* filter name used in the tag, e.g.: * filter name used in the tag, e.g.:
* @code * @code
* {{ foo|testfilter }} * {{ foo|test_filter }}
* @endcode * @endcode
* *
* The value is a standard PHP callback that defines what the filter does. * The value is a standard PHP callback that defines what the filter does.
*/ */
public function getFilters() { public function getFilters() {
return [ return [
'testfilter' => new TwigFilter('testfilter', ['Drupal\twig_extension_test\TwigExtension\TestExtension', 'testFilter']), 'test_filter' => new TwigFilter('test_filter', ['Drupal\twig_extension_test\TwigExtension\TestExtension', 'testFilter']),
]; ];
} }

View File

@ -1,5 +1,5 @@
<div class="testfilter"> <div class="test-filter">
{{ message|testfilter }} {{ message|test_filter}}
</div> </div>
<div> <div>
{{ safe_join_items|safe_join('<br/>') }} {{ safe_join_items|safe_join('<br/>') }}

View File

@ -1,7 +1,7 @@
<div class="testfunction"> <div class="test-function">
{{ testfunc(1) }} {{ custom_function(1) }}
</div> </div>
<div class="testfunction"> <div class="test-function">
{{ testfunc(0) }} {{ custom_function(0) }}
</div> </div>

View File

@ -98,7 +98,7 @@ class UncaughtExceptionTest extends BrowserTestBase {
'@message' => 'Drupal\error_test\Controller\ErrorTestController::Drupal\error_test\Controller\{closure}(): Argument #1 ($test) must be of type array, string given, called in ' . \Drupal::root() . '/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php on line 65', '@message' => 'Drupal\error_test\Controller\ErrorTestController::Drupal\error_test\Controller\{closure}(): Argument #1 ($test) must be of type array, string given, called in ' . \Drupal::root() . '/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php on line 65',
'%function' => 'Drupal\error_test\Controller\ErrorTestController->Drupal\error_test\Controller\{closure}()', '%function' => 'Drupal\error_test\Controller\ErrorTestController->Drupal\error_test\Controller\{closure}()',
]; ];
$this->drupalGet('error-test/generate-fatals'); $this->drupalGet('error-test/generate-fatal-errors');
$this->assertSession()->statusCodeEquals(500); $this->assertSession()->statusCodeEquals(500);
$message = new FormattableMarkup('%type: @message in %function (line ', $fatal_error); $message = new FormattableMarkup('%type: @message in %function (line ', $fatal_error);
$this->assertSession()->responseContains((string) $message); $this->assertSession()->responseContains((string) $message);

View File

@ -13,6 +13,8 @@ use Drupal\user\Entity\Role;
use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\ExpectationFailedException;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
// cspell:ignore htkey
/** /**
* Tests BrowserTestBase functionality. * Tests BrowserTestBase functionality.
* *
@ -524,7 +526,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/** /**
* Tests the protections provided by .htkey. * Tests the protections provided by .htkey.
*/ */
public function testHtkey() { public function testHtKey() {
// Remove the Simpletest private key file so we can test the protection // Remove the Simpletest private key file so we can test the protection
// against requests that forge a valid testing user agent to gain access // against requests that forge a valid testing user agent to gain access
// to the installer. // to the installer.

View File

@ -7,6 +7,8 @@ use Drupal\Core\Image\ImageFactory;
use Drupal\Core\Image\ImageInterface; use Drupal\Core\Image\ImageInterface;
use Drupal\KernelTests\KernelTestBase; use Drupal\KernelTests\KernelTestBase;
// cspell:ignore imagecreatefrom
/** /**
* Tests for the GD image toolkit. * Tests for the GD image toolkit.
* *

View File

@ -285,8 +285,8 @@ EOS;
* @covers ::buildParameter * @covers ::buildParameter
* @covers ::buildMethodBody * @covers ::buildMethodBody
*/ */
public function testBuildWithNullableSelfTypehint() { public function testBuildWithNullableSelfTypeHint() {
$class = 'Drupal\Tests\Component\ProxyBuilder\TestServiceNullableTypehintSelf'; $class = 'Drupal\Tests\Component\ProxyBuilder\TestServiceNullableTypeHintSelf';
$result = $this->proxyBuilder->build($class); $result = $this->proxyBuilder->build($class);
@ -296,9 +296,9 @@ EOS;
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function typehintSelf(?\Drupal\Tests\Component\ProxyBuilder\TestServiceNullableTypehintSelf $parameter): ?\Drupal\Tests\Component\ProxyBuilder\TestServiceNullableTypehintSelf public function typeHintSelf(?\Drupal\Tests\Component\ProxyBuilder\TestServiceNullableTypeHintSelf $parameter): ?\Drupal\Tests\Component\ProxyBuilder\TestServiceNullableTypeHintSelf
{ {
return $this->lazyLoadItself()->typehintSelf($parameter); return $this->lazyLoadItself()->typeHintSelf($parameter);
} }
EOS; EOS;
@ -438,9 +438,9 @@ class TestServiceComplexMethod {
} }
class TestServiceNullableTypehintSelf { class TestServiceNullableTypeHintSelf {
public function typehintSelf(?self $parameter): ?self { public function typeHintSelf(?self $parameter): ?self {
return NULL; return NULL;
} }

View File

@ -124,11 +124,11 @@ class ArgumentsResolverTest extends TestCase {
} }
/** /**
* Tests getArgument() with a wildcard parameter with no typehint. * Tests getArgument() with a wildcard parameter with no type hint.
* *
* Without the typehint, the wildcard object will not be passed to the callable. * Without the type hint, the wildcard object will not be passed to the callable.
*/ */
public function testGetWildcardArgumentNoTypehint() { public function testGetWildcardArgumentNoTypeHint() {
$a = $this->getMockBuilder('\Drupal\Tests\Component\Utility\Test1Interface')->getMock(); $a = $this->getMockBuilder('\Drupal\Tests\Component\Utility\Test1Interface')->getMock();
$wildcards = [$a]; $wildcards = [$a];
$resolver = new ArgumentsResolver([], [], $wildcards); $resolver = new ArgumentsResolver([], [], $wildcards);
@ -140,12 +140,12 @@ class ArgumentsResolverTest extends TestCase {
} }
/** /**
* Tests getArgument() with a named parameter with no typehint and a value. * Tests getArgument() with a named parameter with no type hint and a value.
* *
* Without the typehint, passing a value to a named parameter will still * Without the type hint, passing a value to a named parameter will still
* receive the provided value. * receive the provided value.
*/ */
public function testGetArgumentRouteNoTypehintAndValue() { public function testGetArgumentRouteNoTypeHintAndValue() {
$scalars = ['route' => 'foo']; $scalars = ['route' => 'foo'];
$resolver = new ArgumentsResolver($scalars, [], []); $resolver = new ArgumentsResolver($scalars, [], []);

View File

@ -142,8 +142,8 @@ class CsrfTokenGeneratorTest extends UnitTestCase {
public function testValidateParameterTypes($token, $value) { public function testValidateParameterTypes($token, $value) {
$this->setupDefaultExpectations(); $this->setupDefaultExpectations();
// The following check might throw PHP fatals and notices, so we disable // The following check might throw PHP fatal errors and notices, so we
// error assertions. // disable error assertions.
set_error_handler(function () { set_error_handler(function () {
return TRUE; return TRUE;
}); });

View File

@ -174,7 +174,7 @@ class StorageCopyTraitTest extends UnitTestCase {
class TestStorage extends MemoryStorage { class TestStorage extends MemoryStorage {
/** /**
* Provides a setter to bypass the array typehint on ::write(). * Provides a setter to bypass the array type hint on ::write().
* *
* This method allows us to create invalid configurations. The method * This method allows us to create invalid configurations. The method
* ::write() only allows values of the type array. * ::write() only allows values of the type array.

View File

@ -13,6 +13,8 @@ use GuzzleHttp\Psr7\Request;
use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\Process; use Symfony\Component\Process\Process;
// cspell:ignore htkey
/** /**
* Tests core/scripts/test-site.php. * Tests core/scripts/test-site.php.
* *