From fa5a3a913d7b34ae5d3510e7b6419dfedb969306 Mon Sep 17 00:00:00 2001 From: Radek Ziemniewicz Date: Sat, 3 Oct 2020 23:23:39 +0100 Subject: [PATCH 1/6] Added external tools, changed address, license info --- .gitignore | 2 ++ .scrutinizer.yml | 4 ++++ .styleci.yml | 7 +++++++ .travis.yml | 24 ++++++++++++++++++++++++ LICENSE | 2 +- composer.json | 6 ++---- 6 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 .scrutinizer.yml create mode 100644 .styleci.yml create mode 100644 .travis.yml diff --git a/.gitignore b/.gitignore index a866481..57fca2b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ coverage sonar-project.properties vendor composer.lock +.scannerwork/ +phpunit.*.xml diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 0000000..ba60ed0 --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,4 @@ +build: + environment: + php: + version: '7.3' diff --git a/.styleci.yml b/.styleci.yml new file mode 100644 index 0000000..8e1a38f --- /dev/null +++ b/.styleci.yml @@ -0,0 +1,7 @@ +risky: false +version: 7 +preset: psr12 +finder: + exclude: + - "vendor" + name: "*.php" diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0a19152 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,24 @@ +language: php +sudo: false + +php: + - 7.3 + +cache: + directories: + - $HOME/.composer/cache + +addons: + sonarcloud: + organization: "verbanent-public" + token: + secure: "flumy3jpJ+Je/oYe+CglzMCEMJurdOvPOxAkBm6q60vPxgpMTsF9bHuGxxBEuBGleCwqJGArbmctmslPzwpcAkyB39Yy3YuOowwqeT3wmi8Phl7/2vPLKnAlY6Npc6OLi43b8zaufuhUl5hfS2feVxlSaZtbXEvCuajmsZNpDId/nIEPkzH7Wv1tYHAStWUOav8wumB+ej/IRzQFsjvJoKFnGlJm9tsBf+5vq9RXTgcwV88DHOGdgWTyUVU8SUmH99VQ7m4kfiuyQohrjnj5E+CKsOnDY0DGrgchzJnqK2h5xaexgdPGCPLdWu23MS+iamJMA6knVmFcUjzzhFwcVo33EY1ZMHWk4I0sI8xHrENOmfJ83+7AC2fDwJseLqUD18h4HMd5lnFyVdXbJrFOzVmdrAWTUenDXJx6ZMlIfBOFoBOt3k+DfI7UgtW6+KLL+b0d7LjQNdpkwmieYGKbsGm0QsKeytPUpPg8OrpieJZ4LADu69cuHcpB5ZifijKx8mM3CONxi2YYJ/Rro9t9W5Shk1N9ww60uRHlHpyeDFZEtFTXHTFnVhcmPfuaWdoJjPLo8iNNI2FD4YSUOYXHNfr1r165znwF+3KbVFaaxciZfWyordZUSgknFMomRFOM3H5bVnncsgsnZ+HYBon/NUgbK2Z9fWN++jfgLAQekrk=" + +git: + depth: false + +install: composer update --no-interaction --no-suggest --no-progress + +script: + - phpdbg -qrr vendor/bin/phpunit --coverage-clover phpunit.coverage.xml --log-junit phpunit.report.xml + - sonar-scanner diff --git a/LICENSE b/LICENSE index 7171bff..83d112d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Verbanent +Copyright (c) 2020 Radek Ziemniewicz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/composer.json b/composer.json index fc869aa..23f89c1 100644 --- a/composer.json +++ b/composer.json @@ -2,9 +2,7 @@ "authors": [ { "name": "Radek Ziemniewicz", - "email": "radoslaw@ziemniewicz.pl", - "homepage": "https://ziemniewicz.eu", - "role": "Developer" + "email": "open-source@quillstack.com" } ], "autoload": { @@ -33,7 +31,7 @@ "ordered", "uuid" ], - "license": "LGPL-3.0-or-later", + "license": "MIT", "name": "verbanent/eloquent-binary-uuid", "description": "Ordered binary UUID in Laravel / Eloquent based on UUID version 1", "require": { From 559810823a93d47837a0e00ebfd42b6002b64c2c Mon Sep 17 00:00:00 2001 From: Radek Ziemniewicz Date: Sat, 3 Oct 2020 23:25:48 +0100 Subject: [PATCH 2/6] Fixed CS for MySqlGrammarTest --- tests/Grammars/MySqlGrammarTest.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/Grammars/MySqlGrammarTest.php b/tests/Grammars/MySqlGrammarTest.php index bcc581a..75602dd 100644 --- a/tests/Grammars/MySqlGrammarTest.php +++ b/tests/Grammars/MySqlGrammarTest.php @@ -5,6 +5,8 @@ namespace Verbanent\Uuid\Test\Grammars; use PHPUnit\Framework\TestCase; +use ReflectionException; +use ReflectionMethod; use Verbanent\Uuid\Grammars\MySqlGrammar; /** @@ -17,11 +19,10 @@ class MySqlGrammarTest extends TestCase * * @param string $name * - * @throws \ReflectionException - * - * @return \ReflectionMethod + * @return ReflectionMethod + * @throws ReflectionException */ - protected static function getMethod(string $name): \ReflectionMethod + protected static function getMethod(string $name): ReflectionMethod { $class = new \ReflectionClass(MySqlGrammar::class); $method = $class->getMethod($name); @@ -33,7 +34,7 @@ protected static function getMethod(string $name): \ReflectionMethod /** * Test for MySqlGrammar::typeUuid. * - * @throws \ReflectionException + * @throws ReflectionException */ public function testTypeUuid(): void { @@ -41,7 +42,7 @@ public function testTypeUuid(): void $typeUuid = self::getMethod('typeUuid'); $uuidMySqlType = $typeUuid->invokeArgs($mySqlGrammar, [new \Illuminate\Support\Fluent()]); - $this->assertIsString($uuidMySqlType, 'Got '.gettype($uuidMySqlType).' instead of string'); - $this->assertEquals('binary(16)', $uuidMySqlType, 'Got '.$uuidMySqlType.' instead of \'binary(16)\''); + $this->assertIsString($uuidMySqlType, 'Got ' . gettype($uuidMySqlType) . ' instead of string'); + $this->assertEquals('binary(16)', $uuidMySqlType, 'Got ' . $uuidMySqlType . ' instead of \'binary(16)\''); } } From 89a75bee26f5c462e18398df89deb08c534e416a Mon Sep 17 00:00:00 2001 From: Radek Ziemniewicz Date: Sat, 3 Oct 2020 23:37:39 +0100 Subject: [PATCH 3/6] Updated README --- .scrutinizer.yml | 2 +- .travis.yml | 2 +- README.md | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index ba60ed0..6202a98 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,4 +1,4 @@ build: environment: php: - version: '7.3' + version: '7.4' diff --git a/.travis.yml b/.travis.yml index 0a19152..0a2bb24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: php sudo: false php: - - 7.3 + - 7.4 cache: directories: diff --git a/README.md b/README.md index 830fffe..45b0ef9 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,16 @@ # Ordered binary UUID in Laravel / Eloquent +[![Build Status](https://travis-ci.org/verbanent/eloquent-binary-uuid.svg?branch=master)](https://travis-ci.org/verbanent/eloquent-binary-uuid) [![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) -[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=verbanent_eloquent-binary-uuid&metric=coverage)](https://sonarcloud.io/dashboard?id=verbanent_eloquent-binary-uuid) -[![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) -[![StyleCI](https://github.styleci.io/repos/285826449/shield?branch=master)](https://github.styleci.io/repos/285826449) [![Downloads](https://img.shields.io/packagist/dt/verbanent/eloquent-binary-uuid.svg)](https://packagist.org/packages/verbanent/eloquent-binary-uuid) +[![StyleCI](https://github.styleci.io/repos/285826449/shield?branch=master)](https://github.styleci.io/repos/285826449) [![CodeFactor](https://www.codefactor.io/repository/github/verbanent/eloquent-binary-uuid/badge)](https://www.codefactor.io/repository/github/verbanent/eloquent-binary-uuid) +[![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) +[![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) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=verbanent_eloquent-binary-uuid&metric=coverage)](https://sonarcloud.io/dashboard?id=verbanent_eloquent-binary-uuid) +![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/verbanent/eloquent-binary-uuid) +![Packagist License](https://img.shields.io/packagist/l/verbanent/eloquent-binary-uuid) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/verbanent/eloquent-binary-uuid/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/verbanent/eloquent-binary-uuid/?branch=master) 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: https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/ From 2f37a378d64d2b077038f4fdbe7eb49ba4cfa8bb Mon Sep 17 00:00:00 2001 From: Radek Ziemniewicz Date: Sat, 3 Oct 2020 23:48:53 +0100 Subject: [PATCH 4/6] Updated phpunit configuration --- phpunit.xml | 43 +++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index dc1c052..66c323f 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,29 +1,16 @@ - - - - - - tests - - - - - - src/ - - - - - - - - \ No newline at end of file + + + + src/ + + + + + tests + + + + + + From 69735f36d8bc7412ad367b26e6d589e036d107d4 Mon Sep 17 00:00:00 2001 From: Radek Ziemniewicz Date: Sat, 3 Oct 2020 23:55:49 +0100 Subject: [PATCH 5/6] Added SonarQube details to Travis configuration file --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0a2bb24..a981e68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,4 +21,5 @@ install: composer update --no-interaction --no-suggest --no-progress script: - phpdbg -qrr vendor/bin/phpunit --coverage-clover phpunit.coverage.xml --log-junit phpunit.report.xml - - sonar-scanner + - sonar-scanner -Dsonar.organization=verbanent-public -Dsonar.projectKey=verbanent_eloquent-binary-uuid -Dsonar.sources=src -Dsonar.host.url=https://sonarcloud.io + From 58b08e8b307287d5710f24850bb61a5178ab3ac4 Mon Sep 17 00:00:00 2001 From: Radek Ziemniewicz Date: Sun, 4 Oct 2020 00:00:05 +0100 Subject: [PATCH 6/6] Removed Sonar from Travis --- .travis.yml | 1 - README.md | 2 -- 2 files changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a981e68..cd2f759 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,5 +21,4 @@ install: composer update --no-interaction --no-suggest --no-progress script: - phpdbg -qrr vendor/bin/phpunit --coverage-clover phpunit.coverage.xml --log-junit phpunit.report.xml - - sonar-scanner -Dsonar.organization=verbanent-public -Dsonar.projectKey=verbanent_eloquent-binary-uuid -Dsonar.sources=src -Dsonar.host.url=https://sonarcloud.io diff --git a/README.md b/README.md index 45b0ef9..7c37d40 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # Ordered binary UUID in Laravel / Eloquent -[![Build Status](https://travis-ci.org/verbanent/eloquent-binary-uuid.svg?branch=master)](https://travis-ci.org/verbanent/eloquent-binary-uuid) [![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) [![Downloads](https://img.shields.io/packagist/dt/verbanent/eloquent-binary-uuid.svg)](https://packagist.org/packages/verbanent/eloquent-binary-uuid) [![StyleCI](https://github.styleci.io/repos/285826449/shield?branch=master)](https://github.styleci.io/repos/285826449) @@ -10,7 +9,6 @@ [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=verbanent_eloquent-binary-uuid&metric=coverage)](https://sonarcloud.io/dashboard?id=verbanent_eloquent-binary-uuid) ![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/verbanent/eloquent-binary-uuid) ![Packagist License](https://img.shields.io/packagist/l/verbanent/eloquent-binary-uuid) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/verbanent/eloquent-binary-uuid/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/verbanent/eloquent-binary-uuid/?branch=master) 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: https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/