Skip to content

Commit

Permalink
Add automated phpcbf fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Andi Rückauer <arueckauer@gmail.com>
  • Loading branch information
arueckauer committed Oct 11, 2021
1 parent e7f92d2 commit 0a146bc
Show file tree
Hide file tree
Showing 17 changed files with 88 additions and 59 deletions.
6 changes: 3 additions & 3 deletions src/ArrayProvider.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Laminas\ConfigAggregator;

/**
Expand All @@ -9,9 +11,7 @@
*/
class ArrayProvider
{
/**
* @var array
*/
/** @var array */
private $config;

/**
Expand Down
18 changes: 7 additions & 11 deletions src/ConfigAggregator.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Laminas\ConfigAggregator;

use Brick\VarExporter\ExportException;
Expand Down Expand Up @@ -36,7 +38,7 @@ class ConfigAggregator
/**
* @todo Make this constant private in version 2.0.0
*/
public const CACHE_TEMPLATE = <<< 'EOT'
public const CACHE_TEMPLATE = <<<'EOT'
<?php
/**
Expand All @@ -47,9 +49,7 @@ class ConfigAggregator

EOT;

/**
* @var array
*/
/** @var array */
private $config;

/**
Expand Down Expand Up @@ -191,7 +191,6 @@ private function mergeArray(array $a, array $b): array
* @param mixed|array $config Configuration generated by the $provider.
* @param callable $provider Provider responsible for generating $config;
* used for exception messages only.
* @return void
* @throws InvalidConfigProviderException
*/
private function mergeConfig(&$mergedConfig, $config, callable $provider): void
Expand Down Expand Up @@ -219,7 +218,7 @@ private function loadConfigFromProviders(iterable $providers): array
$mergedConfig = [];
foreach ($providers as $provider) {
$provider = $this->resolveProvider($provider);
$config = $provider();
$config = $provider();
if (! $config instanceof Generator) {
$this->mergeConfig($mergedConfig, $config, $provider);
continue;
Expand All @@ -237,7 +236,6 @@ private function loadConfigFromProviders(iterable $providers): array
* Attempt to load the configuration from a cache file.
*
* @param null|string $cachedConfigFile
* @return bool
*/
private function loadConfigFromCache($cachedConfigFile): bool
{
Expand Down Expand Up @@ -273,7 +271,7 @@ private function cacheConfig(array $config, $cachedConfigFile): void
try {
$contents = sprintf(
self::CACHE_TEMPLATE,
get_class($this),
static::class,
date('c'),
VarExporter::export($config, VarExporter::ADD_RETURN | VarExporter::CLOSURE_SNAPSHOT_USES)
);
Expand All @@ -292,16 +290,14 @@ private function postProcessConfig(array $processors, array $config): array
{
foreach ($processors as $processor) {
$processor = $this->resolveProcessor($processor);
$config = $processor($config);
$config = $processor($config);
}

return $config;
}

/**
* @param Closure|object|callable $variable
*
* @return string
*/
private function detectVariableType($variable): string
{
Expand Down
4 changes: 2 additions & 2 deletions src/ConfigCannotBeCachedException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Laminas\ConfigAggregator;

use Brick\VarExporter\ExportException;
Expand All @@ -10,8 +12,6 @@
class ConfigCannotBeCachedException extends RuntimeException
{
/**
* @param ExportException $exportException
*
* @return ConfigCannotBeCachedException
*/
public static function fromExporterException(ExportException $exportException)
Expand Down
2 changes: 2 additions & 0 deletions src/GlobTrait.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Laminas\ConfigAggregator;

use Laminas\Stdlib\Glob;
Expand Down
5 changes: 2 additions & 3 deletions src/InvalidConfigProcessorException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Laminas\ConfigAggregator;

use RuntimeException;
Expand All @@ -8,10 +10,8 @@

class InvalidConfigProcessorException extends RuntimeException
{

/**
* @param string $processor
*
* @return InvalidConfigProcessorException
*/
public static function fromNamedProcessor($processor)
Expand All @@ -24,7 +24,6 @@ public static function fromNamedProcessor($processor)

/**
* @param string $type
*
* @return InvalidConfigProcessorException
*/
public static function fromUnsupportedType($type)
Expand Down
5 changes: 2 additions & 3 deletions src/InvalidConfigProviderException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Laminas\ConfigAggregator;

use RuntimeException;
Expand All @@ -8,10 +10,8 @@

class InvalidConfigProviderException extends RuntimeException
{

/**
* @param string $provider
*
* @return InvalidConfigProviderException
*/
public static function fromNamedProvider($provider)
Expand All @@ -24,7 +24,6 @@ public static function fromNamedProvider($provider)

/**
* @param string $type
*
* @return InvalidConfigProviderException
*/
public static function fromUnsupportedType($type)
Expand Down
2 changes: 2 additions & 0 deletions src/LaminasConfigProvider.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Laminas\ConfigAggregator;

use Laminas\Config\Factory as ConfigFactory;
Expand Down
6 changes: 5 additions & 1 deletion src/PhpFileProvider.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?php

declare(strict_types=1);

namespace Laminas\ConfigAggregator;

use Generator;

/**
* Provide a collection of PHP files returning config arrays.
*/
Expand All @@ -21,7 +25,7 @@ public function __construct($pattern)
}

/**
* @return \Generator
* @return Generator
*/
public function __invoke()
{
Expand Down
2 changes: 2 additions & 0 deletions test/ArrayProviderTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\ConfigAggregator;

use Laminas\ConfigAggregator\ArrayProvider;
Expand Down
Loading

0 comments on commit 0a146bc

Please sign in to comment.