Skip to content

Commit

Permalink
Various improvements and renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
tgalopin committed Sep 30, 2021
1 parent 8820931 commit 44edbef
Show file tree
Hide file tree
Showing 22 changed files with 46 additions and 95 deletions.
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions Cli/Application.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* This file is part of the SensioLabsInsight package.
* This file is part of the SymfonyInsight package.
*
* (c) SensioLabs <[email protected]>
* (c) Symfony <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -25,7 +25,7 @@

class Application extends SymfonyApplication
{
const APPLICATION_NAME = 'SensioLabs Insight CLI';
const APPLICATION_NAME = 'SymfonyInsight CLI';
const APPLICATION_VERSION = '1.7.1';

private $api;
Expand Down Expand Up @@ -69,7 +69,7 @@ public function getApi()

public function getLongVersion()
{
$version = parent::getLongVersion().' by <comment>SensioLabs</comment>';
$version = parent::getLongVersion().' by <comment>Symfony</comment>';
$commit = '@git-commit@';

if ('@'.'git-commit@' !== $commit) {
Expand Down
6 changes: 3 additions & 3 deletions Cli/Command/AnalysisCommand.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* This file is part of the SensioLabsInsight package.
* This file is part of the SymfonyInsight package.
*
* (c) SensioLabs <[email protected]>
* (c) Symfony <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down Expand Up @@ -52,7 +52,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

if (!$expr = $input->getOption('fail-condition')) {
return;
return 1;
}

return $this->getHelperSet()->get('fail_condition')->evaluate($analysis, $expr);
Expand Down
12 changes: 6 additions & 6 deletions Cli/Command/AnalyzeCommand.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* This file is part of the SensioLabsInsight package.
* This file is part of the SymfonyInsight package.
*
* (c) SensioLabs <[email protected]>
* (c) Symfony <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down Expand Up @@ -60,12 +60,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($input->getOption('no-wait')) {
$output->writeln('The analysis is launched. Please check the result in you SymfonyInsight notifications.');

return;
return 1;
}

while (true) {
// we don't check the status too often (every second)
if (0 === $position % 5) {
// we don't check the status too often (every 10 seconds)
if (0 === $position % 50) {
$analysis = $api->getAnalysisStatus($projectUuid, $analysis->getNumber());
}

Expand Down Expand Up @@ -104,7 +104,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

if (!$expr = $input->getOption('fail-condition')) {
return;
return 1;
}

return $this->getHelperSet()->get('fail_condition')->evaluate($analysis, $expr);
Expand Down
4 changes: 2 additions & 2 deletions Cli/Command/ConfigureCommand.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* This file is part of the SensioLabsInsight package.
* This file is part of the SymfonyInsight package.
*
* (c) SensioLabs <[email protected]>
* (c) Symfony <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions Cli/Command/NeedConfigurationInterface.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* This file is part of the SensioLabsInsight package.
* This file is part of the SymfonyInsight package.
*
* (c) SensioLabs <[email protected]>
* (c) Symfony <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions Cli/Command/ProjectsCommand.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* This file is part of the SensioLabsInsight package.
* This file is part of the SymfonyInsight package.
*
* (c) SensioLabs <[email protected]>
* (c) Symfony <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions Cli/Command/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* This file is part of the SensioLabsInsight package.
* This file is part of the SymfonyInsight package.
*
* (c) SensioLabs <[email protected]>
* (c) Symfony <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions Cli/Descriptor/AbstractDescriptor.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* This file is part of the SensioLabsInsight package.
* This file is part of the SymfonyInsight package.
*
* (c) SensioLabs <[email protected]>
* (c) Symfony <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions Cli/Descriptor/JsonDescriptor.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* This file is part of the SensioLabsInsight package.
* This file is part of the SymfonyInsight package.
*
* (c) SensioLabs <[email protected]>
* (c) Symfony <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions Cli/Descriptor/TextDescriptor.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* This file is part of the SensioLabsInsight package.
* This file is part of the SymfonyInsight package.
*
* (c) SensioLabs <[email protected]>
* (c) Symfony <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions Cli/Descriptor/XmlDescriptor.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* This file is part of the SensioLabsInsight package.
* This file is part of the SymfonyInsight package.
*
* (c) SensioLabs <[email protected]>
* (c) Symfony <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions Cli/Helper/DescriptorHelper.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* This file is part of the SensioLabsInsight package.
* This file is part of the SymfonyInsight package.
*
* (c) SensioLabs <[email protected]>
* (c) Symfony <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions Cli/Helper/FailConditionHelper.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* This file is part of the SensioLabsInsight package.
* This file is part of the SymfonyInsight package.
*
* (c) SensioLabs <[email protected]>
* (c) Symfony <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013 SensioLabs
Copyright (c) 2013 Symfony

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ The easiest way to use the SymfonyInsight API is via the built-in command line t
A phar version of the command line tool exists to avoid installation of this
project. Download it, then use it like the command line tool:

$ curl -o insight.phar -s http://get.insight.symfony.com/insight.phar
$ curl -o insight.phar -s https://get.insight.symfony.com/insight.phar
# or
$ wget http://get.insight.symfony.com/insight.phar
$ wget https://get.insight.symfony.com/insight.phar

# Then
$ php insight.phar
Expand Down
6 changes: 3 additions & 3 deletions Sdk/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ private function send($method, $url, $body = null): string
$option['body'] = $body;
}

$this->logger and $this->logger->debug(sprintf('%s "%s"', $method, $url));
$this->logger && $this->logger->debug(sprintf('%s "%s"', $method, $url));
$response = $this->httpClient->request($method, $url, $option);

// block until headers arrive
$response->getStatusCode();
$this->logger and $this->logger->debug(sprintf("Request:\n%s", (string) $response->getInfo('debug')));
$this->logger && $this->logger->debug(sprintf("Request:\n%s", (string) $response->getInfo('debug')));

return $response->getContent();
} catch (ClientExceptionInterface $e) {
Expand Down Expand Up @@ -289,6 +289,6 @@ private function logException(ExceptionInterface $e)
$e->getResponse()->getInfo('debug')
);

$this->logger and $this->logger->error($message, ['exception' => $e]);
$this->logger && $this->logger->error($message, ['exception' => $e]);
}
}
2 changes: 1 addition & 1 deletion Sdk/Model/Analysis.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function getEndAt()
*/
public function getDuration()
{
return new \DateInterval('PT'.($this->duration ? $this->duration : '0').'S');
return new \DateInterval('PT'.($this->duration ?: '0').'S');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Sdk/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function parseError($content)

$document = new \DOMDocument();
$document->validateOnParse = true;
if (!$document->loadXML($content, LIBXML_NONET | (\defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) {
if (!$document->loadXML($content, \LIBXML_NONET | (\defined('LIBXML_COMPACT') ? \LIBXML_COMPACT : 0))) {
libxml_disable_entity_loader($disableEntities);

libxml_clear_errors();
Expand Down
4 changes: 2 additions & 2 deletions Sdk/Tests/ApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ApiTest extends TestCase
private $api;
private $logger;

public function setUp()
protected function setUp()
{
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
}
Expand Down Expand Up @@ -218,7 +218,7 @@ public function testAnalyze()
$this->assertInstanceOf('SensioLabs\Insight\Sdk\Model\Analysis', $analysis);
}

public function tearDown()
protected function tearDown()
{
$this->logger = null;
$this->api = null;
Expand Down
4 changes: 2 additions & 2 deletions Sdk/Tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ParserTest extends TestCase
*/
private $parser;

public function setUp()
protected function setUp()
{
$this->parser = new Parser();
}
Expand Down Expand Up @@ -65,7 +65,7 @@ public function testParseErrors()
$this->assertSame($expectedFields, $error->getEntityBodyParameters());
}

public function tearDown()
protected function tearDown()
{
$this->parser = null;
}
Expand Down
8 changes: 1 addition & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{
"name": "sensiolabs/insight",
"description": "SensioLabs Insight SDK",
"description": "SymfonyInsight SDK",
"license": "MIT",
"authors": [
{
"name": "Grégoire Pineau",
"email": "[email protected]"
}
],
"require": {
"php": ">=7.1",
"ext-json": "*",
Expand Down

0 comments on commit 44edbef

Please sign in to comment.