Skip to content

Commit 14e606f

Browse files
committed
Better handle the legacy URL to warn users
1 parent a44b6a4 commit 14e606f

34 files changed

+109
-78
lines changed

Cli/Application.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the SensioLabsInsight package.
55
*
6-
* (c) SensioLabs <contact@sensiolabs.com>
6+
* (c) SensioLabs <support@symfony.com>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
@@ -51,6 +51,7 @@ public function getApi()
5151
if (\array_key_exists('api_endpoint', $config)) {
5252
$config['base_url'] = $config['api_endpoint'];
5353
}
54+
5455
$this->api = new Api($config);
5556

5657
if ($this->logFile) {

Cli/Command/AnalysisCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the SensioLabsInsight package.
55
*
6-
* (c) SensioLabs <contact@sensiolabs.com>
6+
* (c) SensioLabs <support@symfony.com>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

Cli/Command/AnalyzeCommand.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the SensioLabsInsight package.
55
*
6-
* (c) SensioLabs <contact@sensiolabs.com>
6+
* (c) SensioLabs <support@symfony.com>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
@@ -12,11 +12,13 @@
1212
namespace SensioLabs\Insight\Cli\Command;
1313

1414
use SensioLabs\Insight\Cli\Helper\DescriptorHelper;
15+
use SensioLabs\Insight\Sdk\Api;
1516
use Symfony\Component\Console\Command\Command;
1617
use Symfony\Component\Console\Input\InputArgument;
1718
use Symfony\Component\Console\Input\InputInterface;
1819
use Symfony\Component\Console\Input\InputOption;
1920
use Symfony\Component\Console\Output\OutputInterface;
21+
use Symfony\Component\Console\Style\SymfonyStyle;
2022

2123
class AnalyzeCommand extends Command implements NeedConfigurationInterface
2224
{
@@ -37,7 +39,15 @@ protected function configure()
3739
protected function execute(InputInterface $input, OutputInterface $output)
3840
{
3941
$projectUuid = $input->getArgument('project-uuid');
42+
43+
/** @var Api $api */
4044
$api = $this->getApplication()->getApi();
45+
46+
if (false !== strpos($api->getBaseUrl(), '.sensiolabs.com')) {
47+
$io = new SymfonyStyle($input, $output);
48+
$io->warning('You are using the legacy URL of SymfonyInsight which may stop working in the future. You should reconfigure this tool by running the "configure" command and use "https://insight.symfony.com" as endpoint.');
49+
}
50+
4151
$analysis = $api->analyze($projectUuid, $input->getOption('reference'), $input->getOption('branch'));
4252

4353
$chars = ['-', '\\', '|', '/'];

Cli/Command/ConfigureCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the SensioLabsInsight package.
55
*
6-
* (c) SensioLabs <contact@sensiolabs.com>
6+
* (c) SensioLabs <support@symfony.com>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

Cli/Command/NeedConfigurationInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the SensioLabsInsight package.
55
*
6-
* (c) SensioLabs <contact@sensiolabs.com>
6+
* (c) SensioLabs <support@symfony.com>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

Cli/Command/ProjectsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the SensioLabsInsight package.
55
*
6-
* (c) SensioLabs <contact@sensiolabs.com>
6+
* (c) SensioLabs <support@symfony.com>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

Cli/Command/SelfUpdateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the SensioLabsInsight package.
55
*
6-
* (c) SensioLabs <contact@sensiolabs.com>
6+
* (c) SensioLabs <support@symfony.com>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

Cli/Descriptor/AbstractDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the SensioLabsInsight package.
55
*
6-
* (c) SensioLabs <contact@sensiolabs.com>
6+
* (c) SensioLabs <support@symfony.com>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

Cli/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the SensioLabsInsight package.
55
*
6-
* (c) SensioLabs <contact@sensiolabs.com>
6+
* (c) SensioLabs <support@symfony.com>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

Cli/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the SensioLabsInsight package.
55
*
6-
* (c) SensioLabs <contact@sensiolabs.com>
6+
* (c) SensioLabs <support@symfony.com>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

0 commit comments

Comments
 (0)