Update coding style to include PSR-12, among other options

This also includes heavy use of slevomat/coding-standard to apply
various checks to the code, based on maintainer (me) preference.
This commit is contained in:
Ben Ramsey
2019-12-17 16:50:38 -06:00
parent e2a56d62e6
commit 0d7b8c2b7a
89 changed files with 1717 additions and 1444 deletions
+15 -17
View File
@@ -1,4 +1,5 @@
<?php
/**
* This file is part of the ramsey/uuid library
*
@@ -7,19 +8,15 @@
*
* @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
* @license http://opensource.org/licenses/MIT MIT
* @link https://benramsey.com/projects/ramsey-uuid/ Documentation
* @link https://packagist.org/packages/ramsey/uuid Packagist
* @link https://github.com/ramsey/uuid GitHub
*/
declare(strict_types=1);
namespace Ramsey\Uuid\Converter;
use InvalidArgumentException;
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
/**
* TimeConverterInterface provides facilities for converting parts of time into
* representations that may be used in UUIDs
* A time converter converts timestamps into representations that may be used
* in UUIDs
*/
interface TimeConverterInterface
{
@@ -27,24 +24,25 @@ interface TimeConverterInterface
* Uses the provided seconds and micro-seconds to calculate the time_low,
* time_mid, and time_high fields used by RFC 4122 version 1 UUIDs
*
* @param string $seconds
* @param string $microSeconds
* @link http://tools.ietf.org/html/rfc4122#section-4.2.2 RFC 4122, § 4.2.2: Generation Details
*
* @param string $seconds A string representation of the number of seconds
* since the Unix epoch for the time to calculate
* @param string $microSeconds A string representation of the micro-seconds
* associated with the time to calculate
*
* @return string[] An array guaranteed to contain `low`, `mid`, and `hi` keys
* @throws InvalidArgumentException if $seconds or $microseconds are not integer strings
* @throws UnsatisfiedDependencyException if the chosen converter is not present
* @link http://tools.ietf.org/html/rfc4122#section-4.2.2
*/
public function calculateTime(string $seconds, string $microSeconds): array;
/**
* Converts a timestamp extracted from a UUID to a unix timestamp
* Converts a timestamp extracted from a UUID to a Unix timestamp
*
* @param string $timestamp A string integer representation of a timestamp;
* this must be a numeric string to accommodate unsigned integers
* greater than PHP_INT_MAX.
* @return string
* @throws InvalidArgumentException if $timestamp is not an integer string
* @throws UnsatisfiedDependencyException if the chosen converter is not present
*
* @return string String representation of an integer
*/
public function convertTime(string $timestamp): string;
}