Unverified Commit 3af9d071 authored by larowlan's avatar larowlan

Issue #2935151 by alexpott: Long array syntax checking in ./core files is broken

parent ba4f89ed
......@@ -634,7 +634,7 @@ public function fieldSetNoDefault($table, $field) {
public function fieldExists($table, $column) {
$prefixInfo = $this->getPrefixInfo($table);
return (bool) $this->connection->query("SELECT 1 FROM pg_attribute WHERE attrelid = :key::regclass AND attname = :column AND NOT attisdropped AND attnum > 0", array(':key' => $prefixInfo['schema'] . '.' . $prefixInfo['table'], ':column' => $column))->fetchField();
return (bool) $this->connection->query("SELECT 1 FROM pg_attribute WHERE attrelid = :key::regclass AND attname = :column AND NOT attisdropped AND attnum > 0", [':key' => $prefixInfo['schema'] . '.' . $prefixInfo['table'], ':column' => $column])->fetchField();
}
/**
......
......@@ -414,7 +414,7 @@ public function invokeAll($hook, array $args = []) {
/**
* {@inheritdoc}
*/
public function invokeDeprecated($description, $module, $hook, array $args = array()) {
public function invokeDeprecated($description, $module, $hook, array $args = []) {
$result = $this->invoke($module, $hook, $args);
$this->triggerDeprecationError($description, $hook);
return $result;
......@@ -423,7 +423,7 @@ public function invokeDeprecated($description, $module, $hook, array $args = arr
/**
* {@inheritdoc}
*/
public function invokeAllDeprecated($description, $hook, array $args = array()) {
public function invokeAllDeprecated($description, $hook, array $args = []) {
$result = $this->invokeAll($hook, $args);
$this->triggerDeprecationError($description, $hook);
return $result;
......
......@@ -16,7 +16,6 @@
<!-- Only include specific sniffs that pass. This ensures that, if new sniffs are added, HEAD does not fail.-->
<!-- Drupal sniffs -->
<rule ref="Drupal.Array.DisallowLongArraySyntax"/>
<rule ref="Drupal.Classes.ClassCreateInstance"/>
<rule ref="Drupal.Classes.ClassDeclaration"/>
<rule ref="Drupal.Classes.FullyQualifiedNamespace"/>
......@@ -133,6 +132,7 @@
<rule ref="DrupalPractice.Commenting.ExpectedException"/>
<!-- Generic sniffs -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.Files.ByteOrderMark"/>
<rule ref="Generic.Files.LineEndings"/>
<rule ref="Generic.Formatting.SpaceAfterCast"/>
......
......@@ -48,7 +48,7 @@ trait PhpunitCompatibilityTrait {
*
* @see https://www.drupal.org/node/2907725
*/
public function getMock($originalClassName, $methods = array(), array $arguments = array(), $mockClassName = '', $callOriginalConstructor = TRUE, $callOriginalClone = TRUE, $callAutoload = TRUE, $cloneArguments = FALSE, $callOriginalMethods = FALSE, $proxyTarget = NULL) {
public function getMock($originalClassName, $methods = [], array $arguments = [], $mockClassName = '', $callOriginalConstructor = TRUE, $callOriginalClone = TRUE, $callAutoload = TRUE, $cloneArguments = FALSE, $callOriginalMethods = FALSE, $proxyTarget = NULL) {
if (!$this->supports('getMock')) {
$mock = $this->getMockBuilder($originalClassName)
->setMethods($methods)
......
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