Commit b3377073 authored by Arnaud Buathier's avatar Arnaud Buathier

fix: remove declare(strict_types=1) which cost too much time to fix atm.

parent 31902eee
......@@ -21,7 +21,7 @@ return PhpCsFixer\Config::create()
'combine_consecutive_unsets' => true,
'combine_nested_dirname' => true, // php 7.0
'concat_space' => ['spacing' => 'one'],
'declare_strict_types' => true, // php 7.0
// 'declare_strict_types' => true, // php 7.0
// 'heredoc_indentation' => true, // php 7.3
'native_function_casing' => true,
'no_alias_functions' => true,
......
No preview for this file type
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......@@ -26,8 +24,9 @@ class ImagesController extends Controller
->setRequirement('ext', '[jJ][pP][gG]|[pP][nN][gG]|[gG][iI][fF]');
}
public function routeImage(string $path, int $size, string $ext)
public function routeImage(string $path, string $size, string $ext)
{
$size = (int)$size;
if ($size > 16 && $size <= 1500) {
if ($response = $this->container()->Image()->thumbnail($path, $ext, $size)) {
return $response;
......@@ -35,6 +34,7 @@ class ImagesController extends Controller
}
throw new ResourceNotFoundException();
}
public function routePriority(): int
{
return 100;
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......@@ -128,6 +126,8 @@ class Image
$w1 = imagesx($img);
$h1 = imagesy($img);
[$w2, $h2] = $this->newSize($w1, $h1, $size);
$w2 = (int)$w2;
$h2 = (int)$h2;
$dst = imagecreate($w2, $h2);
imagecopyresampled($dst, $img, 0, 0, 0, 0, $w2, $h2, $w1, $h1);
return $dst;
......@@ -149,14 +149,14 @@ class Image
throw new \RuntimeException();
}
private function fileResponse($content, $ext, $filemtime): Response
private function fileResponse(string $content, string $ext, int $filemtime): Response
{
$response = new Response($content);
$response->headers->set('Content-Type', $this->mimeTypes[$ext]);
$response->setCache(
[
'etag' => base64_encode(hash('sha256', $content, true)),
'last_modified' => \DateTime::createFromFormat('U', $filemtime),
'last_modified' => \DateTime::createFromFormat('U', (string)$filemtime),
'max_age' => 864000,
's_maxage' => 864000,
'public' => true,
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment