Skip to content

Commit

Permalink
SUPPORT-86535 - add symfony 6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuri Gaidoba committed Nov 21, 2023
1 parent f5801a6 commit ba37844
Show file tree
Hide file tree
Showing 54 changed files with 445 additions and 415 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
# { php-version: '8.0', symfony-version: '5.4.*', dependency-versions: 'latest' },
# { php-version: '8.1', symfony-version: '5.4.*', dependency-versions: 'lowest' },
# { php-version: '8.1', symfony-version: '5.4.*', dependency-versions: 'latest' },
{ php-version: '8.1', symfony-version: '6.4.*', dependency-versions: 'lowest' },
{ php-version: '8.1', symfony-version: '6.4.*', dependency-versions: 'latest' },
]
steps:
- name: Checkout
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ composer.lock
bin/
var/
!bin/update-constraints-to-lowest.php

.phpunit.result.cache
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.7.0]
### Added
- Support for Symfony 6.4

### Changed
- Fixed code style
- Fixed tests

## [1.6.0]
### Added
- Allow library to work with various version of `paysera/lib-object-wrapper` from `0.1.0`
Expand Down
18 changes: 11 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "paysera/lib-api-bundle",
"version": "1.7.0",
"description": "Symfony bundle that allows easy configuration for your REST endpoints.",
"keywords": ["REST", "RESTful", "API"],
"type": "symfony-bundle",
Expand All @@ -17,9 +18,9 @@
"require": {
"php": "^7.1 || ^8.0",
"ext-json": "*",
"symfony/framework-bundle": "^3.4.34|^4.3|^5.4",
"symfony/security-bundle": "^3.4.34|^4.3|^5.4",
"symfony/validator": "^3.4.34|^4.3|^5.4",
"symfony/framework-bundle": "^3.4.34|^4.3|^5.4|^6.4",
"symfony/security-bundle": "^3.4.34|^4.3|^5.4|^6.4",
"symfony/validator": "^3.4.34|^4.3|^5.4|^6.4",
"paysera/lib-normalization-bundle": "^1.1.0",
"paysera/lib-normalization": "^1.2",
"paysera/lib-object-wrapper": "~0.1",
Expand All @@ -31,13 +32,16 @@
"require-dev": {
"phpunit/phpunit": "^6.5 || ^9.0",
"mockery/mockery": "^1.2.4",
"symfony/yaml": "^3.4.34|^4.3|^5.4",
"doctrine/doctrine-bundle": "^1.7.2|^2.0",
"symfony/yaml": "^3.4.34|^4.3|^5.4|^6.4",
"doctrine/doctrine-bundle": "^1.12.0|^2.1",
"doctrine/orm": "~2.5.14|^2.6.3",
"doctrine/annotations": "^v1.7"
"doctrine/annotations": "^v1.14"
},
"config": {
"bin-dir": "bin"
"bin-dir": "bin",
"allow-plugins": {
"ocramius/package-versions": false
}
},
"scripts": {
"phpunit": "phpunit",
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
bootstrap = "vendor/autoload.php" >
bootstrap = "tests/bootstrap.php" >

<testsuites>
<testsuite name="Project Test Suite">
Expand Down
22 changes: 3 additions & 19 deletions src/Annotation/Body.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,41 +41,25 @@ public function __construct(array $options)
$this->setOptional($options['optional'] ?? null);
}

/**
* @param string|null $denormalizationType
* @return $this
*/
private function setDenormalizationType($denormalizationType): self
private function setDenormalizationType(?string $denormalizationType): self
{
$this->denormalizationType = $denormalizationType;
return $this;
}

/**
* @param string|null $denormalizationGroup
* @return $this
*/
public function setDenormalizationGroup($denormalizationGroup): self
public function setDenormalizationGroup(?string $denormalizationGroup): self
{
$this->denormalizationGroup = $denormalizationGroup;
return $this;
}

/**
* @param string $parameterName
* @return $this
*/
private function setParameterName(string $parameterName): self
{
$this->parameterName = $parameterName;
return $this;
}

/**
* @param bool|null $optional
* @return $this
*/
private function setOptional($optional): self
private function setOptional(?bool $optional): self
{
$this->optional = $optional;
return $this;
Expand Down
8 changes: 0 additions & 8 deletions src/Annotation/BodyContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,12 @@ public function __construct(array $options)
$this->setJsonEncodedBody($options['jsonEncodedBody'] ?? false);
}

/**
* @param array $supportedContentTypes
* @return $this
*/
private function setSupportedContentTypes(array $supportedContentTypes): self
{
$this->supportedContentTypes = $supportedContentTypes;
return $this;
}

/**
* @param bool $jsonEncodedBody
* @return $this
*/
private function setJsonEncodedBody(bool $jsonEncodedBody): self
{
$this->jsonEncodedBody = $jsonEncodedBody;
Expand Down
20 changes: 2 additions & 18 deletions src/Annotation/PathAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,41 +42,25 @@ public function __construct(array $options)
$this->setResolutionMandatory($options['resolutionMandatory'] ?? null);
}

/**
* @param string $parameterName
* @return $this
*/
private function setParameterName(string $parameterName): self
{
$this->parameterName = $parameterName;
return $this;
}

/**
* @param string $pathPartName
* @return $this
*/
private function setPathPartName(string $pathPartName): self
{
$this->pathPartName = $pathPartName;
return $this;
}

/**
* @param string|null $resolverType
* @return $this
*/
private function setResolverType($resolverType): self
private function setResolverType(?string $resolverType): self
{
$this->resolverType = $resolverType;
return $this;
}

/**
* @param bool|null $resolutionMandatory
* @return $this
*/
private function setResolutionMandatory($resolutionMandatory): self
private function setResolutionMandatory(?bool $resolutionMandatory): self
{
$this->resolutionMandatory = $resolutionMandatory;
return $this;
Expand Down
22 changes: 3 additions & 19 deletions src/Annotation/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,41 +42,25 @@ public function __construct(array $options)
$this->setValidation($options['validation'] ?? null);
}

/**
* @param string $parameterName
* @return $this
*/
private function setParameterName(string $parameterName): self
{
$this->parameterName = $parameterName;
return $this;
}

/**
* @param string|null $denormalizationType
* @return $this
*/
private function setDenormalizationType($denormalizationType): self
private function setDenormalizationType(?string $denormalizationType): self
{
$this->denormalizationType = $denormalizationType;
return $this;
}

/**
* @param string|null $denormalizationGroup
* @return $this
*/
public function setDenormalizationGroup($denormalizationGroup): self
public function setDenormalizationGroup(?string $denormalizationGroup): self
{
$this->denormalizationGroup = $denormalizationGroup;
return $this;
}

/**
* @param Validation|null $validation
* @return $this
*/
private function setValidation($validation): self
private function setValidation(?Validation $validation): self
{
$this->validation = $validation;
return $this;
Expand Down
4 changes: 0 additions & 4 deletions src/Annotation/RequiredPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ public function __construct(array $options)
$this->setPermissions($options['permissions']);
}

/**
* @param array $permissions
* @return $this
*/
private function setPermissions(array $permissions): self
{
$this->permissions = $permissions;
Expand Down
12 changes: 2 additions & 10 deletions src/Annotation/ResponseNormalization.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,13 @@ public function __construct(array $options)
$this->setNormalizationGroup($options['normalizationGroup'] ?? null);
}

/**
* @param string|null $normalizationType
* @return $this
*/
private function setNormalizationType($normalizationType): self
private function setNormalizationType(?string $normalizationType): self
{
$this->normalizationType = $normalizationType;
return $this;
}

/**
* @param string|null $normalizationGroup
* @return $this
*/
public function setNormalizationGroup($normalizationGroup): self
public function setNormalizationGroup(?string $normalizationGroup): self
{
$this->normalizationGroup = $normalizationGroup;
return $this;
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('paysera_api');
$rootNode = method_exists($treeBuilder, 'getRootNode')
Expand Down
Loading

0 comments on commit ba37844

Please sign in to comment.