Commit 942c1cff authored by alexpott's avatar alexpott
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
<?php
// @codingStandardsIgnoreFile
namespace Drupal\Core\DependencyInjection;
......
<?php
// @codingStandardsIgnoreFile
namespace Drupal\Core\DependencyInjection;
......
......@@ -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.
*/
public function createHandlerInstance($class, EntityTypeInterface $definition = null) {
public function createHandlerInstance($class, EntityTypeInterface $definition = NULL) {
return $this->container->get('entity_type.manager')->createHandlerInstance($class, $definition);
}
......
......@@ -57,7 +57,7 @@ public function __construct($host) {
* @return \Symfony\Component\HttpFoundation\Request
* 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')) {
$server['HTTP_HOST'] = $this->host;
}
......
......@@ -61,7 +61,7 @@ class CompiledRoute extends SymfonyCompiledRoute {
* @param array $variables
* 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);
$this->fit = $fit;
......
......@@ -39,7 +39,7 @@ public function __construct(HttpKernelInterface $app) {
/**
* {@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.
foreach ($this->formats as $format => $mime_type) {
$request->setFormat($format, $mime_type);
......
......@@ -52,7 +52,7 @@ public function getCacheKey($name) {
* {@inheritdoc}
*/
public function isFresh($name, $time) {
return true;
return TRUE;
}
}
......@@ -150,12 +150,12 @@ public function getFilters() {
new \Twig_SimpleFilter('placeholder', [$this, 'escapePlaceholder'], array('is_safe' => array('html'), 'needs_environment' => TRUE)),
// 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.
// @todo Make that the default for |join? Upstream issue:
// 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.
new \Twig_SimpleFilter('without', 'twig_without'),
......@@ -547,7 +547,7 @@ public function renderVar($arg) {
*/
public function safeJoin(\Twig_Environment $env, $value, $glue = '') {
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) {
......
......@@ -85,7 +85,7 @@ public function hasMetadataFor($value) {
/**
* {@inheritdoc}
*/
public function validate($value, $constraints = null, $groups = null) {
public function validate($value, $constraints = NULL, $groups = NULL) {
return $this->startContext($value)
->validate($value, $constraints, $groups)
->getViolations();
......
......@@ -63,7 +63,7 @@ public function query() {
*/
protected function initializeIterator() {
$this->defaultTheme = $this->variableGet('theme_default', 'Garland');
$this->adminTheme = $this->variableGet('admin_theme', null);
$this->adminTheme = $this->variableGet('admin_theme', NULL);
return parent::initializeIterator();
}
......
......@@ -107,7 +107,7 @@ function template_preprocess_ckeditor_settings_toolbar(&$variables) {
// Set additional flag on the button if it can occur multiple times.
if (!empty($button['multiple'])) {
$button_item['multiple'] = true;
$button_item['multiple'] = TRUE;
}
return $button_item;
......
......@@ -32,7 +32,7 @@ protected function setUp() {
*/
public function testContactSettings() {
$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('some_other_category', $config->get('default_form'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'contact.settings', $config->get());
......
......@@ -109,9 +109,9 @@ protected function setUp() {
),
'settings' =>
array (
'display_summary' => true,
'display_summary' => TRUE,
'text_processing' => 1,
'user_register_form' => false,
'user_register_form' => FALSE,
),
'display' =>
array (
......@@ -136,7 +136,7 @@ protected function setUp() {
'weight' => 0,
),
),
'required' => false,
'required' => FALSE,
'description' => '',
)),
))
......
......@@ -67,7 +67,7 @@ public function testNormalize() {
array(
'href' => '/relations',
'name' => 'site',
'templated' => true,
'templated' => TRUE,
),
),
'self' => array(
......
......@@ -33,8 +33,8 @@ protected function setUp() {
*/
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_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_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']]);
}
/**
......
......@@ -178,13 +178,13 @@ public function providerLanguageAlterable() {
'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_bundle',
), 'language_content_settings');
$alterableConfig->setLanguageAlterable(true);
$alterableConfig->setLanguageAlterable(TRUE);
$nonAlterableConfig = new ContentLanguageSettings(array(
'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_fixed_language_bundle',
), 'language_content_settings');
$nonAlterableConfig->setLanguageAlterable(false);
$nonAlterableConfig->setLanguageAlterable(FALSE);
$defaultConfig = new ContentLanguageSettings(array(
'target_entity_type_id' => 'test_entity_type',
......@@ -192,9 +192,9 @@ public function providerLanguageAlterable() {
), 'language_content_settings');
return [
[$alterableConfig, true],
[$nonAlterableConfig, false],
[$defaultConfig, false],
[$alterableConfig, TRUE],
[$nonAlterableConfig, FALSE],
[$defaultConfig, FALSE],
];
}
......@@ -212,7 +212,7 @@ public function providerIsDefaultConfiguration() {
'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_bundle',
), 'language_content_settings');
$alteredLanguage->setLanguageAlterable(true);
$alteredLanguage->setLanguageAlterable(TRUE);
$alteredDefaultLangcode = new ContentLanguageSettings(array(
'target_entity_type_id' => 'test_entity_type',
......@@ -226,9 +226,9 @@ public function providerIsDefaultConfiguration() {
), 'language_content_settings');
return [
[$alteredLanguage, false],
[$alteredDefaultLangcode, false],
[$defaultConfig, true],
[$alteredLanguage, FALSE],
[$alteredDefaultLangcode, FALSE],
[$defaultConfig, TRUE],
];
}
......@@ -275,7 +275,7 @@ public function providerLoadByEntityTypeBundle() {
'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_bundle',
), 'language_content_settings');
$alteredLanguage->setLanguageAlterable(true);
$alteredLanguage->setLanguageAlterable(TRUE);
$langcode = $this->randomMachineName();
$alteredDefaultLangcode = new ContentLanguageSettings(array(
......@@ -290,10 +290,10 @@ public function providerLoadByEntityTypeBundle() {
), 'language_content_settings');
return [
['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_default_language_bundle', $defaultConfig, LanguageInterface::LANGCODE_SITE_DEFAULT, false],
['test_entity_type.null_bundle', NULL, LanguageInterface::LANGCODE_SITE_DEFAULT, false],
['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_default_language_bundle', $defaultConfig, LanguageInterface::LANGCODE_SITE_DEFAULT, FALSE],
['test_entity_type.null_bundle', NULL, LanguageInterface::LANGCODE_SITE_DEFAULT, FALSE],
];
}
......
......@@ -649,7 +649,7 @@ function addInvalidMenuLink() {
* Tests that parent options are limited by depth when adding menu links.
*/
function checkInvalidParentMenuLinks() {
$last_link = null;
$last_link = NULL;
$created_links = array();
// Get the max depth of the tree.
......
......@@ -1172,7 +1172,7 @@ function node_access_rebuild($batch_mode = FALSE) {
// user does not have access. And unless the current user has the bypass
// node access permission, no nodes are accessible since the grants have
// just been deleted.
$entity_query->accessCheck(false);
$entity_query->accessCheck(FALSE);
$nids = $entity_query->execute();
foreach ($nids as $nid) {
$node_storage->resetCache(array($nid));
......@@ -1227,7 +1227,7 @@ function _node_access_rebuild_batch_operation(&$context) {
// user does not have access. And unless the current user has the bypass
// node access permission, no nodes are accessible since the grants have
// just been deleted.
->accessCheck(false)
->accessCheck(FALSE)
->range(0, $limit)
->execute();
$node_storage->resetCache($nids);
......
......@@ -89,7 +89,7 @@ public function tearDownCacheBackend() {
* @return \Drupal\Core\Cache\CacheBackendInterface
* Cache backend to test.
*/
protected function getCacheBackend($bin = null) {
protected function getCacheBackend($bin = NULL) {
if (!isset($bin)) {
$bin = $this->getTestBin();
}
......
......@@ -29,7 +29,7 @@ protected function setup() {
parent::setUp();
$this->fileTranslation = new FileTranslation('filename');
$method = new \ReflectionMethod('\Drupal\Core\StringTranslation\Translator\FileTranslation', 'getTranslationFilesPattern');
$method->setAccessible(true);
$method->setAccessible(TRUE);
$this->filePatternMethod = $method;
}
......
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