Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #105

Merged
merged 2 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,25 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version: ["7.2", "7.3", "7.4", "8.0", "8.1"]
sf-version: [ '^4.4', '^5.4', '^6.3' ]
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
exclude:
- sf-version: '^4.4'
php-version: '8.0'
- sf-version: '^4.4'
php-version: '8.1'
- sf-version: '^4.4'
php-version: '8.2'
- sf-version: '^6.3'
php-version: '7.2'
- sf-version: '^6.3'
php-version: '7.3'
- sf-version: '^6.3'
php-version: '7.4'
- sf-version: '^6.3'
php-version: '8.0'

steps:
- uses: actions/checkout@master
Expand All @@ -45,8 +62,14 @@ jobs:

- name: Install dependencies
run: |
composer install --prefer-dist --no-interaction --no-ansi --no-progress
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require symfony/flex:^1.0
export SYMFONY_REQUIRE="${{ matrix.sf-version }}"
composer update --prefer-dist --no-interaction --no-ansi --no-progress

- name: Run the tests suite
run: |
php vendor/bin/simple-phpunit -v --log-junit ./phpunit/junit.xml

- name: Run cmd
run: bin/insight list
12 changes: 7 additions & 5 deletions Cli/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
use SensioLabs\Insight\Sdk\Api;
use Symfony\Component\Console\Application as SymfonyApplication;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -67,7 +69,7 @@ public function getApi()
return $this->api;
}

public function getLongVersion()
public function getLongVersion(): string
{
$version = parent::getLongVersion().' by <comment>Symfony</comment>';
$commit = '@git-commit@';
Expand All @@ -79,7 +81,7 @@ public function getLongVersion()
return $version;
}

protected function getDefaultHelperSet()
protected function getDefaultHelperSet(): HelperSet
{
$helperSet = parent::getDefaultHelperSet();

Expand All @@ -89,7 +91,7 @@ protected function getDefaultHelperSet()
return $helperSet;
}

protected function getDefaultInputDefinition()
protected function getDefaultInputDefinition(): InputDefinition
{
$definition = parent::getDefaultInputDefinition();

Expand All @@ -101,7 +103,7 @@ protected function getDefaultInputDefinition()
return $definition;
}

protected function getDefaultCommands()
protected function getDefaultCommands(): array
{
$defaultCommands = parent::getDefaultCommands();

Expand All @@ -114,7 +116,7 @@ protected function getDefaultCommands()
return $defaultCommands;
}

protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output): int
{
if (!$command instanceof LocalCommand\NeedConfigurationInterface) {
return parent::doRunCommand($command, $input, $output);
Expand Down
4 changes: 2 additions & 2 deletions Cli/Command/AnalysisCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class AnalysisCommand extends Command implements NeedConfigurationInterface
{
protected function configure()
protected function configure(): void
{
$this
->setName('analysis')
Expand All @@ -32,7 +32,7 @@ protected function configure()
;
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$api = $this->getApplication()->getApi();
$analysis = $api->getProject($input->getArgument('project-uuid'))->getLastAnalysis();
Expand Down
4 changes: 2 additions & 2 deletions Cli/Command/AnalyzeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

class AnalyzeCommand extends Command implements NeedConfigurationInterface
{
protected function configure()
protected function configure(): void
{
$this
->setName('analyze')
Expand All @@ -38,7 +38,7 @@ protected function configure()
;
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$projectUuid = $input->getArgument('project-uuid');

Expand Down
6 changes: 4 additions & 2 deletions Cli/Command/ConfigureCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@

class ConfigureCommand extends Command
{
protected function configure()
protected function configure(): void
{
$this
->setName('configure')
->setDescription('(Re-)Configure your credentials.')
;
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->getHelperSet()->get('configuration')->updateConfigurationManually($input, $output);

return 0;
}
}
6 changes: 4 additions & 2 deletions Cli/Command/ProjectsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

class ProjectsCommand extends Command implements NeedConfigurationInterface
{
protected function configure()
protected function configure(): void
{
$this
->setName('projects')
->setDescription('List all your projects')
;
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$api = $this->getApplication()->getApi();

Expand Down Expand Up @@ -58,5 +58,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
->setRows($rows)
->render()
;

return 0;
}
}
10 changes: 7 additions & 3 deletions Cli/Command/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SelfUpdateCommand extends Command
/**
* {@inheritdoc}
*/
protected function configure()
protected function configure(): void
{
$this
->setName('self-update')
Expand All @@ -44,7 +44,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$remoteFilename = 'http://get.insight.sensiolabs.com/insight.phar';
$localFilename = $_SERVER['argv'][0];
Expand All @@ -57,7 +57,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln('<info>insight is already up to date.</info>');
unlink($tempFilename);

return;
return 0;
}

chmod($tempFilename, 0777 & ~umask());
Expand All @@ -69,13 +69,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
rename($tempFilename, $localFilename);

$output->writeln('<info>insight updated.</info>');

return 0;
} catch (\Exception $e) {
if (!$e instanceof \UnexpectedValueException && !$e instanceof \PharException) {
throw $e;
}
unlink($tempFilename);
$output->writeln('<error>The download is corrupt ('.$e->getMessage().').</error>');
$output->writeln('<error>Please re-run the self-update command to try again.</error>');

return 1;
}
}
}
2 changes: 1 addition & 1 deletion Cli/Helper/ConfigurationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getConfiguration(InputInterface $input, OutputInterface $output)
return $configuration;
}

public function getName()
public function getName(): string
{
return 'configuration';
}
Expand Down
2 changes: 1 addition & 1 deletion Cli/Helper/DescriptorHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function register($format, AbstractDescriptor $descriptor)
/**
* {@inheritdoc}
*/
public function getName()
public function getName(): string
{
return 'descriptor';
}
Expand Down
2 changes: 1 addition & 1 deletion Cli/Helper/FailConditionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function evaluate(Analysis $analysis, $expr)
return 0;
}

public function getName()
public function getName(): string
{
return 'fail_condition';
}
Expand Down
17 changes: 6 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"ext-json": "*",
"jms/serializer": "^3.17",
"psr/log": "^1.0",
"symfony/http-client": "^4.4",
"symfony/console": "^4.4",
"symfony/expression-language": "^4.4"
"symfony/http-client": "^4.4|^5.4|^6.3",
"symfony/console": "^4.4|^5.4|^6.3",
"symfony/expression-language": "^4.4|^5.4|^6.3"
},
"require-dev": {
"monolog/monolog": "^1.4",
"symfony/phpunit-bridge": "^4.4|^5.3",
"symfony/var-dumper": "^4.4|^5.3"
"symfony/phpunit-bridge": "^4.4|^5.4|^6.3",
"symfony/var-dumper": "^4.4|^5.4|^6.3"
},
"suggest": {
"monolog/monolog": "Will add some log capability to this library"
Expand All @@ -25,14 +25,9 @@
}
},
"bin": ["bin/insight"],
"config": {
"platform": {
"php": "7.2.5"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.5.x-dev"
"dev-master": "1.10.x-dev"
}
}
}
Loading