Commit 45524a7d authored by catch's avatar catch

Issue #2903331 by mfernea: Fix...

Issue #2903331 by mfernea: Fix 'Drupal.NamingConventions.ValidVariableName.LowerStart' coding standard
parent eb0da10e
......@@ -15,7 +15,7 @@
*
* Callback for batch_set().
*
* @param $MULTIPLE_PARAMS
* @param $multiple_params
* Additional parameters specific to the batch. These are specified in the
* array passed to batch_set().
* @param array|\ArrayAccess $context
......@@ -54,7 +54,7 @@
* It is discouraged to typehint this parameter as an array, to allow an
* object implement \ArrayAccess to be passed.
*/
function callback_batch_operation($MULTIPLE_PARAMS, &$context) {
function callback_batch_operation($multiple_params, &$context) {
$node_storage = \Drupal::entityTypeManager()->getStorage('node');
$database = \Drupal::database();
......
......@@ -141,24 +141,24 @@ public function getProcess() {
try {
$plugin_id = $this->cckPluginManager->getPluginIdFromFieldType($field_type, [], $this);
$Manager = $this->cckPluginManager;
$manager = $this->cckPluginManager;
}
catch (PluginNotFoundException $ex) {
try {
$plugin_id = $this->fieldPluginManager->getPluginIdFromFieldType($field_type, [], $this);
$Manager = $this->fieldPluginManager;
$manager = $this->fieldPluginManager;
}
catch (PluginNotFoundException $ex) {
continue;
}
}
if (!isset($this->processedFieldTypes[$field_type]) && $Manager->hasDefinition($plugin_id)) {
if (!isset($this->processedFieldTypes[$field_type]) && $manager->hasDefinition($plugin_id)) {
$this->processedFieldTypes[$field_type] = TRUE;
// Allow the field plugin to alter the migration as necessary so that
// it knows how to handle fields of this type.
if (!isset($this->fieldPluginCache[$field_type])) {
$this->fieldPluginCache[$field_type] = $Manager->createInstance($plugin_id, [], $this);
$this->fieldPluginCache[$field_type] = $manager->createInstance($plugin_id, [], $this);
}
}
$method = $this->pluginDefinition[static::PLUGIN_METHOD];
......
......@@ -87,7 +87,7 @@ public function testUserAgentValidation() {
$this->drupalLogout();
$system_path = $base_url . '/' . drupal_get_path('module', 'system');
$HTTP_path = $system_path . '/tests/http.php/user/login';
$http_path = $system_path . '/tests/http.php/user/login';
$https_path = $system_path . '/tests/https.php/user/login';
// Generate a valid simpletest User-Agent to pass validation.
$this->assertTrue(preg_match('/test\d+/', $this->databasePrefix, $matches), 'Database prefix contains test prefix.');
......@@ -95,14 +95,14 @@ public function testUserAgentValidation() {
$this->additionalCurlOptions = [CURLOPT_USERAGENT => $test_ua];
// Test pages only available for testing.
$this->drupalGet($HTTP_path);
$this->drupalGet($http_path);
$this->assertResponse(200, 'Requesting http.php with a legitimate simpletest User-Agent returns OK.');
$this->drupalGet($https_path);
$this->assertResponse(200, 'Requesting https.php with a legitimate simpletest User-Agent returns OK.');
// Now slightly modify the HMAC on the header, which should not validate.
$this->additionalCurlOptions = [CURLOPT_USERAGENT => $test_ua . 'X'];
$this->drupalGet($HTTP_path);
$this->drupalGet($http_path);
$this->assertResponse(403, 'Requesting http.php with a bad simpletest User-Agent fails.');
$this->drupalGet($https_path);
$this->assertResponse(403, 'Requesting https.php with a bad simpletest User-Agent fails.');
......@@ -110,7 +110,7 @@ public function testUserAgentValidation() {
// Use a real User-Agent and verify that the special files http.php and
// https.php can't be accessed.
$this->additionalCurlOptions = [CURLOPT_USERAGENT => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'];
$this->drupalGet($HTTP_path);
$this->drupalGet($http_path);
$this->assertResponse(403, 'Requesting http.php with a normal User-Agent fails.');
$this->drupalGet($https_path);
$this->assertResponse(403, 'Requesting https.php with a normal User-Agent fails.');
......
......@@ -75,6 +75,10 @@
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/InfoFiles/ClassFilesSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/InfoFiles/DuplicateEntrySniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/InfoFiles/RequiredSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/NamingConventions/ValidVariableNameSniff.php">
<!-- Sniff for: LowerStart -->
<exclude name="Drupal.NamingConventions.ValidVariableName.LowerCamelName"/>
</rule>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Scope/MethodScopeSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/EmptyInstallSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/FunctionTSniff.php">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment