From dc70b40d3424d32ec5d761abe4328856982ac425 Mon Sep 17 00:00:00 2001 From: "Konstantin.Myakshin" Date: Tue, 11 Oct 2016 16:52:29 +0300 Subject: [PATCH] Use implode instead of join --- src/Composer/Autoload/AutoloadGenerator.php | 2 +- src/Composer/Command/ShowCommand.php | 2 +- src/Composer/IO/ConsoleIO.php | 6 +++--- .../Fixtures/autoload_real_functions_with_include_paths.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 971702edb..e725330a1 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -582,7 +582,7 @@ HEADER; $file .= <<<'INCLUDE_PATH' $includePaths = require __DIR__ . '/include_paths.php'; array_push($includePaths, get_include_path()); - set_include_path(join(PATH_SEPARATOR, $includePaths)); + set_include_path(implode(PATH_SEPARATOR, $includePaths)); INCLUDE_PATH; diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index a0a010f54..7241b1ef8 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -463,7 +463,7 @@ EOT $io = $this->getIO(); $io->write('name : ' . $package->getPrettyName()); $io->write('descrip. : ' . $package->getDescription()); - $io->write('keywords : ' . join(', ', $package->getKeywords() ?: array())); + $io->write('keywords : ' . implode(', ', $package->getKeywords() ?: array())); $this->printVersions($package, $versions, $installedRepo); if ($latestPackage) { $style = $this->getVersionStyle($latestPackage, $package); diff --git a/src/Composer/IO/ConsoleIO.php b/src/Composer/IO/ConsoleIO.php index b09ed0582..7cd6fd71a 100644 --- a/src/Composer/IO/ConsoleIO.php +++ b/src/Composer/IO/ConsoleIO.php @@ -158,13 +158,13 @@ class ConsoleIO extends BaseIO if (true === $stderr && $this->output instanceof ConsoleOutputInterface) { $this->output->getErrorOutput()->write($messages, $newline, $sfVerbosity); - $this->lastMessageErr = join($newline ? "\n" : '', (array) $messages); + $this->lastMessageErr = implode($newline ? "\n" : '', (array) $messages); return; } $this->output->write($messages, $newline, $sfVerbosity); - $this->lastMessage = join($newline ? "\n" : '', (array) $messages); + $this->lastMessage = implode($newline ? "\n" : '', (array) $messages); } /** @@ -193,7 +193,7 @@ class ConsoleIO extends BaseIO private function doOverwrite($messages, $newline, $size, $stderr, $verbosity) { // messages can be an array, let's convert it to string anyway - $messages = join($newline ? "\n" : '', (array) $messages); + $messages = implode($newline ? "\n" : '', (array) $messages); // since overwrite is supposed to overwrite last message... if (!isset($size)) { diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_real_functions_with_include_paths.php b/tests/Composer/Test/Autoload/Fixtures/autoload_real_functions_with_include_paths.php index e63c75cb5..2d66e4dc0 100644 --- a/tests/Composer/Test/Autoload/Fixtures/autoload_real_functions_with_include_paths.php +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_real_functions_with_include_paths.php @@ -25,7 +25,7 @@ class ComposerAutoloaderInitFilesAutoload $includePaths = require __DIR__ . '/include_paths.php'; array_push($includePaths, get_include_path()); - set_include_path(join(PATH_SEPARATOR, $includePaths)); + set_include_path(implode(PATH_SEPARATOR, $includePaths)); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION'); if ($useStaticLoader) {