Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Commit 7a477a6

Browse files
committed
Apply php-cs-fixer changes
1 parent c959321 commit 7a477a6

4 files changed

Lines changed: 69 additions & 69 deletions

File tree

app/src/Configuration/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct()
4343
*/
4444
private function readLegacyConfigurationFile(string $fileName): array
4545
{
46-
return (static function() use ($fileName) {
46+
return (static function () use ($fileName) {
4747
$returnedValue = require $fileName;
4848

4949
if (is_array($returnedValue)) {

app/src/Repository/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,6 @@ private function createAlias(): string
236236
if (!count($result)) {
237237
return $alias;
238238
}
239-
} while(true);
239+
} while (true);
240240
}
241241
}

app/src/Router/Api.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __invoke(RouteCollectorProxyInterface $app)
3535

3636
/**
3737
* Authentication
38-
*
38+
*
3939
* - Request:
4040
* + e = email address
4141
* + p = password
@@ -258,9 +258,9 @@ public function thumb(Request $request, Response $response, array $arguments): R
258258
if ($sourceWidth > $thumbBoundaries['width'] || $sourceHeight > $thumbBoundaries['height']) {
259259
$scaler = 1;
260260

261-
if($sourceWidth > $sourceHeight) {
261+
if ($sourceWidth > $sourceHeight) {
262262
$scaler = $thumbBoundaries['width'] / $sourceWidth;
263-
} elseif($sourceWidth < $sourceHeight) {
263+
} elseif ($sourceWidth < $sourceHeight) {
264264
$scaler = $thumbBoundaries['height'] / $sourceHeight;
265265
}
266266

index.php

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
1-
<?php
2-
3-
// set up some constants first, because some of my friends are probably going
4-
// to be setting this up in a manner that is "security conscious" - moving the
5-
// app directory outside of this folder and into its parent somewhere
6-
define('PHAR_MODE', class_exists('Phar') && Phar::running());
7-
8-
if (!defined('APP_DIR')) {
9-
if (PHAR_MODE) {
10-
define('APP_DIR', realpath(getcwd() . '/app'));
11-
define('APP_VENDOR_DIR', 'phar://' . basename(__DIR__) . '/app/vendor');
12-
} else {
13-
define('APP_DIR', realpath(__DIR__ . '/app'));
14-
define('APP_VENDOR_DIR', realpath(APP_DIR . '/vendor'));
15-
}
16-
}
17-
18-
// require composer
19-
require APP_VENDOR_DIR . '/autoload.php';
20-
21-
use League\Container\Container;
22-
use Psr\Http\Message\ResponseInterface as Response;
23-
use Psr\Http\Message\ServerRequestInterface as Request;
24-
use Slim\Exception\HttpNotFoundException;
25-
use Slim\Factory\AppFactory;
26-
27-
// set up service provider
28-
$container = new Container();
29-
$container->addServiceProvider(App\ServiceProvider::class);
30-
31-
// start messing about with slim
32-
$app = AppFactory::createFromContainer($container);
33-
34-
$app->any('/dl', function (Request $request, Response $response, array $arguments) {
35-
$response->getBody()->write('85');
36-
return $response;
37-
});
38-
39-
$app->any('/', function (Request $request, Response $response, array $arguments) {
40-
return $response->withStatus(200);
41-
});
42-
43-
$app->group('/api', App\Router\Api::class);
44-
$app->group('/page', App\Router\Page::class);
45-
$app->any('/{alias:[\w\.]*?}', new App\Router\FileRoute($app));
46-
$app->any('/{alias:[\w\.]*?}/{ext}', new App\Router\FormattedFileRoute($app));
47-
48-
$afterMiddleware = function ($request, $handler) {
49-
try {
50-
$response = $handler->handle($request);
51-
} catch (UnexpectedValueException $exception) {
52-
return (new Slim\Psr7\Response())->withStatus(404);
53-
} catch (HttpNotFoundException $exception) {
54-
return (new Slim\Psr7\Response())->withStatus(404);
55-
} catch (Throwable $exception) {
56-
$response = new Slim\Psr7\Response();
57-
$response->getBody()->write('-1');
58-
return $response->withStatus(500);
59-
}
60-
return $response;
61-
};
62-
63-
$app->add($afterMiddleware);
64-
$app->run();
1+
<?php
2+
3+
// set up some constants first, because some of my friends are probably going
4+
// to be setting this up in a manner that is "security conscious" - moving the
5+
// app directory outside of this folder and into its parent somewhere
6+
define('PHAR_MODE', class_exists('Phar') && Phar::running());
7+
8+
if (!defined('APP_DIR')) {
9+
if (PHAR_MODE) {
10+
define('APP_DIR', realpath(getcwd() . '/app'));
11+
define('APP_VENDOR_DIR', 'phar://' . basename(__DIR__) . '/app/vendor');
12+
} else {
13+
define('APP_DIR', realpath(__DIR__ . '/app'));
14+
define('APP_VENDOR_DIR', realpath(APP_DIR . '/vendor'));
15+
}
16+
}
17+
18+
// require composer
19+
require APP_VENDOR_DIR . '/autoload.php';
20+
21+
use League\Container\Container;
22+
use Psr\Http\Message\ResponseInterface as Response;
23+
use Psr\Http\Message\ServerRequestInterface as Request;
24+
use Slim\Exception\HttpNotFoundException;
25+
use Slim\Factory\AppFactory;
26+
27+
// set up service provider
28+
$container = new Container();
29+
$container->addServiceProvider(App\ServiceProvider::class);
30+
31+
// start messing about with slim
32+
$app = AppFactory::createFromContainer($container);
33+
34+
$app->any('/dl', function (Request $request, Response $response, array $arguments) {
35+
$response->getBody()->write('85');
36+
return $response;
37+
});
38+
39+
$app->any('/', function (Request $request, Response $response, array $arguments) {
40+
return $response->withStatus(200);
41+
});
42+
43+
$app->group('/api', App\Router\Api::class);
44+
$app->group('/page', App\Router\Page::class);
45+
$app->any('/{alias:[\w\.]*?}', new App\Router\FileRoute($app));
46+
$app->any('/{alias:[\w\.]*?}/{ext}', new App\Router\FormattedFileRoute($app));
47+
48+
$afterMiddleware = function ($request, $handler) {
49+
try {
50+
$response = $handler->handle($request);
51+
} catch (UnexpectedValueException $exception) {
52+
return (new Slim\Psr7\Response())->withStatus(404);
53+
} catch (HttpNotFoundException $exception) {
54+
return (new Slim\Psr7\Response())->withStatus(404);
55+
} catch (Throwable $exception) {
56+
$response = new Slim\Psr7\Response();
57+
$response->getBody()->write('-1');
58+
return $response->withStatus(500);
59+
}
60+
return $response;
61+
};
62+
63+
$app->add($afterMiddleware);
64+
$app->run();

0 commit comments

Comments
 (0)