Skip to content

Commit

Permalink
Drush 8 - PHP 7.4: Fix deprecation notices (#4362)
Browse files Browse the repository at this point in the history
* Drush 8 - PHP 7.4: Fix deprecations

Deprecated: Array and string offset access syntax with curly braces is deprecated

* Drush 8 - PHP 7.4: Fix deprecations

Deprecated: Array and string offset access syntax with curly braces is deprecated

* Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4

* Passing the $glue and $pieces parameters in reverse order to implode has been deprecated since PHP 7.4; $glue should be the first parameter and $pieces the second
  • Loading branch information
sjerdo committed Apr 15, 2020
1 parent 75c3362 commit 64cf3db
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion commands/core/rsync.core.inc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function drush_core_rsync($source, $destination, $additional_options = array())
// Get all of the args and options that appear after the command name.
$original_args = drush_get_original_cli_args_and_options();
foreach ($original_args as $original_option) {
if ($original_option{0} == '-') {
if ($original_option[0] == '-') {
$options .= ' ' . $original_option;
}
}
Expand Down
2 changes: 1 addition & 1 deletion commands/make/generate.make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function _drush_generate_custom_project($name, $extension, $version_options) {
drush_shell_cd_and_exec($repo_root, 'git branch');
$output = drush_shell_exec_output();
foreach ($output as $line) {
if ($line{0} == '*') {
if ($line[0] == '*') {
$branch = substr($line, 2);
if ($branch != "master") {
$project['download][branch'] = $branch;
Expand Down
2 changes: 1 addition & 1 deletion commands/pm/info.pm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function _drush_pm_info_theme($info) {
$data['core'] = $info->info['core'];
$data['php'] = $info->info['php'];
$data['engine'] = $info->info['engine'];
$data['base_theme'] = isset($info->base_themes) ? implode($info->base_themes, ', ') : '';
$data['base_theme'] = isset($info->base_themes) ? implode(', ', $info->base_themes) : '';
$regions = $info->info['regions'];
$data['regions'] = $regions;
$features = $info->info['features'];
Expand Down
6 changes: 3 additions & 3 deletions includes/command.inc
Original file line number Diff line number Diff line change
Expand Up @@ -857,9 +857,9 @@ function drush_parse_args() {
$command_args[] = $opt;
}
// Is the arg an option (starting with '-')?
if (!empty($opt) && $opt{0} == "-" && strlen($opt) != 1) {
if (!empty($opt) && $opt[0] == "-" && strlen($opt) != 1) {
// Do we have multiple options behind one '-'?
if (strlen($opt) > 2 && $opt{1} != "-") {
if (strlen($opt) > 2 && $opt[1] != "-") {
// Each char becomes a key of its own.
for ($j = 1; $j < strlen($opt); $j++) {
$opt_char = substr($opt, $j, 1);
Expand All @@ -870,7 +870,7 @@ function drush_parse_args() {
}
}
// Do we have a longopt (starting with '--')?
elseif ($opt{1} == "-") {
elseif ($opt[1] == "-") {
if ($pos = strpos($opt, '=')) {
$options[substr($opt, 2, $pos - 2)] = substr($opt, $pos + 1);
}
Expand Down
4 changes: 2 additions & 2 deletions includes/sitealias.inc
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ function drush_sitealias_resolve_sitespecs($site_specifications, $alias_path_con
function drush_sitealias_valid_alias_format($alias) {
return ( (strpos($alias, ',') !== false) ||
((strpos($alias, '@') === FALSE ? 0 : 1) + (strpos($alias, '/') === FALSE ? 0 : 1) + (strpos($alias, '#') === FALSE ? 0 : 1) >= 2) ||
($alias{0} == '#') ||
($alias{0} == '@')
($alias[0] == '#') ||
($alias[0] == '@')
);
}

Expand Down

0 comments on commit 64cf3db

Please sign in to comment.