Skip to content
Permalink
Browse files

Apply fixes from StyleCI

  • Loading branch information...
jbelien authored and StyleCIBot committed May 26, 2019
1 parent a7ab7c3 commit 34f94da163fc9e61136554447d4c1d2cb2b72a2d
@@ -5,24 +5,25 @@
* Can also be invoked as `composer clear-config-cache`.
*
* @see https://github.com/zendframework/zend-expressive-skeleton for the canonical source repository
*
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
* @license https://github.com/zendframework/zend-expressive-skeleton/blob/master/LICENSE.md New BSD License
*/
declare(strict_types=1);
chdir(__DIR__ . '/../');
chdir(__DIR__.'/../');
require 'vendor/autoload.php';
$config = include 'config/config.php';
if (! isset($config['config_cache_path'])) {
echo "No configuration cache path found" . PHP_EOL;
if (!isset($config['config_cache_path'])) {
echo 'No configuration cache path found'.PHP_EOL;
exit(0);
}
if (! file_exists($config['config_cache_path'])) {
if (!file_exists($config['config_cache_path'])) {
printf(
"Configured config cache file '%s' not found%s",
$config['config_cache_path'],
@@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
use Zend\ConfigAggregator\ArrayProvider;
use Zend\ConfigAggregator\ConfigAggregator;
@@ -39,10 +39,10 @@ class_exists(\Zend\Expressive\Swoole\ConfigProvider::class)
// - `*.global.php`
// - `local.php`
// - `*.local.php`
new PhpFileProvider(realpath(__DIR__) . '/autoload/{{,*.}global,{,*.}local}.php'),
new PhpFileProvider(realpath(__DIR__).'/autoload/{{,*.}global,{,*.}local}.php'),
// Load development config if it exists
new PhpFileProvider(realpath(__DIR__) . '/development.config.php'),
new PhpFileProvider(realpath(__DIR__).'/development.config.php'),
], $cacheConfig['config_cache_path']);
return $aggregator->getMergedConfig();
@@ -5,7 +5,7 @@
use Zend\ServiceManager\ServiceManager;
// Load configuration
$config = require __DIR__ . '/config.php';
$config = require __DIR__.'/config.php';
$dependencies = $config['dependencies'];
$dependencies['services']['config'] = $config;
@@ -15,7 +15,7 @@
use Zend\Expressive\Router\Middleware\RouteMiddleware;
use Zend\Stratigility\Middleware\ErrorHandler;
/**
/*
* Setup middleware pipeline:
*/
return function (Application $app, MiddlewareFactory $factory, ContainerInterface $container) : void {
@@ -6,7 +6,7 @@
use Zend\Expressive\Application;
use Zend\Expressive\MiddlewareFactory;
/**
/*
* Setup routes with a single request method:
*
* $app->get('/', App\Handler\HomePageHandler::class, 'home');
@@ -10,7 +10,7 @@
chdir(dirname(__DIR__));
require 'vendor/autoload.php';
/**
/*
* Self-called anonymous function that creates its own scope and keep the global namespace clean.
*/
(function () {
@@ -5,18 +5,17 @@
namespace App;
/**
* The configuration provider for the App module
* The configuration provider for the App module.
*
* @see https://docs.zendframework.com/zend-component-installer/
*/
class ConfigProvider
{
/**
* Returns the configuration array
* Returns the configuration array.
*
* To add a bit of a structure, each section is defined in a separate
* method which returns an array with its configuration.
*
*/
public function __invoke() : array
{
@@ -27,7 +26,7 @@ public function __invoke() : array
}
/**
* Returns the container dependencies
* Returns the container dependencies.
*/
public function getDependencies() : array
{
@@ -42,7 +41,7 @@ public function getDependencies() : array
}
/**
* Returns the templates configuration
* Returns the templates configuration.
*/
public function getTemplates() : array
{
@@ -4,11 +4,11 @@
namespace App\Handler;
use App\Reader\FMedias;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\JsonResponse;
use App\Reader\FMedias;
class FMediasHandler implements RequestHandlerInterface
{
@@ -1,14 +1,14 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace App\Handler\FormatI;
use App\Reader\FormatI\Candidate;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\JsonResponse;
use App\Reader\FormatI\Candidate;
class CandidatesHandler implements RequestHandlerInterface
{
@@ -1,14 +1,14 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace App\Handler\FormatI;
use App\Reader\FormatI\Entity;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\JsonResponse;
use App\Reader\FormatI\Entity;
class EntitiesHandler implements RequestHandlerInterface
{
@@ -1,13 +1,13 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace App\Handler\FormatI;
use App\Reader\FormatI\Group;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use App\Reader\FormatI\Group;
use Zend\Diactoros\Response\JsonResponse;
class GroupsHandler implements RequestHandlerInterface
@@ -1,13 +1,13 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace App\Handler\FormatI;
use App\Reader\FormatI\Liste;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use App\Reader\FormatI\Liste;
use Zend\Diactoros\Response\JsonResponse;
class ListsHandler implements RequestHandlerInterface
@@ -1,14 +1,14 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace App\Handler\FormatR;
use App\Reader\FormatR\Evolution;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\JsonResponse;
use App\Reader\FormatR\Evolution;
class EvolutionHandler implements RequestHandlerInterface
{
@@ -1,15 +1,15 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace App\Handler\FormatR;
use App\Reader\FormatR\ResultD;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\JsonResponse;
use App\Reader\FormatR\ResultD;
use Zend\Diactoros\Response\EmptyResponse;
use Zend\Diactoros\Response\JsonResponse;
class ResultsDHandler implements RequestHandlerInterface
{
@@ -1,14 +1,14 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace App\Handler\FormatR;
use App\Reader\FormatR\Result;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\JsonResponse;
use App\Reader\FormatR\Result;
class ResultsHandler implements RequestHandlerInterface
{
@@ -8,13 +8,9 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\HtmlResponse;
use Zend\Diactoros\Response\JsonResponse;
use Zend\Expressive\Plates\PlatesRenderer;
use Zend\Diactoros\Response\RedirectResponse;
use Zend\Expressive\Router;
use Zend\Expressive\Template\TemplateRendererInterface;
use Zend\Expressive\Twig\TwigRenderer;
use Zend\Expressive\ZendView\ZendViewRenderer;
use Zend\Diactoros\Response\RedirectResponse;
class HomePageHandler implements RequestHandlerInterface
{
@@ -33,8 +29,8 @@ public function __construct(
TemplateRendererInterface $template
) {
$this->containerName = $containerName;
$this->router = $router;
$this->template = $template;
$this->router = $router;
$this->template = $template;
}
public function handle(ServerRequestInterface $request) : ResponseInterface
@@ -8,14 +8,13 @@
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Expressive\Router\RouterInterface;
use Zend\Expressive\Template\TemplateRendererInterface;
use function get_class;
class HomePageHandlerFactory
{
public function __invoke(ContainerInterface $container) : RequestHandlerInterface
{
$router = $container->get(RouterInterface::class);
$router = $container->get(RouterInterface::class);
$template = $container->get(TemplateRendererInterface::class);
return new HomePageHandler(get_class($container), $router, $template);
@@ -8,7 +8,6 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\JsonResponse;
use function time;
class PingHandler implements RequestHandlerInterface
@@ -50,15 +50,15 @@ private function read()
$nis = $data[2];
$result = [
// 'nis' => $nis,
'seats' => intval($data[3]),
'seats' => intval($data[3]),
'subsitutes' => intval($data[4]),
'lists' => [],
'lists' => [],
];
}
break;
case 'L':
$result['lists'][intval($data[3])] = [
'name' => $data[4],
'name' => $data[4],
'effectives' => [],
'substitues' => [],
];
@@ -67,10 +67,10 @@ private function read()
$nr = intval($data[5]);
$candidate = [
'fullname' => $data[6],
'gender' => $data[7],
'fullname' => $data[6],
'gender' => $data[7],
'birthdate' => $data[8],
'lastname' => $data[9],
'lastname' => $data[9],
'firstname' => $data[10],
];
@@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace App\Reader\FormatI;
@@ -54,14 +54,14 @@ private function read()
}
$candidates[$id] = [
'id' => $id,
'level' => $data[3],
'nr' => intval($data[8]),
'name' => $data[9],
'type' => $data[7],
'gender' => $data[10],
'id' => $id,
'level' => $data[3],
'nr' => intval($data[8]),
'name' => $data[9],
'type' => $data[7],
'gender' => $data[10],
'birthdate' => $data[12],
'list' => isset($lists[intval($data[5])]) ? $lists[intval($data[5])] : null,
'list' => isset($lists[intval($data[5])]) ? $lists[intval($data[5])] : null,
// 'group' => isset($groups[intval($data[6])]) ? $groups[intval($data[6])] : null,
// 'entity' => isset($entities[intval($data[13])]) ? $entities[intval($data[13])] : null,
];

0 comments on commit 34f94da

Please sign in to comment.
You can’t perform that action at this time.