Skip to content
Snippets Groups Projects
Commit 942c1cff authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2572307 by vprocessor, attiks, andriyun, alexpott, pfrenssen: Fix...

Issue #2572307 by vprocessor, attiks, andriyun, alexpott, pfrenssen: Fix 'Generic.PHP.UpperCaseConstant' coding standard
parent 0fcef5bd
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Showing
with 39 additions and 37 deletions
<?php <?php
// @codingStandardsIgnoreFile
namespace Drupal\Core\DependencyInjection; namespace Drupal\Core\DependencyInjection;
......
<?php <?php
// @codingStandardsIgnoreFile
namespace Drupal\Core\DependencyInjection; namespace Drupal\Core\DependencyInjection;
......
...@@ -121,7 +121,7 @@ public function getHandler($entity_type, $handler_type) { ...@@ -121,7 +121,7 @@ public function getHandler($entity_type, $handler_type) {
* *
* @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
*/ */
public function createHandlerInstance($class, EntityTypeInterface $definition = null) { public function createHandlerInstance($class, EntityTypeInterface $definition = NULL) {
return $this->container->get('entity_type.manager')->createHandlerInstance($class, $definition); return $this->container->get('entity_type.manager')->createHandlerInstance($class, $definition);
} }
......
...@@ -57,7 +57,7 @@ public function __construct($host) { ...@@ -57,7 +57,7 @@ public function __construct($host) {
* @return \Symfony\Component\HttpFoundation\Request * @return \Symfony\Component\HttpFoundation\Request
* A new request object. * A new request object.
**/ **/
public function createRequest(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) { public function createRequest(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = NULL) {
if (empty($server['HTTP_HOST']) || ($server['HTTP_HOST'] === 'localhost' && $this->host !== 'localhost')) { if (empty($server['HTTP_HOST']) || ($server['HTTP_HOST'] === 'localhost' && $this->host !== 'localhost')) {
$server['HTTP_HOST'] = $this->host; $server['HTTP_HOST'] = $this->host;
} }
......
...@@ -61,7 +61,7 @@ class CompiledRoute extends SymfonyCompiledRoute { ...@@ -61,7 +61,7 @@ class CompiledRoute extends SymfonyCompiledRoute {
* @param array $variables * @param array $variables
* An array of variables (variables defined in the path and in the host patterns) * An array of variables (variables defined in the path and in the host patterns)
*/ */
public function __construct($fit, $pattern_outline, $num_parts, $staticPrefix, $regex, array $tokens, array $pathVariables, $hostRegex = null, array $hostTokens = array(), array $hostVariables = array(), array $variables = array()) { public function __construct($fit, $pattern_outline, $num_parts, $staticPrefix, $regex, array $tokens, array $pathVariables, $hostRegex = NULL, array $hostTokens = array(), array $hostVariables = array(), array $variables = array()) {
parent::__construct($staticPrefix, $regex, $tokens, $pathVariables, $hostRegex, $hostTokens, $hostVariables, $variables); parent::__construct($staticPrefix, $regex, $tokens, $pathVariables, $hostRegex, $hostTokens, $hostVariables, $variables);
$this->fit = $fit; $this->fit = $fit;
......
...@@ -39,7 +39,7 @@ public function __construct(HttpKernelInterface $app) { ...@@ -39,7 +39,7 @@ public function __construct(HttpKernelInterface $app) {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true) { public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE) {
// Register available mime types. // Register available mime types.
foreach ($this->formats as $format => $mime_type) { foreach ($this->formats as $format => $mime_type) {
$request->setFormat($format, $mime_type); $request->setFormat($format, $mime_type);
......
...@@ -52,7 +52,7 @@ public function getCacheKey($name) { ...@@ -52,7 +52,7 @@ public function getCacheKey($name) {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function isFresh($name, $time) { public function isFresh($name, $time) {
return true; return TRUE;
} }
} }
...@@ -150,12 +150,12 @@ public function getFilters() { ...@@ -150,12 +150,12 @@ public function getFilters() {
new \Twig_SimpleFilter('placeholder', [$this, 'escapePlaceholder'], array('is_safe' => array('html'), 'needs_environment' => TRUE)), new \Twig_SimpleFilter('placeholder', [$this, 'escapePlaceholder'], array('is_safe' => array('html'), 'needs_environment' => TRUE)),
// Replace twig's escape filter with our own. // Replace twig's escape filter with our own.
new \Twig_SimpleFilter('drupal_escape', [$this, 'escapeFilter'], array('needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe')), new \Twig_SimpleFilter('drupal_escape', [$this, 'escapeFilter'], array('needs_environment' => TRUE, 'is_safe_callback' => 'twig_escape_filter_is_safe')),
// Implements safe joining. // Implements safe joining.
// @todo Make that the default for |join? Upstream issue: // @todo Make that the default for |join? Upstream issue:
// https://github.com/fabpot/Twig/issues/1420 // https://github.com/fabpot/Twig/issues/1420
new \Twig_SimpleFilter('safe_join', [$this, 'safeJoin'], ['needs_environment' => true, 'is_safe' => ['html']]), new \Twig_SimpleFilter('safe_join', [$this, 'safeJoin'], ['needs_environment' => TRUE, 'is_safe' => ['html']]),
// Array filters. // Array filters.
new \Twig_SimpleFilter('without', 'twig_without'), new \Twig_SimpleFilter('without', 'twig_without'),
...@@ -547,7 +547,7 @@ public function renderVar($arg) { ...@@ -547,7 +547,7 @@ public function renderVar($arg) {
*/ */
public function safeJoin(\Twig_Environment $env, $value, $glue = '') { public function safeJoin(\Twig_Environment $env, $value, $glue = '') {
if ($value instanceof \Traversable) { if ($value instanceof \Traversable) {
$value = iterator_to_array($value, false); $value = iterator_to_array($value, FALSE);
} }
return implode($glue, array_map(function($item) use ($env) { return implode($glue, array_map(function($item) use ($env) {
......
...@@ -85,7 +85,7 @@ public function hasMetadataFor($value) { ...@@ -85,7 +85,7 @@ public function hasMetadataFor($value) {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function validate($value, $constraints = null, $groups = null) { public function validate($value, $constraints = NULL, $groups = NULL) {
return $this->startContext($value) return $this->startContext($value)
->validate($value, $constraints, $groups) ->validate($value, $constraints, $groups)
->getViolations(); ->getViolations();
......
...@@ -63,7 +63,7 @@ public function query() { ...@@ -63,7 +63,7 @@ public function query() {
*/ */
protected function initializeIterator() { protected function initializeIterator() {
$this->defaultTheme = $this->variableGet('theme_default', 'Garland'); $this->defaultTheme = $this->variableGet('theme_default', 'Garland');
$this->adminTheme = $this->variableGet('admin_theme', null); $this->adminTheme = $this->variableGet('admin_theme', NULL);
return parent::initializeIterator(); return parent::initializeIterator();
} }
......
...@@ -107,7 +107,7 @@ function template_preprocess_ckeditor_settings_toolbar(&$variables) { ...@@ -107,7 +107,7 @@ function template_preprocess_ckeditor_settings_toolbar(&$variables) {
// Set additional flag on the button if it can occur multiple times. // Set additional flag on the button if it can occur multiple times.
if (!empty($button['multiple'])) { if (!empty($button['multiple'])) {
$button_item['multiple'] = true; $button_item['multiple'] = TRUE;
} }
return $button_item; return $button_item;
......
...@@ -32,7 +32,7 @@ protected function setUp() { ...@@ -32,7 +32,7 @@ protected function setUp() {
*/ */
public function testContactSettings() { public function testContactSettings() {
$config = $this->config('contact.settings'); $config = $this->config('contact.settings');
$this->assertIdentical(true, $config->get('user_default_enabled')); $this->assertIdentical(TRUE, $config->get('user_default_enabled'));
$this->assertIdentical(3, $config->get('flood.limit')); $this->assertIdentical(3, $config->get('flood.limit'));
$this->assertIdentical('some_other_category', $config->get('default_form')); $this->assertIdentical('some_other_category', $config->get('default_form'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'contact.settings', $config->get()); $this->assertConfigSchema(\Drupal::service('config.typed'), 'contact.settings', $config->get());
......
...@@ -109,9 +109,9 @@ protected function setUp() { ...@@ -109,9 +109,9 @@ protected function setUp() {
), ),
'settings' => 'settings' =>
array ( array (
'display_summary' => true, 'display_summary' => TRUE,
'text_processing' => 1, 'text_processing' => 1,
'user_register_form' => false, 'user_register_form' => FALSE,
), ),
'display' => 'display' =>
array ( array (
...@@ -136,7 +136,7 @@ protected function setUp() { ...@@ -136,7 +136,7 @@ protected function setUp() {
'weight' => 0, 'weight' => 0,
), ),
), ),
'required' => false, 'required' => FALSE,
'description' => '', 'description' => '',
)), )),
)) ))
......
...@@ -67,7 +67,7 @@ public function testNormalize() { ...@@ -67,7 +67,7 @@ public function testNormalize() {
array( array(
'href' => '/relations', 'href' => '/relations',
'name' => 'site', 'name' => 'site',
'templated' => true, 'templated' => TRUE,
), ),
), ),
'self' => array( 'self' => array(
......
...@@ -33,8 +33,8 @@ protected function setUp() { ...@@ -33,8 +33,8 @@ protected function setUp() {
*/ */
public function testImageStylesMigration() { public function testImageStylesMigration() {
$this->assertEntity('custom_image_style_1', "Custom image style 1", ['image_scale_and_crop', 'image_desaturate'], [['width' => 55, 'height' => 55], []]); $this->assertEntity('custom_image_style_1', "Custom image style 1", ['image_scale_and_crop', 'image_desaturate'], [['width' => 55, 'height' => 55], []]);
$this->assertEntity('custom_image_style_2', "Custom image style 2", ['image_resize', 'image_rotate'], [['width' => 55, 'height' => 100], ['degrees' => 45, 'bgcolor' => '#FFFFFF', 'random' => false]]); $this->assertEntity('custom_image_style_2', "Custom image style 2", ['image_resize', 'image_rotate'], [['width' => 55, 'height' => 100], ['degrees' => 45, 'bgcolor' => '#FFFFFF', 'random' => FALSE]]);
$this->assertEntity('custom_image_style_3', "Custom image style 3", ['image_scale', 'image_crop'], [['width' => 150, 'height' => NULL, 'upscale' => false], ['width' => 50, 'height' => 50, 'anchor' => 'left-top']]); $this->assertEntity('custom_image_style_3', "Custom image style 3", ['image_scale', 'image_crop'], [['width' => 150, 'height' => NULL, 'upscale' => FALSE], ['width' => 50, 'height' => 50, 'anchor' => 'left-top']]);
} }
/** /**
......
...@@ -178,13 +178,13 @@ public function providerLanguageAlterable() { ...@@ -178,13 +178,13 @@ public function providerLanguageAlterable() {
'target_entity_type_id' => 'test_entity_type', 'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_bundle', 'target_bundle' => 'test_bundle',
), 'language_content_settings'); ), 'language_content_settings');
$alterableConfig->setLanguageAlterable(true); $alterableConfig->setLanguageAlterable(TRUE);
$nonAlterableConfig = new ContentLanguageSettings(array( $nonAlterableConfig = new ContentLanguageSettings(array(
'target_entity_type_id' => 'test_entity_type', 'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_fixed_language_bundle', 'target_bundle' => 'test_fixed_language_bundle',
), 'language_content_settings'); ), 'language_content_settings');
$nonAlterableConfig->setLanguageAlterable(false); $nonAlterableConfig->setLanguageAlterable(FALSE);
$defaultConfig = new ContentLanguageSettings(array( $defaultConfig = new ContentLanguageSettings(array(
'target_entity_type_id' => 'test_entity_type', 'target_entity_type_id' => 'test_entity_type',
...@@ -192,9 +192,9 @@ public function providerLanguageAlterable() { ...@@ -192,9 +192,9 @@ public function providerLanguageAlterable() {
), 'language_content_settings'); ), 'language_content_settings');
return [ return [
[$alterableConfig, true], [$alterableConfig, TRUE],
[$nonAlterableConfig, false], [$nonAlterableConfig, FALSE],
[$defaultConfig, false], [$defaultConfig, FALSE],
]; ];
} }
...@@ -212,7 +212,7 @@ public function providerIsDefaultConfiguration() { ...@@ -212,7 +212,7 @@ public function providerIsDefaultConfiguration() {
'target_entity_type_id' => 'test_entity_type', 'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_bundle', 'target_bundle' => 'test_bundle',
), 'language_content_settings'); ), 'language_content_settings');
$alteredLanguage->setLanguageAlterable(true); $alteredLanguage->setLanguageAlterable(TRUE);
$alteredDefaultLangcode = new ContentLanguageSettings(array( $alteredDefaultLangcode = new ContentLanguageSettings(array(
'target_entity_type_id' => 'test_entity_type', 'target_entity_type_id' => 'test_entity_type',
...@@ -226,9 +226,9 @@ public function providerIsDefaultConfiguration() { ...@@ -226,9 +226,9 @@ public function providerIsDefaultConfiguration() {
), 'language_content_settings'); ), 'language_content_settings');
return [ return [
[$alteredLanguage, false], [$alteredLanguage, FALSE],
[$alteredDefaultLangcode, false], [$alteredDefaultLangcode, FALSE],
[$defaultConfig, true], [$defaultConfig, TRUE],
]; ];
} }
...@@ -275,7 +275,7 @@ public function providerLoadByEntityTypeBundle() { ...@@ -275,7 +275,7 @@ public function providerLoadByEntityTypeBundle() {
'target_entity_type_id' => 'test_entity_type', 'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_bundle', 'target_bundle' => 'test_bundle',
), 'language_content_settings'); ), 'language_content_settings');
$alteredLanguage->setLanguageAlterable(true); $alteredLanguage->setLanguageAlterable(TRUE);
$langcode = $this->randomMachineName(); $langcode = $this->randomMachineName();
$alteredDefaultLangcode = new ContentLanguageSettings(array( $alteredDefaultLangcode = new ContentLanguageSettings(array(
...@@ -290,10 +290,10 @@ public function providerLoadByEntityTypeBundle() { ...@@ -290,10 +290,10 @@ public function providerLoadByEntityTypeBundle() {
), 'language_content_settings'); ), 'language_content_settings');
return [ return [
['test_entity_type.test_bundle', $alteredLanguage, LanguageInterface::LANGCODE_SITE_DEFAULT, true], ['test_entity_type.test_bundle', $alteredLanguage, LanguageInterface::LANGCODE_SITE_DEFAULT, TRUE],
['test_entity_type.test_fixed_language_bundle', $alteredDefaultLangcode, $langcode, false], ['test_entity_type.test_fixed_language_bundle', $alteredDefaultLangcode, $langcode, FALSE],
['test_entity_type.test_default_language_bundle', $defaultConfig, LanguageInterface::LANGCODE_SITE_DEFAULT, false], ['test_entity_type.test_default_language_bundle', $defaultConfig, LanguageInterface::LANGCODE_SITE_DEFAULT, FALSE],
['test_entity_type.null_bundle', NULL, LanguageInterface::LANGCODE_SITE_DEFAULT, false], ['test_entity_type.null_bundle', NULL, LanguageInterface::LANGCODE_SITE_DEFAULT, FALSE],
]; ];
} }
......
...@@ -649,7 +649,7 @@ function addInvalidMenuLink() { ...@@ -649,7 +649,7 @@ function addInvalidMenuLink() {
* Tests that parent options are limited by depth when adding menu links. * Tests that parent options are limited by depth when adding menu links.
*/ */
function checkInvalidParentMenuLinks() { function checkInvalidParentMenuLinks() {
$last_link = null; $last_link = NULL;
$created_links = array(); $created_links = array();
// Get the max depth of the tree. // Get the max depth of the tree.
......
...@@ -1172,7 +1172,7 @@ function node_access_rebuild($batch_mode = FALSE) { ...@@ -1172,7 +1172,7 @@ function node_access_rebuild($batch_mode = FALSE) {
// user does not have access. And unless the current user has the bypass // user does not have access. And unless the current user has the bypass
// node access permission, no nodes are accessible since the grants have // node access permission, no nodes are accessible since the grants have
// just been deleted. // just been deleted.
$entity_query->accessCheck(false); $entity_query->accessCheck(FALSE);
$nids = $entity_query->execute(); $nids = $entity_query->execute();
foreach ($nids as $nid) { foreach ($nids as $nid) {
$node_storage->resetCache(array($nid)); $node_storage->resetCache(array($nid));
...@@ -1227,7 +1227,7 @@ function _node_access_rebuild_batch_operation(&$context) { ...@@ -1227,7 +1227,7 @@ function _node_access_rebuild_batch_operation(&$context) {
// user does not have access. And unless the current user has the bypass // user does not have access. And unless the current user has the bypass
// node access permission, no nodes are accessible since the grants have // node access permission, no nodes are accessible since the grants have
// just been deleted. // just been deleted.
->accessCheck(false) ->accessCheck(FALSE)
->range(0, $limit) ->range(0, $limit)
->execute(); ->execute();
$node_storage->resetCache($nids); $node_storage->resetCache($nids);
......
...@@ -89,7 +89,7 @@ public function tearDownCacheBackend() { ...@@ -89,7 +89,7 @@ public function tearDownCacheBackend() {
* @return \Drupal\Core\Cache\CacheBackendInterface * @return \Drupal\Core\Cache\CacheBackendInterface
* Cache backend to test. * Cache backend to test.
*/ */
protected function getCacheBackend($bin = null) { protected function getCacheBackend($bin = NULL) {
if (!isset($bin)) { if (!isset($bin)) {
$bin = $this->getTestBin(); $bin = $this->getTestBin();
} }
......
...@@ -29,7 +29,7 @@ protected function setup() { ...@@ -29,7 +29,7 @@ protected function setup() {
parent::setUp(); parent::setUp();
$this->fileTranslation = new FileTranslation('filename'); $this->fileTranslation = new FileTranslation('filename');
$method = new \ReflectionMethod('\Drupal\Core\StringTranslation\Translator\FileTranslation', 'getTranslationFilesPattern'); $method = new \ReflectionMethod('\Drupal\Core\StringTranslation\Translator\FileTranslation', 'getTranslationFilesPattern');
$method->setAccessible(true); $method->setAccessible(TRUE);
$this->filePatternMethod = $method; $this->filePatternMethod = $method;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment