Skip to content

Commit 82593f7

Browse files
Merge pull request #3 from verbanent/update/external-tools
Added external tools, changed address, license info
2 parents 27c1460 + 58b08e8 commit 82593f7

9 files changed

+69
-43
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ coverage
77
sonar-project.properties
88
vendor
99
composer.lock
10+
.scannerwork/
11+
phpunit.*.xml

.scrutinizer.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build:
2+
environment:
3+
php:
4+
version: '7.4'

.styleci.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
risky: false
2+
version: 7
3+
preset: psr12
4+
finder:
5+
exclude:
6+
- "vendor"
7+
name: "*.php"

.travis.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
language: php
2+
sudo: false
3+
4+
php:
5+
- 7.4
6+
7+
cache:
8+
directories:
9+
- $HOME/.composer/cache
10+
11+
addons:
12+
sonarcloud:
13+
organization: "verbanent-public"
14+
token:
15+
secure: "flumy3jpJ+Je/oYe+CglzMCEMJurdOvPOxAkBm6q60vPxgpMTsF9bHuGxxBEuBGleCwqJGArbmctmslPzwpcAkyB39Yy3YuOowwqeT3wmi8Phl7/2vPLKnAlY6Npc6OLi43b8zaufuhUl5hfS2feVxlSaZtbXEvCuajmsZNpDId/nIEPkzH7Wv1tYHAStWUOav8wumB+ej/IRzQFsjvJoKFnGlJm9tsBf+5vq9RXTgcwV88DHOGdgWTyUVU8SUmH99VQ7m4kfiuyQohrjnj5E+CKsOnDY0DGrgchzJnqK2h5xaexgdPGCPLdWu23MS+iamJMA6knVmFcUjzzhFwcVo33EY1ZMHWk4I0sI8xHrENOmfJ83+7AC2fDwJseLqUD18h4HMd5lnFyVdXbJrFOzVmdrAWTUenDXJx6ZMlIfBOFoBOt3k+DfI7UgtW6+KLL+b0d7LjQNdpkwmieYGKbsGm0QsKeytPUpPg8OrpieJZ4LADu69cuHcpB5ZifijKx8mM3CONxi2YYJ/Rro9t9W5Shk1N9ww60uRHlHpyeDFZEtFTXHTFnVhcmPfuaWdoJjPLo8iNNI2FD4YSUOYXHNfr1r165znwF+3KbVFaaxciZfWyordZUSgknFMomRFOM3H5bVnncsgsnZ+HYBon/NUgbK2Z9fWN++jfgLAQekrk="
16+
17+
git:
18+
depth: false
19+
20+
install: composer update --no-interaction --no-suggest --no-progress
21+
22+
script:
23+
- phpdbg -qrr vendor/bin/phpunit --coverage-clover phpunit.coverage.xml --log-junit phpunit.report.xml
24+

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Verbanent
3+
Copyright (c) 2020 Radek Ziemniewicz <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# Ordered binary UUID in Laravel / Eloquent
22

33
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=verbanent_eloquent-binary-uuid&metric=alert_status)](https://sonarcloud.io/dashboard?id=verbanent_eloquent-binary-uuid)
4-
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=verbanent_eloquent-binary-uuid&metric=coverage)](https://sonarcloud.io/dashboard?id=verbanent_eloquent-binary-uuid)
5-
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=verbanent_eloquent-binary-uuid&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=verbanent_eloquent-binary-uuid)
6-
[![StyleCI](https://github.styleci.io/repos/285826449/shield?branch=master)](https://github.styleci.io/repos/285826449)
74
[![Downloads](https://img.shields.io/packagist/dt/verbanent/eloquent-binary-uuid.svg)](https://packagist.org/packages/verbanent/eloquent-binary-uuid)
5+
[![StyleCI](https://github.styleci.io/repos/285826449/shield?branch=master)](https://github.styleci.io/repos/285826449)
86
[![CodeFactor](https://www.codefactor.io/repository/github/verbanent/eloquent-binary-uuid/badge)](https://www.codefactor.io/repository/github/verbanent/eloquent-binary-uuid)
7+
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=verbanent_eloquent-binary-uuid&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=verbanent_eloquent-binary-uuid)
8+
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=verbanent_eloquent-binary-uuid&metric=ncloc)](https://sonarcloud.io/dashboard?id=verbanent_eloquent-binary-uuid)
9+
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=verbanent_eloquent-binary-uuid&metric=coverage)](https://sonarcloud.io/dashboard?id=verbanent_eloquent-binary-uuid)
10+
![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/verbanent/eloquent-binary-uuid)
11+
![Packagist License](https://img.shields.io/packagist/l/verbanent/eloquent-binary-uuid)
912

1013
Based on articles about the optimization of UUID storage in databases, I decided to write a simple library that allows this in my projects. I based on the information available here:
1114
https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/

composer.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"authors": [
33
{
44
"name": "Radek Ziemniewicz",
5-
"email": "[email protected]",
6-
"homepage": "https://ziemniewicz.eu",
7-
"role": "Developer"
5+
"email": "[email protected]"
86
}
97
],
108
"autoload": {
@@ -33,7 +31,7 @@
3331
"ordered",
3432
"uuid"
3533
],
36-
"license": "LGPL-3.0-or-later",
34+
"license": "MIT",
3735
"name": "verbanent/eloquent-binary-uuid",
3836
"description": "Ordered binary UUID in Laravel / Eloquent based on UUID version 1",
3937
"require": {

phpunit.xml

+15-28
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit bootstrap = "vendor/autoload.php"
4-
backupGlobals = "false"
5-
backupStaticAttributes = "false"
6-
colors = "true"
7-
convertErrorsToExceptions = "true"
8-
convertNoticesToExceptions = "true"
9-
convertWarningsToExceptions = "true"
10-
processIsolation = "false"
11-
stopOnFailure = "false">
12-
13-
<testsuites>
14-
<testsuite name="Ordered binary UUID in Laravel / Eloquent Test Suite">
15-
<directory>tests</directory>
16-
</testsuite>
17-
</testsuites>
18-
19-
<filter>
20-
<whitelist>
21-
<directory suffix=".php">src/</directory>
22-
</whitelist>
23-
</filter>
24-
25-
<php>
26-
<env name="APP_ENV" value="testing"/>
27-
</php>
28-
29-
</phpunit>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">src/</directory>
6+
</include>
7+
</coverage>
8+
<testsuites>
9+
<testsuite name="Ordered binary UUID in Laravel / Eloquent Test Suite">
10+
<directory>tests</directory>
11+
</testsuite>
12+
</testsuites>
13+
<php>
14+
<env name="APP_ENV" value="testing"/>
15+
</php>
16+
</phpunit>

tests/Grammars/MySqlGrammarTest.php

+8-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
namespace Verbanent\Uuid\Test\Grammars;
66

77
use PHPUnit\Framework\TestCase;
8+
use ReflectionException;
9+
use ReflectionMethod;
810
use Verbanent\Uuid\Grammars\MySqlGrammar;
911

1012
/**
@@ -17,11 +19,10 @@ class MySqlGrammarTest extends TestCase
1719
*
1820
* @param string $name
1921
*
20-
* @throws \ReflectionException
21-
*
22-
* @return \ReflectionMethod
22+
* @return ReflectionMethod
23+
* @throws ReflectionException
2324
*/
24-
protected static function getMethod(string $name): \ReflectionMethod
25+
protected static function getMethod(string $name): ReflectionMethod
2526
{
2627
$class = new \ReflectionClass(MySqlGrammar::class);
2728
$method = $class->getMethod($name);
@@ -33,15 +34,15 @@ protected static function getMethod(string $name): \ReflectionMethod
3334
/**
3435
* Test for MySqlGrammar::typeUuid.
3536
*
36-
* @throws \ReflectionException
37+
* @throws ReflectionException
3738
*/
3839
public function testTypeUuid(): void
3940
{
4041
$mySqlGrammar = new MySqlGrammar();
4142
$typeUuid = self::getMethod('typeUuid');
4243
$uuidMySqlType = $typeUuid->invokeArgs($mySqlGrammar, [new \Illuminate\Support\Fluent()]);
4344

44-
$this->assertIsString($uuidMySqlType, 'Got '.gettype($uuidMySqlType).' instead of string');
45-
$this->assertEquals('binary(16)', $uuidMySqlType, 'Got '.$uuidMySqlType.' instead of \'binary(16)\'');
45+
$this->assertIsString($uuidMySqlType, 'Got ' . gettype($uuidMySqlType) . ' instead of string');
46+
$this->assertEquals('binary(16)', $uuidMySqlType, 'Got ' . $uuidMySqlType . ' instead of \'binary(16)\'');
4647
}
4748
}

0 commit comments

Comments
 (0)