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

Upgrade dependencies #28

Merged
merged 6 commits into from
May 5, 2020
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
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build:
rabbitmq: false
mongodb: false
php:
version: 7.3
version: 7.4
cache:
disabled: false
directories:
Expand Down
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
os: linux
dist: xenial
sudo: false
language: php

php:
- 7.3
- 7.4snapshot
- 7.4
- nightly

cache:
Expand Down
21 changes: 13 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,24 @@
"sort-packages": true
},
"require": {
"php": "^7.3 || ^8.0",
"php": "^7.4 || ^8.0",
"jms/serializer": "^3.6",
"chimera/foundation": "^0.3"
"chimera/foundation": "^0.4@dev"
},
"require-dev": {
"infection/infection": "^0.16.2",
"lcobucci/coding-standard": "^3.1",
"phpstan/phpstan": "^0.11",
"phpstan/phpstan-deprecation-rules": "^0.11",
"phpstan/phpstan-phpunit": "^0.11",
"phpstan/phpstan-strict-rules": "^0.11",
"doctrine/annotations": "^1.10.2",
"infection/infection": "^0.16",
"lcobucci/coding-standard": "^4.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-deprecation-rules": "^0.12",
"phpstan/phpstan-phpunit": "^0.12",
"phpstan/phpstan-strict-rules": "^0.12",
"phpunit/phpunit": "^9.1"
},
"provide": {
"chimera/serialization-implementation": "0.4.0"
},
"autoload": {
"psr-4": {
"Chimera\\MessageCreator\\JmsSerializer\\": "src"
Expand Down
11 changes: 1 addition & 10 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-deprecation-rules/rules.neon

parameters:
level: 7
level: max
paths:
- src
- tests

ignoreErrors:
- '#Call to deprecated method registerUniqueLoader\(\) of class Doctrine\\Common\\Annotations\\AnnotationRegistry#'
8 changes: 1 addition & 7 deletions src/ArrayTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@

final class ArrayTransformer implements MessageCreator
{
/**
* @var ArrayTransformerInterface
*/
private $transformer;
private ArrayTransformerInterface $transformer;

public function __construct(ArrayTransformerInterface $transformer)
{
$this->transformer = $transformer;
}

/**
* {@inheritdoc}
*/
public function create(string $message, Input $input): object
{
return $this->transformer->fromArray(
Expand Down
5 changes: 1 addition & 4 deletions src/DeserializationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

final class DeserializationContext extends BaseContext
{
/**
* @var Input
*/
private $input;
private Input $input;

public function __construct(Input $input)
{
Expand Down
12 changes: 4 additions & 8 deletions tests/Functional/DoSomething.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,21 @@ final class DoSomething
/**
* @Serializer\Type("string")
* @Serializer\SerializedName(InputDataInjector::GENERATED_ID)
* @var string|null
*/
public $id;
public ?string $id;

/**
* @Serializer\Type("string")
* @var string|null
*/
public $foo;
public ?string $foo;

/**
* @Serializer\Type("string")
* @var string|null
*/
public $bar;
public ?string $bar;

/**
* @Serializer\Type("string")
* @var string|null
*/
public $baz;
public ?string $baz;
}
4 changes: 2 additions & 2 deletions tests/Functional/FakeInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ final class FakeInput implements Input
/**
* @var mixed[]
*/
private $data;
private array $data;

/**
* @var mixed[]
*/
private $attributes = [];
private array $attributes = [];

/**
* @param mixed[] $data
Expand Down
20 changes: 3 additions & 17 deletions tests/Functional/MessageDeserializationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

use Chimera\MessageCreator\JmsSerializer\ArrayTransformer;
use Chimera\MessageCreator\JmsSerializer\InputDataInjector;
use Doctrine\Common\Annotations\AnnotationRegistry;
use JMS\Serializer\ArrayTransformerInterface;
use JMS\Serializer\EventDispatcher\EventDispatcher;
use JMS\Serializer\EventDispatcher\Events;
Expand All @@ -16,18 +15,7 @@

final class MessageDeserializationTest extends TestCase
{
/**
* @var SerializerInterface
*/
private $serializer;

/**
* @beforeClass
*/
public static function registerAutoloader(): void
{
AnnotationRegistry::registerUniqueLoader('class_exists');
}
private SerializerInterface $serializer;

/**
* @before
Expand Down Expand Up @@ -55,7 +43,7 @@ public function inputDataShouldBeUsedOnDeserialization(): void
{
$message = $this->createMessage(['foo' => 'one', 'bar' => 'two', 'baz' => 'three']);

self::assertNull($message->id);
self::assertFalse(isset($message->id));
self::assertSame('one', $message->foo);
self::assertSame('two', $message->bar);
self::assertSame('three', $message->baz);
Expand All @@ -73,9 +61,7 @@ public function generatedIdShouldBeUsedOnDeserialization(): void
$message = $this->createMessage([], '1234');

self::assertSame('1234', $message->id);
self::assertNull($message->foo);
self::assertNull($message->bar);
self::assertNull($message->baz);
self::assertFalse(isset($message->foo, $message->bar, $message->baz));
}

/**
Expand Down
9 changes: 3 additions & 6 deletions tests/Unit/InputDataInjectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@ final class InputDataInjectorTest extends TestCase
private const DATA = ['test' => 1];

/**
* @var Input|MockObject
* @var Input&MockObject
*/
private $input;
private Input $input;

/**
* @var PreDeserializeEvent
*/
private $event;
private PreDeserializeEvent $event;

/**
* @before
Expand Down