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 -15
View File
@@ -1,4 +1,5 @@
<?php
/**
* This file is part of the ramsey/uuid library
*
@@ -7,20 +8,17 @@
*
* @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;
/**
* FallbackNodeProvider attempts to gain the system host ID from an array of
* providers, falling back to the next in line in the event a host ID can not be
* obtained
* FallbackNodeProvider retrieves the system node ID by stepping through a list
* of providers until a node ID can be obtained
*/
class FallbackNodeProvider implements NodeProviderInterface
{
@@ -30,8 +28,6 @@ class FallbackNodeProvider implements NodeProviderInterface
private $nodeProviders;
/**
* Constructs a `FallbackNodeProvider` using an array of node providers
*
* @param NodeProviderInterface[] $providers Array of node providers
*/
public function __construct(array $providers)
@@ -40,13 +36,9 @@ class FallbackNodeProvider implements NodeProviderInterface
}
/**
* Returns the system node ID by iterating over an array of node providers
* and returning the first non-empty value found
*
* @return string|null System node ID as a hexadecimal string
* @throws Exception
* @inheritDoc
*/
public function getNode(): ?string
public function getNode()
{
foreach ($this->nodeProviders as $provider) {
if ($node = $provider->getNode()) {