Skip to content
This repository was archived by the owner on Aug 2, 2020. It is now read-only.

Commit d40b0bd

Browse files
authored
Apply fixes from StyleCI (#1)
1 parent fc77d01 commit d40b0bd

File tree

6 files changed

+18
-20
lines changed

6 files changed

+18
-20
lines changed

config/config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
// - `*.global.php`
3232
// - `local.php`
3333
// - `*.local.php`
34-
new PhpFileProvider(realpath(__DIR__) . '/autoload/{{,*.}global,{,*.}local}.php'),
34+
new PhpFileProvider(realpath(__DIR__).'/autoload/{{,*.}global,{,*.}local}.php'),
3535

3636
// Load development config if it exists
37-
new PhpFileProvider(realpath(__DIR__) . '/development.config.php'),
37+
new PhpFileProvider(realpath(__DIR__).'/development.config.php'),
3838
], $cacheConfig['config_cache_path']);
3939

4040
return $aggregator->getMergedConfig();

config/pipeline.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
use Zend\Expressive\Router\Middleware\RouteMiddleware;
1818
use Zend\Stratigility\Middleware\ErrorHandler;
1919

20-
21-
/**
20+
/*
2221
* Setup middleware pipeline:
2322
*/
2423
return function (Application $app, MiddlewareFactory $factory, ContainerInterface $container) : void {

public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Zend\ServiceManager\Config;
1616
use Zend\ServiceManager\ServiceManager;
1717

18-
/**
18+
/*
1919
* Self-called anonymous function that creates its own scope and keep the global namespace clean.
2020
*/
2121
(function () {

src/ConfigProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
namespace App;
66

77
/**
8-
* The configuration provider for the App module
8+
* The configuration provider for the App module.
99
*
1010
* @see https://docs.zendframework.com/zend-component-installer/
1111
*/
1212
class ConfigProvider
1313
{
1414
/**
15-
* Returns the configuration array
15+
* Returns the configuration array.
1616
*/
1717
public function __invoke() : array
1818
{
@@ -22,7 +22,7 @@ public function __invoke() : array
2222
}
2323

2424
/**
25-
* Returns the container dependencies
25+
* Returns the container dependencies.
2626
*/
2727
public function getDependencies() : array
2828
{

src/Handler/WebhookHandler.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function handle(ServerRequestInterface $request) : ResponseInterface
3232
$this->signature = $headers['x-hub-signature'][0] ?? '';
3333

3434
if (isset($this->config['token']) && !empty($this->config['token'])) {
35-
$sha1 = hash_hmac('sha1', (string)$request->getBody(), $this->config['token']);
35+
$sha1 = hash_hmac('sha1', (string) $request->getBody(), $this->config['token']);
3636

3737
if (hash_equals('sha1='.$sha1, $this->signature) !== true) {
3838
return new TextResponse('ERROR: Invalid signature!', 401);
@@ -54,15 +54,17 @@ public function handle(ServerRequestInterface $request) : ResponseInterface
5454
}
5555
}
5656

57-
private function ping() {
57+
private function ping()
58+
{
5859
return new TextResponse('pong');
5960
}
6061

61-
private function push() {
62+
private function push()
63+
{
6264
$repository = $this->payload['repository']['full_name'];
6365
$branch = substr($this->payload['ref'], 11);
6466

65-
$out = 'DELIVERY: '.$this->delivery.PHP_EOL;
67+
$out = 'DELIVERY: '.$this->delivery.PHP_EOL;
6668
$out .= 'BY: '.$this->payload['pusher']['name'].PHP_EOL;
6769
$out .= '--------------------------------------------------'.PHP_EOL;
6870

@@ -95,7 +97,6 @@ private function push() {
9597
$out .= '--------------------------------------------------'.PHP_EOL;
9698
}
9799

98-
99100
return new TextResponse($out, $status);
100101
}
101102
}

src/Middleware/ConfigMiddleware.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44

55
namespace App\Middleware;
66

7-
use Psr\Http\Server\MiddlewareInterface;
8-
use Psr\Http\Server\RequestHandlerInterface;
97
use Psr\Http\Message\ResponseInterface;
108
use Psr\Http\Message\ServerRequestInterface;
9+
use Psr\Http\Server\MiddlewareInterface;
10+
use Psr\Http\Server\RequestHandlerInterface;
1111
use Zend\ConfigAggregator\ConfigAggregator;
12-
use Zend\ConfigAggregator\PhpFileProvider;
1312
use Zend\ConfigAggregator\ZendConfigProvider;
1413

15-
1614
class ConfigMiddleware implements MiddlewareInterface
1715
{
1816
public const CONFIG_ATTRIBUTE = 'config';
@@ -24,10 +22,10 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
2422
];
2523

2624
$config = new ConfigAggregator([
27-
new ZendConfigProvider(realpath(dirname(dirname(__DIR__))) . '/composer.json'),
28-
new ZendConfigProvider(realpath(dirname(dirname(__DIR__))) . '/config/application/*.{php,ini,xml,json,yaml}'),
25+
new ZendConfigProvider(realpath(dirname(dirname(__DIR__))).'/composer.json'),
26+
new ZendConfigProvider(realpath(dirname(dirname(__DIR__))).'/config/application/*.{php,ini,xml,json,yaml}'),
2927
], $cacheConfig['config_cache_path']);
3028

3129
return $handler->handle($request->withAttribute(self::CONFIG_ATTRIBUTE, $config->getMergedConfig()));
3230
}
33-
}
31+
}

0 commit comments

Comments
 (0)