Commit fea11b6d authored by alexpott's avatar alexpott

Issue #2803779 by pfrenssen, klausi, Mile23, alexpott, dawehner: Update Coder...

Issue #2803779 by pfrenssen, klausi, Mile23, alexpott, dawehner: Update Coder to 8.2.10 and fix errors from improved sniffs
parent 2b2f939d
......@@ -3043,21 +3043,22 @@
},
{
"name": "drupal/coder",
"version": "8.2.8",
"version": "8.2.10",
"source": {
"type": "git",
"url": "https://github.com/klausi/coder.git",
"reference": "6d717e1a5a5dd592ebbeaafad11746849fb52532"
"reference": "c835ff5c1733676fe0d3f3b861e814d570baaa6f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/klausi/coder/zipball/6d717e1a5a5dd592ebbeaafad11746849fb52532",
"reference": "6d717e1a5a5dd592ebbeaafad11746849fb52532",
"url": "https://api.github.com/repos/klausi/coder/zipball/c835ff5c1733676fe0d3f3b861e814d570baaa6f",
"reference": "c835ff5c1733676fe0d3f3b861e814d570baaa6f",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": ">=5.4.0",
"squizlabs/php_codesniffer": ">=2.5.1",
"squizlabs/php_codesniffer": ">=2.7.0 <3.0",
"symfony/yaml": ">=2.0.0"
},
"require-dev": {
......@@ -3075,7 +3076,7 @@
"phpcs",
"standards"
],
"time": "2016-07-05T20:48:03+00:00"
"time": "2016-12-09T21:57:53+00:00"
},
{
"name": "fabpot/goutte",
......
......@@ -38,7 +38,7 @@
"require-dev": {
"behat/mink": "1.7.x-dev",
"behat/mink-goutte-driver": "~1.2",
"drupal/coder": "8.2.8",
"drupal/coder": "8.2.10",
"jcalderonzumba/gastonjs": "~1.0.2",
"jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
"mikey179/vfsStream": "~1.2",
......
......@@ -730,7 +730,7 @@ function drupal_installation_attempted() {
* installation state. At all other times, the "install_profile" setting will be
* available in container as a parameter.
*
* @return string|null $profile
* @return string|null
* The name of the installation profile or NULL if no installation profile is
* currently active. This is the case for example during the first steps of
* the installer or during unit tests.
......
......@@ -37,7 +37,7 @@ public function setHeader(PoHeader $header);
/**
* Get header metadata.
*
* @return \Drupal\Component\Gettext\PoHeader $header
* @return \Drupal\Component\Gettext\PoHeader
* Header instance representing metadata in a PO header.
*/
public function getHeader();
......
......@@ -28,7 +28,7 @@ public function getContextDefinitions();
* @param string $name
* The name of the context in the plugin definition.
*
* @return \Drupal\Component\Plugin\Context\ContextDefinitionInterface.
* @return \Drupal\Component\Plugin\Context\ContextDefinitionInterface
* The definition against which the context value must validate.
*
* @throws \Drupal\Component\Plugin\Exception\PluginException
......@@ -103,7 +103,7 @@ public function setContext($name, ContextInterface $context);
* The value to set the context to. The value has to validate against the
* provided context definition.
*
* @return \Drupal\Component\Plugin\ContextAwarePluginInterface.
* @return \Drupal\Component\Plugin\ContextAwarePluginInterface
* A context aware plugin object for chaining.
*
* @throws \Drupal\Component\Plugin\Exception\PluginException
......
......@@ -102,7 +102,7 @@ public function setConfigurationValue($key, $value);
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @return array $form
* @return array
* The renderable form array representing the entire configuration form.
*/
public function blockForm($form, FormStateInterface $form_state);
......
......@@ -675,7 +675,7 @@ protected function drupalGetPath($type, $name) {
/**
* Gets the install profile from settings.
*
* @return string|null $profile
* @return string|null
* The name of the installation profile or NULL if no installation profile
* is currently active. This is the case for example during the first steps
* of the installer or during unit tests.
......
......@@ -69,7 +69,7 @@ public function getLanguage() {
/**
* Get configuration overrides.
*
* @return array.
* @return array
* The array of configuration overrides.
*/
public function getOverrides() {
......
......@@ -287,7 +287,7 @@ protected function languageManager() {
* \Drupal\Core\DependencyInjection\ContainerInjectionInterface should be used
* for injecting services.
*
* @return \Symfony\Component\DependencyInjection\ContainerInterface $container
* @return \Symfony\Component\DependencyInjection\ContainerInterface
* The service container.
*/
private function container() {
......
......@@ -16,7 +16,7 @@ interface ContentEntityFormInterface extends EntityFormInterface {
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @return \Drupal\Core\Entity\Display\EntityFormDisplayInterface.
* @return \Drupal\Core\Entity\Display\EntityFormDisplayInterface
* The current form display.
*/
public function getFormDisplay(FormStateInterface $form_state);
......
......@@ -16,7 +16,7 @@ interface EntityTypeManagerInterface extends PluginManagerInterface, CachedDisco
* @param string $entity_type
* The entity type for this access control handler.
*
* @return \Drupal\Core\Entity\EntityAccessControlHandlerInterface.
* @return \Drupal\Core\Entity\EntityAccessControlHandlerInterface
* A access control handler instance.
*/
public function getAccessControlHandler($entity_type);
......@@ -40,7 +40,7 @@ public function getStorage($entity_type);
* @param string $entity_type
* The entity type for this view builder.
*
* @return \Drupal\Core\Entity\EntityViewBuilderInterface.
* @return \Drupal\Core\Entity\EntityViewBuilderInterface
* A view builder instance.
*/
public function getViewBuilder($entity_type);
......
......@@ -44,7 +44,7 @@ public function exists($field, $function, $langcode = NULL);
* Queries for the nonexistence of a field.
*
* @param string $field
* @return ConditionInterface;
* @return ConditionInterface
* @see \Drupal\Core\Entity\Query\QueryInterface::notexists()
*/
public function notExists($field, $function, $langcode = NULL);
......
......@@ -50,7 +50,7 @@ public function exists($field, $langcode = NULL);
* Queries for the existence of a field.
*
* @param string $field
* @return ConditionInterface;
* @return ConditionInterface
* @see \Drupal\Core\Entity\Query\QueryInterface::notexists()
*/
public function notExists($field, $langcode = NULL);
......
......@@ -1723,9 +1723,9 @@ function hook_entity_bundle_field_info(\Drupal\Core\Entity\EntityTypeInterface $
if ($entity_type->id() == 'node' && $bundle == 'article') {
$fields = array();
$fields['mymodule_text_more'] = BaseFieldDefinition::create('string')
->setLabel(t('More text'))
->setComputed(TRUE)
->setClass('\Drupal\mymodule\EntityComputedMoreText');
->setLabel(t('More text'))
->setComputed(TRUE)
->setClass('\Drupal\mymodule\EntityComputedMoreText');
return $fields;
}
}
......
......@@ -69,7 +69,7 @@ public function getConfig() {
* https://www.drupal.org/node/1764380.
* @todo This does not set a value in \Drupal::config(), so the name is confusing.
*
* @return \Drupal\Core\Executable\ExecutablePluginBase.
* @return \Drupal\Core\Executable\ExecutablePluginBase
* The executable object for chaining.
*/
public function setConfig($key, $value) {
......
......@@ -147,7 +147,7 @@ public function resetConfigFactory() {
/**
* Gets the request object.
*
* @return \Symfony\Component\HttpFoundation\Request $request
* @return \Symfony\Component\HttpFoundation\Request
* The request object.
*/
protected function getRequest() {
......@@ -200,7 +200,7 @@ protected function currentUser() {
* \Drupal\Core\DependencyInjection\ContainerInjectionInterface should be used
* for injecting services.
*
* @return \Symfony\Component\DependencyInjection\ContainerInterface $container
* @return \Symfony\Component\DependencyInjection\ContainerInterface
* The service container.
*/
private function container() {
......
......@@ -27,7 +27,7 @@ public function getContextDefinitions();
* @param string $name
* The name of the context in the plugin definition.
*
* @return \Drupal\Core\Plugin\Context\ContextDefinitionInterface.
* @return \Drupal\Core\Plugin\Context\ContextDefinitionInterface
* The definition against which the context value must validate.
*
* @throws \Drupal\Component\Plugin\Exception\PluginException
......
......@@ -80,7 +80,7 @@ public function setPluginId($plugin_id) {
/**
* The selected page display variant plugin ID.
*
* @return string;
* @return string
*/
public function getPluginId() {
return $this->pluginId;
......
......@@ -640,8 +640,10 @@ protected function filterEmbeddedResponse(Request $fake_request, Response $embed
*
* @param \Symfony\Component\HttpFoundation\Request $request
* The request for which a response is being sent.
* @param \Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST|\Symfony\Component\HttpKernel\HttpKernelInterface::SUB_REQUEST $request_type
* The request type.
* @param int $request_type
* The request type. Can either be
* \Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST or
* \Symfony\Component\HttpKernel\HttpKernelInterface::SUB_REQUEST.
* @param \Symfony\Component\HttpFoundation\Response $response
* The response to filter.
*
......
......@@ -113,7 +113,7 @@ public function populateFromRouteMatch(RouteMatchInterface $route_match) {
/**
* Gets the entity instance for this mapper.
*
* @return \Drupal\Core\Config\Entity\ConfigEntityInterface $entity
* @return \Drupal\Core\Config\Entity\ConfigEntityInterface
* The configuration entity.
*/
public function getEntity() {
......
......@@ -116,14 +116,14 @@ public function testCalculateDependencies() {
$storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
$storage->expects($this->once())
->method('load')
->with($format_id)
->will($this->returnValue($filter_format));
->method('load')
->with($format_id)
->will($this->returnValue($filter_format));
$this->entityManager->expects($this->once())
->method('getStorage')
->with('filter_format')
->will($this->returnValue($storage));
->method('getStorage')
->with('filter_format')
->will($this->returnValue($storage));
$dependencies = $entity->calculateDependencies()->getDependencies();
$this->assertContains('test_module', $dependencies['module']);
......
......@@ -184,7 +184,7 @@ function history_user_delete($account) {
* @param int $node_id
* The node ID for which to attach the last read timestamp.
*
* @return array $element
* @return array
* A renderable array containing the last read timestamp.
*/
function history_attach_timestamp($node_id) {
......
......@@ -487,7 +487,7 @@ public function isDisplayed() {
/**
* Gets the entity manager.
*
* @return \Drupal\Core\Entity\EntityManagerInterface.
* @return \Drupal\Core\Entity\EntityManagerInterface
*/
protected function getEntityManager() {
if (!isset($this->entityManager)) {
......
......@@ -88,14 +88,14 @@ public function testPassingMigration() {
*/
public function testMissingEffectPlugin() {
Database::getConnection('default', 'migrate')->insert("imagecache_action")
->fields([
->fields([
'presetid',
'weight',
'module',
'action',
'data',
])
->values([
->values([
'presetid' => '1',
'weight' => '0',
'module' => 'imagecache',
......@@ -121,14 +121,14 @@ public function testMissingEffectPlugin() {
*/
public function testInvalidCropValues() {
Database::getConnection('default', 'migrate')->insert("imagecache_action")
->fields([
->fields([
'presetid',
'weight',
'module',
'action',
'data',
])
->values([
->values([
'presetid' => '1',
'weight' => '0',
'module' => 'imagecache',
......
......@@ -170,11 +170,11 @@ public function testGetPathToken() {
$image_style = $this->getImageStyleMock($image_effect_id, $image_effect, array('getPrivateKey', 'getHashSalt'));
$image_style->expects($this->any())
->method('getPrivateKey')
->will($this->returnValue($private_key));
->method('getPrivateKey')
->will($this->returnValue($private_key));
$image_style->expects($this->any())
->method('getHashSalt')
->will($this->returnValue($hash_salt));
->method('getHashSalt')
->will($this->returnValue($hash_salt));
// Assert the extension has been added to the URI before creating the token.
$this->assertEquals($image_style->getPathToken('public://test.jpeg.png'), $image_style->getPathToken('public://test.jpeg'));
......@@ -192,11 +192,11 @@ public function testGetPathToken() {
$image_style = $this->getImageStyleMock($image_effect_id, $image_effect, array('getPrivateKey', 'getHashSalt'));
$image_style->expects($this->any())
->method('getPrivateKey')
->will($this->returnValue($private_key));
->method('getPrivateKey')
->will($this->returnValue($private_key));
$image_style->expects($this->any())
->method('getHashSalt')
->will($this->returnValue($hash_salt));
->method('getHashSalt')
->will($this->returnValue($hash_salt));
// Assert no extension has been added to the uri before creating the token.
$this->assertNotEquals($image_style->getPathToken('public://test.jpeg.png'), $image_style->getPathToken('public://test.jpeg'));
$this->assertNotEquals(substr(Crypt::hmacBase64($image_style->id() . ':' . 'public://test.jpeg.png', $private_key . $hash_salt), 0, 8), $image_style->getPathToken('public://test.jpeg'));
......
......@@ -146,7 +146,7 @@ function language_element_info_alter(&$type) {
* @param array $element
* The form element to process.
*
* @return array $element
* @return array
* The processed form element.
*/
function language_process_language_select($element) {
......
......@@ -77,7 +77,7 @@ public function getLanguageConfigOverride($langcode, $name);
* @param string $langcode
* The language code for the override.
*
* @return \Drupal\Core\Config\StorageInterface $storage
* @return \Drupal\Core\Config\StorageInterface
* A storage object to use for reading and writing the
* configuration override.
*/
......
......@@ -92,7 +92,7 @@ public function getFormula($langcode) {
/**
* Loads the formulae and stores them on the PluralFormula object if not set.
*
* @return []
* @return array
*/
protected function loadFormulae() {
if (!isset($this->formulae)) {
......
......@@ -417,8 +417,8 @@ protected function dbStringSelect(array $conditions, array $options = array()) {
// Conditions for target fields when doing an outer join only make
// sense if we add also OR field IS NULL.
$query->condition(db_or()
->condition($field_alias, (array) $value, 'IN')
->isNull($field_alias)
->condition($field_alias, (array) $value, 'IN')
->isNull($field_alias)
);
}
else {
......
......@@ -55,7 +55,7 @@ public function __construct(DiscoveryInterface $decorated, callable $provider_ex
* A callable, gets passed a provider name, should return TRUE if the
* provider exists and FALSE if not.
*
* @return array|\mixed[] $definitions
* @return array|\mixed[]
* An array of plugin definitions. If a definition is an array and has a
* provider key that provider is guaranteed to exist.
*/
......
......@@ -485,7 +485,7 @@ protected function getFieldSchema(array $id_definition) {
*/
public function getRowBySource(array $source_id_values) {
$query = $this->getDatabase()->select($this->mapTableName(), 'map')
->fields('map');
->fields('map');
$query->condition(static::SOURCE_IDS_HASH, $this->getSourceIDsHash($source_id_values));
$result = $query->execute();
return $result->fetchAssoc();
......@@ -496,7 +496,7 @@ public function getRowBySource(array $source_id_values) {
*/
public function getRowByDestination(array $destination_id_values) {
$query = $this->getDatabase()->select($this->mapTableName(), 'map')
->fields('map');
->fields('map');
foreach ($this->destinationIdFields() as $field_name => $destination_id) {
$query->condition("map.$destination_id", $destination_id_values[$field_name], '=');
}
......@@ -510,10 +510,10 @@ public function getRowByDestination(array $destination_id_values) {
public function getRowsNeedingUpdate($count) {
$rows = array();
$result = $this->getDatabase()->select($this->mapTableName(), 'map')
->fields('map')
->condition('source_row_status', MigrateIdMapInterface::STATUS_NEEDS_UPDATE)
->range(0, $count)
->execute();
->fields('map')
->condition('source_row_status', MigrateIdMapInterface::STATUS_NEEDS_UPDATE)
->range(0, $count)
->execute();
foreach ($result as $row) {
$rows[] = $row;
}
......
......@@ -259,7 +259,7 @@ public function providerTestRouteWithParamQuery() {
* @param array|string $value
* Source link path information.
*
* @return array $actual
* @return array
* The route information based on the source link_path.
*/
protected function doTransform($value) {
......
......@@ -166,7 +166,7 @@ public function testCount() {
$container = new ContainerBuilder();
$cache = $this->getMock(CacheBackendInterface::class);
$cache->expects($this->any())->method('set')
->with($this->isType('string'), $this->isType('int'), $this->isType('int'));
->with($this->isType('string'), $this->isType('int'), $this->isType('int'));
$container->set('cache.migrate', $cache);
\Drupal::setContainer($container);
......@@ -204,7 +204,7 @@ public function testCountCacheKey() {
$container = new ContainerBuilder();
$cache = $this->getMock(CacheBackendInterface::class);
$cache->expects($this->any())->method('set')
->with('test_key', $this->isType('int'), $this->isType('int'));
->with('test_key', $this->isType('int'), $this->isType('int'));
$container->set('cache.migrate', $cache);
\Drupal::setContainer($container);
......
......@@ -166,11 +166,11 @@ function node_update_8001() {
// \Drupal::entityDefinitionUpdateManager()->updateFieldStorageDefinition()
// with the new definition.
$storage_definition = BaseFieldDefinition::create('boolean')
->setLabel(t('Revision translation affected'))
->setDescription(t('Indicates if the last edit of a translation belongs to current revision.'))
->setReadOnly(TRUE)
->setRevisionable(TRUE)
->setTranslatable(TRUE);
->setLabel(t('Revision translation affected'))
->setDescription(t('Indicates if the last edit of a translation belongs to current revision.'))
->setReadOnly(TRUE)
->setRevisionable(TRUE)
->setTranslatable(TRUE);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('revision_translation_affected', 'node', 'node', $storage_definition);
......
......@@ -23,7 +23,7 @@ interface NodeAccessControlHandlerInterface {
* @param \Drupal\node\NodeInterface $node
* The $node to acquire grants for.
*
* @return array $grants
* @return array
* The access rules for the node.
*/
public function acquireGrants(NodeInterface $node);
......@@ -74,7 +74,7 @@ public function countGrants();
* A user object representing the user for whom the operation is to be
* performed.
*
* @return int.
* @return int
* Status of the access check.
*/
public function checkAllGrants(AccountInterface $account);
......
......@@ -18,7 +18,7 @@ interface NodeGrantDatabaseStorageInterface {
* A user object representing the user for whom the operation is to be
* performed.
*
* @return int.
* @return int
* Status of the access check.
*/
public function checkAll(AccountInterface $account);
......
......@@ -433,8 +433,8 @@ public function updateIndex() {
$query->addExpression('MAX(sd.reindex)', 'ex2');
$query->condition(
$query->orConditionGroup()
->where('sd.sid IS NULL')
->condition('sd.reindex', 0, '<>')
->where('sd.sid IS NULL')
->condition('sd.reindex', 0, '<>')
);
$query->orderBy('ex', 'DESC')
->orderBy('ex2')
......
......@@ -99,8 +99,8 @@ public function testCalculateDependenciesWithEntityBundle() {
$target_entity_type_id = $this->randomMachineName(16);
$target_entity_type = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
$target_entity_type->expects($this->any())
->method('getProvider')
->will($this->returnValue('test_module'));
->method('getProvider')
->will($this->returnValue('test_module'));
$bundle_id = $this->randomMachineName(10);
$values = array('targetEntityType' => $target_entity_type_id , 'bundle' => $bundle_id);
......@@ -109,13 +109,13 @@ public function testCalculateDependenciesWithEntityBundle() {
->will($this->returnValue(array('type' => 'config', 'name' => 'test_module.type.' . $bundle_id)));
$this->entityManager->expects($this->at(0))
->method('getDefinition')
->with($target_entity_type_id)
->will($this->returnValue($target_entity_type));
->method('getDefinition')
->with($target_entity_type_id)
->will($this->returnValue($target_entity_type));
$this->entityManager->expects($this->at(1))
->method('getDefinition')
->with($this->entityTypeId)
->will($this->returnValue($this->entityType));
->method('getDefinition')
->with($this->entityTypeId)
->will($this->returnValue($this->entityType));
$entity = new RdfMapping($values, $this->entityTypeId);
$dependencies = $entity->calculateDependencies()->getDependencies();
......
......@@ -39,8 +39,8 @@ class ResponsiveImageStyleConfigEntityUnitTest extends UnitTestCase {
protected function setUp() {
$this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
$this->entityType->expects($this->any())
->method('getProvider')
->will($this->returnValue('responsive_image'));
->method('getProvider')
->will($this->returnValue('responsive_image'));
$this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
$this->entityManager->expects($this->any())
......
......@@ -25,13 +25,13 @@ class TestBaseTest extends UnitTestCase {
*/
public function getTestBaseForAssertionTests($test_id) {
$mock_test_base = $this->getMockBuilder('Drupal\simpletest\TestBase')
->setConstructorArgs(array($test_id))
->setMethods(array('storeAssertion'))
->getMockForAbstractClass();
->setConstructorArgs(array($test_id))
->setMethods(array('storeAssertion'))
->getMockForAbstractClass();
// Override storeAssertion() so we don't need a database.
$mock_test_base->expects($this->any())
->method('storeAssertion')
->will($this->returnValue(NULL));
->method('storeAssertion')
->will($this->returnValue(NULL));
return $mock_test_base;
}
......
......@@ -292,7 +292,7 @@ protected function runUpdates() {
$this->assertFalse($needs_updates, 'After all updates ran, entity schema is up to date.');
if ($needs_updates) {
foreach (\Drupal::entityDefinitionUpdateManager()
->getChangeSummary() as $entity_type_id => $summary) {
->getChangeSummary() as $entity_type_id => $summary) {
foreach ($summary as $message) {
$this->fail($message);
}
......
......@@ -31,11 +31,11 @@
// Update the config entity query "index".
$existing_blocks = $connection->select('key_value')
->fields('key_value', ['value'])
->condition('collection', 'config.entity.key_store.block')
->condition('name', 'theme:seven')
->execute()
->fetchField();
->fields('key_value', ['value'])
->condition('collection', 'config.entity.key_store.block')
->condition('name', 'theme:seven')
->execute()
->fetchField();
$existing_blocks = unserialize($existing_blocks);
$connection->update('key_value')
......
......@@ -31,11 +31,11 @@
// Update the config entity query "index".
$existing_blocks = $connection->select('key_value')
->fields('key_value', ['value'])
->condition('collection', 'config.entity.key_store.block')
->condition('name', 'theme:seven')
->execute()
->fetchField();
->fields('key_value', ['value'])
->condition('collection', 'config.entity.key_store.block')
->condition('name', 'theme:seven')
->execute()
->fetchField();
$existing_blocks = unserialize($existing_blocks);
$connection->update('key_value')
......
......@@ -339,7 +339,7 @@ public function permissionDependentContent() {
/**
* Returns the current date.
*
* @return \Symfony\Component\HttpFoundation\Response $response
* @return \Symfony\Component\HttpFoundation\Response
* A Response object containing the current date.
*/
public function getCurrentDate() {
......@@ -351,7 +351,7 @@ public function getCurrentDate() {
/**
* Returns a response with a test header set from the request.
*
* @return \Symfony\Component\HttpFoundation\Response $response
* @return \Symfony\Component\HttpFoundation\Response
* A Response object containing the test header.
*/
public function getTestHeader(Request $request) {
......
......@@ -42,8 +42,8 @@ public function testMenu() {
$migration = $this->getMigration('d6_menu');
\Drupal::database()
->truncate($migration->getIdMap()->mapTableName())
->execute();
->truncate($migration->getIdMap()->mapTableName())
->execute();
$this->executeMigration($migration);
$navigation_menu = Menu::load('navigation');
......
......@@ -57,8 +57,8 @@ public function testMenu() {
$migration = $this->getMigration('d7_menu');
\Drupal::database()
->truncate($migration->getIdMap()->mapTableName())
->execute();
->truncate($migration->getIdMap()->mapTableName())
->execute();