Commit 39730461 authored by damienmckenna's avatar damienmckenna Committed by Damien McKenna
Browse files

Issue #3208151 by DamienMcKenna: Coding standards cleanup

parent dc26f18a
......@@ -15,6 +15,7 @@ By DamienMcKenna: Unnecessary syntax change broke PHP 5.3 compatibility.
#3208147 by DamienMcKenna: Simplify nested ternary logic in _link_sanitize().
#3121196 by torotil, DamienMcKenna, calebtr: Support relative fragment or query
-only links.
#3208151 by DamienMcKenna: Coding standards cleanup.
Link 7.x-1.7, 2019-11-14
......@@ -346,7 +347,7 @@ Link 7.x-1.0, 2011-10-23
#948658 by brenk28, Dave Reid, becw, jcfiala, iMiksu, BTMash, Digidog: Fixed
noticeof Undefined index: title in _link_sanitize() - hopefully, finally.
#1079782 by fago, klausi, drunken monkey, jcfiala, Digidog: Fixed support for
hook_entity_property_info() including search API and Rules. @TODO: needs
hook_entity_property_info() including search API and Rules. @todo: needs
simpletests to be submitted for rc1.
Link 7.x-1.0-beta1, 2011-09-26
......
......@@ -476,7 +476,7 @@ function _link_process(&$item, $delta, $field, $entity, $instance) {
$base_paths[] = $GLOBALS['base_insecure_url'] . base_path();
}
// Add any additional paths
// Add any additional paths.
if ($extra_paths = variable_get('link_base_urls', array())) {
// Create versions with and without the base path.
foreach ($extra_paths as $extra_path) {
......@@ -486,7 +486,7 @@ function _link_process(&$item, $delta, $field, $entity, $instance) {
}
$paths_to_test = array(
$item['url']
$item['url'],
);
foreach ($base_paths as $path) {
......@@ -1415,8 +1415,8 @@ function theme_link_formatter_link_separate($vars) {
unset($link_options['url']);
$title = empty($vars['element']['title']) ? '' : check_plain($vars['element']['title']);
// @TODO static html markup looks not very elegant
// needs smarter output solution and an optional title/url seperator
// @todo Static html markup looks not very elegant, needs smarter output
// solution and an optional title/URL seperator.
$url_parts = _link_parse_url($vars['element']['url']);
$output = '';
$output .= '<div class="link-item ' . $class . '">';
......@@ -1430,11 +1430,10 @@ function theme_link_formatter_link_separate($vars) {
/**
* Implements hook_token_list().
*
* @TODO: hook_token_list no longer exists - this should change to
* hook_token_info().
*/
function link_token_list($type = 'all') {
// @todo hook_token_list() no longer exists, this should be rewritten as
// hook_token_info().
if ($type === 'field' || $type === 'all') {
$tokens = array();
$tokens['link']['url'] = t("Link URL");
......@@ -1446,11 +1445,10 @@ function link_token_list($type = 'all') {
/**
* Implements hook_token_values().
*
* @TODO: hook_token_values no longer exists - this should change to
* hook_tokens().
*/
function link_token_values($type, $object = NULL) {
// @todo hook_token_values() no longer exists, this should be rewritten as
// hook_tokens().
if ($type === 'field') {
$item = $object[0];
......@@ -1516,7 +1514,6 @@ function link_cleanup_url($url, $protocol = 'http') {
* True if a valid link, FALSE otherwise.
*/
function link_validate_url($text, $langcode = NULL) {
$text = _link_clean_relative($text);
$text = link_cleanup_url($text);
$type = link_url_type($text);
......@@ -1585,7 +1582,7 @@ function _link_clean_relative($url) {
* the LINK_(linktype) constants.
*/
function link_url_type($text) {
// @TODO Complete letters.
// @todo Complete letters.
// @codingStandardsIgnoreStart
$link_ichars_domain = (string) html_entity_decode(implode("", array(
"&#x00BF;", // ¿
......@@ -1660,7 +1657,7 @@ function link_url_type($text) {
// @codingStandardsIgnoreEnd
$link_ichars = $link_ichars_domain . (string) html_entity_decode(implode("", array(
// ß.
// ß.
"&#x00DF;",
)), ENT_QUOTES, 'UTF-8');
$allowed_protocols = variable_get('filter_allowed_protocols', array(
......
......@@ -24,7 +24,7 @@ class LinkConvertInternalPathsTest extends LinkBaseTestClass {
/**
* {@inheritdoc}
*/
function setUp(array $modules = array()) {
public function setUp(array $modules = array()) {
$modules[] = 'path';
parent::setUp($modules);
}
......@@ -32,7 +32,7 @@ class LinkConvertInternalPathsTest extends LinkBaseTestClass {
/**
* Test the alias handling.
*/
function testInternalPathConversion() {
public function testInternalPathConversion() {
// Create 2 fields, one which converts aliases and one which doesn't.
$settings = array(
'instance[settings][convert_aliases]' => TRUE,
......
......@@ -10,8 +10,18 @@
*/
class LinkFieldAttributesTest extends DrupalWebTestCase {
/**
* Track a zebra value, used to alternate the output.
*
* @var int
*/
private $zebra;
/**
* List of permissions to test.
*
* @var array
*/
protected $permissions = array(
'access content',
'administer content types',
......
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