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
+7 -12
View File
@@ -1,4 +1,5 @@
<?php
/**
* This file is part of the ramsey/uuid library
*
@@ -7,31 +8,25 @@
*
* @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\Provider\Node;
use Exception;
use Ramsey\Uuid\Provider\NodeProviderInterface;
/**
* RandomNodeProvider provides functionality to generate a random node ID, in
* the event that the node ID could not be obtained from the host system
* RandomNodeProvider generates a random node ID
*
* @link http://tools.ietf.org/html/rfc4122#section-4.5
* @link http://tools.ietf.org/html/rfc4122#section-4.5 RFC 4122, § 4.5: Node IDs that Do Not Identify the Host
*/
class RandomNodeProvider implements NodeProviderInterface
{
/**
* Returns the system node ID
*
* @return string System node ID as a hexadecimal string
* @throws Exception if it was not possible to gather sufficient entropy
* @inheritDoc
*/
public function getNode(): string
public function getNode()
{
$nodeBytes = random_bytes(6);