0
0
Fork 0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2025-03-15 22:04:51 +00:00

Replace deprecated array accessors in a few more files.

Ran php-cs-fixer with
`~/.composer/vendor/bin/php-cs-fixer fix . --rules=normalize_index_brace`
to automatically replace these. I've left out any changes to vendored
libraries.
This commit is contained in:
Connor Shea 2019-10-08 11:26:30 -06:00
parent b2ca8099a1
commit bf3e59028c
7 changed files with 16 additions and 16 deletions
include/SugarFields/Fields/Relate
jssource
modules
Calendar
EmailMan
SugarFeed
UpgradeWizard

View file

@ -324,9 +324,9 @@ class SugarFieldRelate extends SugarFieldBase
}
for ($i = 0; $i < strlen($default_locale_name_format); $i++) {
$new_field .= array_key_exists(
$default_locale_name_format{$i},
$default_locale_name_format[$i],
$names
) ? $names[$default_locale_name_format{$i}] : $default_locale_name_format{$i};
) ? $names[$default_locale_name_format[$i]] : $default_locale_name_format[$i];
}
} else {
$new_field = $rawField;

View file

@ -304,7 +304,7 @@ if (!defined('sugarEntry') || !sugarEntry) {
//Check to see that ReadNextLine is true, if so then add the last line collected
//make sure the last line is either the end to a comment block, or starts with '//'
//else do not add as it is live code.
if (!empty($newLine) && ((strpos($newLine, '*/')!== false) || ($newLine{0}.$newLine{1}== '//'))) {
if (!empty($newLine) && ((strpos($newLine, '*/')!== false) || ($newLine[0].$newLine[1]== '//'))) {
//add new line to license string
$lic_str .=$newLine;
}

View file

@ -372,7 +372,7 @@ class CalendarDisplay
if ($view == 'month' || $view == 'sharedMonth') {
for ($i=0; $i<strlen($dateFormat['date']); $i++) {
switch ($dateFormat['date']{$i}) {
switch ($dateFormat['date'][$i]) {
case "Y":
$str .= " ".$date_time->year;
break;
@ -388,7 +388,7 @@ class CalendarDisplay
$last_day = $first_day->get("+6 days");
for ($i=0; $i<strlen($dateFormat['date']); $i++) {
switch ($dateFormat['date']{$i}) {
switch ($dateFormat['date'][$i]) {
case "Y":
$str .= " ".$first_day->year;
break;
@ -402,7 +402,7 @@ class CalendarDisplay
}
$str .= " - ";
for ($i=0; $i<strlen($dateFormat['date']); $i++) {
switch ($dateFormat['date']{$i}) {
switch ($dateFormat['date'][$i]) {
case "Y":
$str .= " ".$last_day->year;
break;
@ -418,7 +418,7 @@ class CalendarDisplay
$str .= $date_time->get_day_of_week()." ";
for ($i=0; $i<strlen($dateFormat['date']); $i++) {
switch ($dateFormat['date']{$i}) {
switch ($dateFormat['date'][$i]) {
case "Y":
$str .= " ".$date_time->year;
break;
@ -434,7 +434,7 @@ class CalendarDisplay
$str .= $date_time->get_day_of_week()." ";
for ($i=0; $i<strlen($dateFormat['date']); $i++) {
switch ($dateFormat['date']{$i}) {
switch ($dateFormat['date'][$i]) {
case "Y":
$str .= " ".$date_time->year;
break;
@ -456,7 +456,7 @@ class CalendarDisplay
$last_day = $first_day->get("+6 days");
for ($i=0; $i<strlen($dateFormat['date']); $i++) {
switch ($dateFormat['date']{$i}) {
switch ($dateFormat['date'][$i]) {
case "Y":
$str .= " ".$first_day->year;
break;
@ -470,7 +470,7 @@ class CalendarDisplay
}
$str .= " - ";
for ($i=0; $i<strlen($dateFormat['date']); $i++) {
switch ($dateFormat['date']{$i}) {
switch ($dateFormat['date'][$i]) {
case "Y":
$str .= " ".$last_day->year;
break;

View file

@ -874,7 +874,7 @@ class EmailMan extends SugarBean
//make sure tracking url ends with '/' character
$strLen = strlen($this->tracking_url);
if ($this->tracking_url{$strLen - 1} != '/') {
if ($this->tracking_url[$strLen - 1] != '/') {
$this->tracking_url .= '/';
}

View file

@ -158,7 +158,7 @@ class SugarFeed extends Basic
}
$d = dir($baseDir);
while ($file = $d->read()) {
if ($file{0} == '.') {
if ($file[0] == '.') {
continue;
}
if (substr($file, -4) == '.php') {
@ -232,7 +232,7 @@ class SugarFeed extends Basic
if (file_exists($baseDir.$module.'/SugarFeeds/')) {
$dFeed = dir($baseDir.$module.'/SugarFeeds/');
while ($file = $dFeed->read()) {
if ($file{0} == '.') {
if ($file[0] == '.') {
continue;
}
if (substr($file, -4) == '.php') {
@ -338,7 +338,7 @@ class SugarFeed extends Basic
}
$d = dir($dirName);
while ($file = $d->read()) {
if ($file{0} == '.') {
if ($file[0] == '.') {
continue;
}
if (substr($file, -4) == '.php') {

View file

@ -54,7 +54,7 @@ class FeedLinkHandlerLink
$feed->link_type = $link_type;
//
if ($link_url{0} != '.' || $link_url{0} != '/') {
if ($link_url[0] != '.' || $link_url[0] != '/') {
// Automatically add http:// in front of the link_url if it doesn't already have it
if (strncmp($link_url, 'http://', 7) != 0 && strncmp($link_url, 'https://', 8) != 0) {
$link_url = 'http://'.$link_url;

View file

@ -2462,7 +2462,7 @@ function testThis()
$priorPath = '';
foreach ($files as $file) {
$relativeFile = clean_path(str_replace(getcwd().'/test', '', $file));
$relativeFile = ($relativeFile{0} == '/') ? substr($relativeFile, 1, strlen($relativeFile)) : $relativeFile;
$relativeFile = ($relativeFile[0] == '/') ? substr($relativeFile, 1, strlen($relativeFile)) : $relativeFile;
$relativePath = dirname($relativeFile);