Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Sep 22, 2019
1 parent 03d0260 commit 4966bcd
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 86 deletions.
20 changes: 15 additions & 5 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# language: php

build:
dependencies:
before:
- 'composer self-update'
- 'composer update --prefer-stable --prefer-source --no-interaction --no-progress --no-suggest'
cache:
directories:
- vendor/
nodes:
analysis:
project_setup:
override: true
tests:
override: [php-scrutinizer-run]

filter:
paths: [src/*]
excluded_paths: [tests/*, vendor/*]

before_commands:
- 'composer self-update'
- 'composer update --prefer-stable --prefer-source --no-interaction --no-scripts --no-progress --no-suggest'

coding_style:
php:
upper_lower_casing:
Expand All @@ -34,7 +45,6 @@ tools:
enabled: true
config:
ruleset: 'unusedcode,naming,design,controversial,codesize'

php_cpd: true
php_loc: true
php_pdepend: true
Expand Down
20 changes: 11 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ env:
- COMPOSER_FLAGS="--prefer-stable --prefer-dist"

php:
- 7.2
- 7.3
- 7.4snapshot
- nightly

matrix:
Expand All @@ -22,25 +24,25 @@ matrix:
- php: 7.1
env:
- COMPOSER_FLAGS="--prefer-lowest --prefer-stable --prefer-dist"
- php: 7.2
- php: 7.1
env:
- TEST_VERSION=true
- COMPOSER_FLAGS="--prefer-stable --prefer-dist"
allow_failures:
- php: nightly

before_install:
- if [[ -z $TEST_VERSION && -f "/home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini" ]]; then phpenv config-rm xdebug.ini; fi
- composer global require hirak/prestissimo
- composer self-update --stable --no-progress
- if [[ -z $TEST_VERSION && -f "/home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini" ]]; then phpenv config-rm xdebug.ini; fi
- composer global require hirak/prestissimo
- composer self-update --stable --no-progress

install:
- travis_retry composer update $COMPOSER_FLAGS --no-interaction --no-scripts --no-progress
- if [[ $TEST_VERSION ]]; then travis_retry composer require php-coveralls/php-coveralls $COMPOSER_FLAGS --no-interaction --no-scripts --no-progress ; fi
- travis_retry composer update $COMPOSER_FLAGS --no-interaction --no-progress
- if [[ $TEST_VERSION ]]; then travis_retry composer require php-coveralls/php-coveralls $COMPOSER_FLAGS --no-interaction --no-scripts --no-progress ; fi

script:
- if [[ $TEST_VERSION ]]; then composer qa && composer report-phpunit-clover ; fi
- if [[ -z $TEST_VERSION ]]; then composer test-phpunit ; fi
- if [[ $TEST_VERSION ]]; then composer qa && composer report-phpunit-clover ; fi
- if [[ -z $TEST_VERSION ]]; then composer test-phpunit ; fi

after_script:
- if [[ $TEST_VERSION ]]; then travis_retry php vendor/bin/php-coveralls --verbose ; fi
- if [[ $TEST_VERSION ]]; then travis_retry php vendor/bin/php-coveralls --verbose ; fi
17 changes: 8 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"require": {
"php": "^7.1",
"ext-json": "*",
"phpgears/immutability": "~0.1.5",
"phpgears/immutability": "~0.2",
"ramsey/uuid": "^3.7"
},
"require-dev": {
Expand All @@ -33,16 +33,15 @@
"hashids/hashids": "^3.0",
"infection/infection": "^0.9",
"pascaldevink/shortuuid": "^2.1",
"phpmd/phpmd": "^2.0",
"phpstan/phpstan": "^0.11",
"phpstan/phpstan-deprecation-rules": "^0.11",
"phpstan/phpstan-strict-rules": "^0.11",
"phpunit/phpunit": "^6.0|^7.0",
"phpstan/phpstan": "~0.11.12",
"phpstan/phpstan-deprecation-rules": "~0.11.2",
"phpstan/phpstan-strict-rules": "~0.11.1",
"phpunit/phpunit": "^7.0|^8.0",
"povils/phpmnd": "^2.0",
"roave/security-advisories": "dev-master",
"sebastian/phpcpd": "^3.0|^4.0",
"squizlabs/php_codesniffer": "^2.0",
"thecodingmachine/phpstan-strict-rules": "^0.11",
"sebastian/phpcpd": "^4.0",
"squizlabs/php_codesniffer": "^3.0",
"thecodingmachine/phpstan-strict-rules": "^0.11.2",
"tuupola/base62": "^2.0"
},
"suggest": {
Expand Down
5 changes: 0 additions & 5 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon

parameters:
level: max
paths:
Expand Down
4 changes: 2 additions & 2 deletions src/AbstractIdentity.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ abstract class AbstractIdentity implements Identity
*/
final protected function __construct(string $value)
{
$this->checkImmutability();
$this->assertImmutable();

$this->value = $value;
}
Expand Down Expand Up @@ -82,7 +82,7 @@ final public function serialize(): string
*/
final public function unserialize($serialized): void
{
$this->checkImmutability();
$this->assertImmutable();

$this->value = \unserialize($serialized, ['allowed_classes' => false]);
}
Expand Down
31 changes: 15 additions & 16 deletions tests/Identity/Base62UuidIdentityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace Gears\Identity\Tests;

use Gears\Identity\Base62UuidIdentity;
use Gears\Identity\Exception\InvalidIdentityException;
use PHPUnit\Framework\TestCase;

/**
Expand All @@ -30,21 +31,19 @@ public function testFromString(): void
$this->assertSame($base62Uuid, (string) $stub);
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "invalidBase62UUID" is not a valid bas62 UUID
*/
public function testInvalidBase62Uuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage('Provided identity value "invalidBase62UUID" is not a valid bas62 UUID');

Base62UuidIdentity::fromString('invalidBase62UUID');
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "14eEn5G9R1FmCRn08bMkMz" is not a valid bas62 UUID
*/
public function testNonRFC4122Base62Uuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage('Provided identity value "14eEn5G9R1FmCRn08bMkMz" is not a valid bas62 UUID');

Base62UuidIdentity::fromString('14eEn5G9R1FmCRn08bMkMz');
}

Expand All @@ -57,21 +56,21 @@ public function testFromUuid(): void
$this->assertSame($base62Uuid, (string) $stub);
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "invalidUUID" is not a valid UUID
*/
public function testInvalidUuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage('Provided identity value "invalidUUID" is not a valid UUID');

Base62UuidIdentity::fromUuid('invalidUUID');
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "00000000-07bf-961b-abd8-c4716f92fcc0" is not a valid UUID
*/
public function testNonRFC4122Uuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage(
'Provided identity value "00000000-07bf-961b-abd8-c4716f92fcc0" is not a valid UUID'
);

Base62UuidIdentity::fromUuid('00000000-07bf-961b-abd8-c4716f92fcc0');
}
}
33 changes: 17 additions & 16 deletions tests/Identity/HashUuidIdentityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Gears\Identity\Tests;

use Gears\Identity\Exception\InvalidIdentityException;
use Gears\Identity\HashUuidIdentity;
use PHPUnit\Framework\TestCase;

Expand All @@ -30,21 +31,21 @@ public function testFromString(): void
$this->assertSame($hashedUuid, (string) $stub);
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "invalidHashedUUID" is not a valid hashed UUID
*/
public function testInvalidHashUuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage('Provided identity value "invalidHashedUUID" is not a valid hashed UUID');

HashUuidIdentity::fromString('invalidHashedUUID');
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "gGJqXEqR7AFZjBkzP9MLtWYP9AA" is not a valid hashed UUID
*/
public function testNonRFC4122HashUuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage(
'Provided identity value "gGJqXEqR7AFZjBkzP9MLtWYP9AA" is not a valid hashed UUID'
);

HashUuidIdentity::fromString('gGJqXEqR7AFZjBkzP9MLtWYP9AA');
}

Expand All @@ -57,21 +58,21 @@ public function testFromUuid(): void
$this->assertSame($hashedUuid, (string) $stub);
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "invalidUUID" is not a valid UUID
*/
public function testInvalidUuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage('Provided identity value "invalidUUID" is not a valid UUID');

HashUuidIdentity::fromUuid('invalidUUID');
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "00000000-07bf-961b-abd8-c4716f92fcc0" is not a valid UUID
*/
public function testNonRFC4122Uuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage(
'Provided identity value "00000000-07bf-961b-abd8-c4716f92fcc0" is not a valid UUID'
);

HashUuidIdentity::fromUuid('00000000-07bf-961b-abd8-c4716f92fcc0');
}
}
31 changes: 15 additions & 16 deletions tests/Identity/ShortUuidIdentityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Gears\Identity\Tests;

use Gears\Identity\Exception\InvalidIdentityException;
use Gears\Identity\ShortUuidIdentity;
use PHPUnit\Framework\TestCase;

Expand All @@ -30,21 +31,19 @@ public function testFromString(): void
$this->assertSame($shortUuid, (string) $stub);
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "invalidShortUUID" is not a valid short UUID
*/
public function testInvalidShortUuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage('Provided identity value "invalidShortUUID" is not a valid short UUID');

ShortUuidIdentity::fromString('invalidShortUUID');
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "zaDP55gm3yL9cV2D" is not a valid short UUID
*/
public function testNonRFC4122ShortUuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage('Provided identity value "zaDP55gm3yL9cV2D" is not a valid short UUID');

ShortUuidIdentity::fromString('zaDP55gm3yL9cV2D');
}

Expand All @@ -57,21 +56,21 @@ public function testFromUuid(): void
$this->assertSame($shortUuid, (string) $stub);
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "invalidUUID" is not a valid UUID
*/
public function testInvalidUuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage('Provided identity value "invalidUUID" is not a valid UUID');

ShortUuidIdentity::fromUuid('invalidUUID');
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "00000000-07bf-961b-abd8-c4716f92fcc0" is not a valid UUID
*/
public function testNonRFC4122Uuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage(
'Provided identity value "00000000-07bf-961b-abd8-c4716f92fcc0" is not a valid UUID'
);

ShortUuidIdentity::fromUuid('00000000-07bf-961b-abd8-c4716f92fcc0');
}
}
17 changes: 9 additions & 8 deletions tests/Identity/UuidIdentityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Gears\Identity\Tests;

use Gears\Identity\Exception\InvalidIdentityException;
use Gears\Identity\UuidIdentity;
use PHPUnit\Framework\TestCase;

Expand All @@ -30,21 +31,21 @@ public function testFromString(): void
$this->assertSame($uuid, (string) $stub);
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "invalidUUID" is not a valid UUID
*/
public function testInvalidUuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage('Provided identity value "invalidUUID" is not a valid UUID');

UuidIdentity::fromString('invalidUUID');
}

/**
* @expectedException \Gears\Identity\Exception\InvalidIdentityException
* @expectedExceptionMessage Provided identity value "00000000-07bf-961b-abd8-c4716f92fcc0" is not a valid UUID
*/
public function testNonRFC4122Uuid(): void
{
$this->expectException(InvalidIdentityException::class);
$this->expectExceptionMessage(
'Provided identity value "00000000-07bf-961b-abd8-c4716f92fcc0" is not a valid UUID'
);

UuidIdentity::fromString('00000000-07bf-961b-abd8-c4716f92fcc0');
}
}

0 comments on commit 4966bcd

Please sign in to comment.