Skip to content

Commit

Permalink
Add Symfony 7 and remove Symfony 4
Browse files Browse the repository at this point in the history
  • Loading branch information
tareqas committed Jun 24, 2024
1 parent 872986e commit 6e86141
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 53 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
tools: php-cs-fixer:2.13.1
tools: php-cs-fixer:3.2.1
coverage: none
- name: php-cs-fixer
run: php-cs-fixer fix --dry-run --diff
Expand All @@ -22,23 +22,27 @@ jobs:
strategy:
fail-fast: false
matrix:
sf-version: [ '^4.4', '^5.4', '^6.3' ]
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
sf-version: [ '^5.4', '^6.4', '^7.0' ]
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
exclude:
- sf-version: '^4.4'
- sf-version: '^6.4'
php-version: '7.2'
- sf-version: '^6.4'
php-version: '7.3'
- sf-version: '^6.4'
php-version: '7.4'
- sf-version: '^6.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'
- sf-version: '^7.0'
php-version: '7.2'
- sf-version: '^6.3'
- sf-version: '^7.0'
php-version: '7.3'
- sf-version: '^6.3'
- sf-version: '^7.0'
php-version: '7.4'
- sf-version: '^6.3'
- sf-version: '^7.0'
php-version: '8.0'
- sf-version: '^7.0'
php-version: '8.1'

steps:
- uses: actions/checkout@master
Expand Down
13 changes: 8 additions & 5 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<?php

return PhpCsFixer\Config::create()
$finder = PhpCsFixer\Finder::create()
->in([__DIR__.'/Cli', __DIR__.'/Sdk']);

$config = new PhpCsFixer\Config();
$config
->setRules(array(
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
))
->setRiskyAllowed(true)
->setFinder(
PhpCsFixer\Finder::create()
->in([__DIR__.'/Cli', __DIR__.'/Sdk'])
)
->setFinder($finder)
;

return $config;
4 changes: 2 additions & 2 deletions Cli/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

class Application extends SymfonyApplication
{
const APPLICATION_NAME = 'SymfonyInsight CLI';
const APPLICATION_VERSION = '1.7.4';
public const APPLICATION_NAME = 'SymfonyInsight CLI';
public const APPLICATION_VERSION = '1.7.4';

private $api;
private $apiConfig;
Expand Down
10 changes: 5 additions & 5 deletions Cli/Descriptor/PmdDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

class PmdDescriptor extends AbstractDescriptor
{
const PHPMD_PRIORITY_HIGH = 1;
const PHPMD_PRIORITY_MEDIUM_HIGH = 2;
const PHPMD_PRIORITY_MEDIUM = 3;
const PHPMD_PRIORITY_MEDIUM_LOW = 4;
const PHPMD_PRIORITY_LOW = 5;
public const PHPMD_PRIORITY_HIGH = 1;
public const PHPMD_PRIORITY_MEDIUM_HIGH = 2;
public const PHPMD_PRIORITY_MEDIUM = 3;
public const PHPMD_PRIORITY_MEDIUM_LOW = 4;
public const PHPMD_PRIORITY_LOW = 5;

protected function describeAnalysis(Analysis $analysis, array $options = [])
{
Expand Down
4 changes: 4 additions & 0 deletions Sdk/Model/Analyses.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ class Analyses
* @Type("array<SensioLabs\Insight\Sdk\Model\Link>")
* @XmlList(inline = true, entry = "link")
*/
#[Type("array<SensioLabs\Insight\Sdk\Model\Link>")]
#[XmlList(inline: true, entry: "link")]
private $links = [];

/**
* @Type("array<SensioLabs\Insight\Sdk\Model\Analysis>")
* @XmlList(inline = true, entry = "analysis")
*/
#[Type("array<SensioLabs\Insight\Sdk\Model\Analysis>")]
#[XmlList(inline: true, entry: "analysis")]
private $analyses = [];

/**
Expand Down
51 changes: 38 additions & 13 deletions Sdk/Model/Analysis.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,109 +17,134 @@

class Analysis
{
const STATUS_ORDERED = 'ordered';
const STATUS_RUNNING = 'running';
const STATUS_MEASURED = 'measured';
const STATUS_ANALYZED = 'analyzed';
const STATUS_FINISHED = 'finished';
public const STATUS_ORDERED = 'ordered';
public const STATUS_RUNNING = 'running';
public const STATUS_MEASURED = 'measured';
public const STATUS_ANALYZED = 'analyzed';
public const STATUS_FINISHED = 'finished';

/**
* @Type("array<SensioLabs\Insight\Sdk\Model\Link>")
* @XmlList(inline = true, entry = "link")
*/
#[Type("array<SensioLabs\Insight\Sdk\Model\Link>")]
#[XmlList(inline: true, entry: "link")]
private $links = [];

/** @Type("integer") */
#[Type("integer")]
private $number;

/** @Type("string") */
#[Type("string")]
private $grade;

/**
* @Type("string")
* @SerializedName("next-grade")
*/
#[Type("string")]
#[SerializedName("next-grade")]
private $nextGrade;

/** @Type("array<string>") */
#[Type("array<string>")]
private $grades = [];

/**
* @Type("float")
* @SerializedName("remediation-cost")
*/
#[Type("float")]
#[SerializedName("remediation-cost")]
private $remediationCost;

/**
* @Type("float")
* @SerializedName("remediation-cost-for-next-grade")
*/
#[Type("float")]
#[SerializedName("remediation-cost-for-next-grade")]
private $remediationCostForNextGrade;

/**
* @Type("integer")
* @SerializedName("nb-violations")
*/
#[Type("integer")]
#[SerializedName("nb-violations")]
private $nbViolations;

/**
* @Type("DateTime")
* @SerializedName("begin-at")
*/
#[Type("DateTime")]
#[SerializedName("begin-at")]
private $beginAt;

/**
* @Type("DateTime")
* @SerializedName("end-at")
*/
#[Type("DateTime")]
#[SerializedName("end-at")]
private $endAt;

/** @Type("integer") */
#[Type("integer")]
private $duration;

/**
* @Type("string")
* @SerializedName("failure-message")
*/
#[Type("string")]
#[SerializedName("failure-message")]
private $failureMessage;

/**
* @Type("string")
* @SerializedName("failure-code")
*/
#[Type("string")]
#[SerializedName("failure-code")]
private $failureCode;

/** @Type("boolean") */
#[Type("boolean")]
private $failed;

/** @Type("string") */
#[Type("string")]
private $status;

/**
* @Type("string")
* @SerializedName("status-message")
*/
#[Type("string")]
#[SerializedName("status-message")]
private $statusMessage;

/**
* @Type("boolean")
* @SerializedName("altered")
*/
#[Type("boolean")]
#[SerializedName("altered")]
private $isAltered;

/** @Type("SensioLabs\Insight\Sdk\Model\Violations") */
#[Type("SensioLabs\Insight\Sdk\Model\Violations")]
private $violations;

/**
* @Type("string")
* @SerializedName("branch")
*/
/** @Type("string") */
#[Type("string")]
private $branch;

/**
* @Type("string")
* @SerializedName("reference")
*/
/** @Type("string") */
#[Type("string")]
private $reference;

/**
Expand Down
6 changes: 6 additions & 0 deletions Sdk/Model/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,24 @@ class Link
* @XmlAttribute
* @Type("string")
*/
#[XmlAttribute]
#[Type("string")]
private $href;

/**
* @XmlAttribute
* @Type("string")
*/
#[XmlAttribute]
#[Type("string")]
private $rel;

/**
* @XmlAttribute
* @Type("string")
*/
#[XmlAttribute]
#[Type("string")]
private $type;

/**
Expand Down
36 changes: 26 additions & 10 deletions Sdk/Model/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@ class Project
/**
* @see https://github.com/sensiolabs/connect/blob/master/src/SensioLabs/Connect/Api/Entity/Project.php
*/
const TYPE_PHP_WEBSITE = 0;
const TYPE_PHP_LIBRARY = 1;
const TYPE_SYMFONY2_BUNDLE = 2;
const TYPE_SYMFONY1_PLUGIN = 4;
const TYPE_OTHER = 6;
const TYPE_DRUPAL_MODULE = 7;
const TYPE_LARAVAL_WEB_PROJECT = 8;
const TYPE_SILEX_WEB_PROJECT = 9;
const TYPE_SYMFONY2_WEB_PROJECT = 10;
const TYPE_SYMFONY1_WEB_PROJECT = 11;
public const TYPE_PHP_WEBSITE = 0;
public const TYPE_PHP_LIBRARY = 1;
public const TYPE_SYMFONY2_BUNDLE = 2;
public const TYPE_SYMFONY1_PLUGIN = 4;
public const TYPE_OTHER = 6;
public const TYPE_DRUPAL_MODULE = 7;
public const TYPE_LARAVAL_WEB_PROJECT = 8;
public const TYPE_SILEX_WEB_PROJECT = 9;
public const TYPE_SYMFONY2_WEB_PROJECT = 10;
public const TYPE_SYMFONY1_WEB_PROJECT = 11;

/**
* @Exclude()
*/
#[Exclude]
public static $types = [
self::TYPE_SYMFONY2_WEB_PROJECT => 'Symfony2 Web Project',
self::TYPE_SYMFONY1_WEB_PROJECT => 'symfony1 Web Project',
Expand All @@ -52,45 +53,60 @@ class Project
* @Type("array<SensioLabs\Insight\Sdk\Model\Link>")
* @XmlList(inline = true, entry = "link")
*/
#[Type("array<SensioLabs\Insight\Sdk\Model\Link>")]
#[XmlList(inline: true, entry: "link")]
private $links = [];

/**
* @Type("string")
* @SerializedName("id")
*/
#[Type("string")]
#[SerializedName("id")]
private $uuid;

/** @Type("string") */
#[Type("string")]
private $name;

/** @Type("string") */
#[Type("string")]
private $configuration;

/** @Type("string") */
#[Type("string")]
private $description;

/** @Type("integer") */
#[Type("integer")]
private $type;

/**
* @Type("string")
* @SerializedName("repository-url")
*/
#[Type("string")]
#[SerializedName("repository-url")]
private $repositoryUrl;

/** @Type("boolean") */
#[Type("boolean")]
private $private;

/**
* @Type("boolean")
* @SerializedName("report-available")
*/
#[Type("boolean")]
#[SerializedName("report-available")]
private $reportAvailable;

/**
* @Type("SensioLabs\Insight\Sdk\Model\Analysis")
* @SerializedName("last-analysis")
*/
#[Type("SensioLabs\Insight\Sdk\Model\Analysis")]
#[SerializedName("last-analysis")]
private $lastAnalysis;

public function toArray()
Expand Down
Loading

0 comments on commit 6e86141

Please sign in to comment.