Browse Source

fix(cs): SPIP40 v1.1.0

fix-api
JamesRezo 1 year ago
parent
commit
64cc8ce1f6
  1. 2
      action/api_spip_loader.php
  2. 16
      composer.lock
  3. 18
      supportedversions_fonctions.php

2
action/api_spip_loader.php

@ -16,7 +16,7 @@ function action_api_spip_loader_dist(): void {
$api = intval($api) ?: SupportedVersions::spipLoaderApi();
$reponse = ['api' => $api];
$modele = recuperer_fond('modeles/supportedversions_spiploaderlist_'.$api);
$modele = recuperer_fond('modeles/supportedversions_spiploaderlist_' . $api);
if ($modele) {
$reponse['versions'] = json_decode($modele, true);
}

16
composer.lock generated

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "7027f6132a41e52ee49042f3582e27a9",
"content-hash": "19872a3ef7916853ec76d509e37cbdb4",
"packages": [],
"packages-dev": [
{
@ -2109,16 +2109,16 @@
},
{
"name": "spip/coding-standards",
"version": "1.0.0",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/JamesRezo/spip-coding-standards.git",
"reference": "1cc47bf07ba5fb06a40b908df548a1dab962996e"
"reference": "ab08936dbd3ecc039de84fd7aeeddf2a508c347e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/JamesRezo/spip-coding-standards/zipball/1cc47bf07ba5fb06a40b908df548a1dab962996e",
"reference": "1cc47bf07ba5fb06a40b908df548a1dab962996e",
"url": "https://api.github.com/repos/JamesRezo/spip-coding-standards/zipball/ab08936dbd3ecc039de84fd7aeeddf2a508c347e",
"reference": "ab08936dbd3ecc039de84fd7aeeddf2a508c347e",
"shasum": ""
},
"require": {
@ -2131,7 +2131,7 @@
"type": "phpcodesniffer-standard",
"extra": {
"branch-alias": {
"dev-main": "1.0.x-dev"
"dev-main": "1.1.x-dev"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -2151,9 +2151,9 @@
],
"support": {
"issues": "https://github.com/JamesRezo/spip-coding-standards/issues",
"source": "https://github.com/JamesRezo/spip-coding-standards/tree/1.0.0"
"source": "https://github.com/JamesRezo/spip-coding-standards/tree/1.1.0"
},
"time": "2021-08-13T17:46:50+00:00"
"time": "2021-08-21T12:37:50+00:00"
},
{
"name": "squizlabs/php_codesniffer",

18
supportedversions_fonctions.php

@ -11,9 +11,9 @@
* @return string
*/
function supportedversions_insert_head_css(string $flux): string {
$flux .= '<link rel="stylesheet" type="text/css" media="all" href="'.
find_in_path('css/supported-versions.css').
'" />'."\n";
$flux .= '<link rel="stylesheet" type="text/css" media="all" href="' .
find_in_path('css/supported-versions.css') .
'" />' . "\n";
return $flux;
}
@ -57,7 +57,7 @@ class SupportedVersions
* @var array<mixed>
*/
private static $defaultConfig = [
'calendar' =>[
'calendar' => [
'min_year' => 'P3Y',
'max_year' => 'P5Y',
],
@ -133,7 +133,7 @@ class SupportedVersions
*/
protected static function init() {
self::$config = $GLOBALS['supportedversions'];
self::$now = new DateTime;
self::$now = new DateTime();
self::$releasesFile = 'data/releases.json';
self::compute();
@ -152,9 +152,9 @@ class SupportedVersions
;
$nowYear = self::$now->format('Y');
self::$minDate = (new DateTime('January 1 '.$nowYear))
self::$minDate = (new DateTime('January 1 ' . $nowYear))
->sub(new DateInterval($calendar['min_year']));
self::$maxDate = (new DateTime('January 1 '.$nowYear))
self::$maxDate = (new DateTime('January 1 ' . $nowYear))
->add(new DateInterval($calendar['max_year']));
self::$years = array_map(
function ($year) {
@ -761,7 +761,7 @@ class SupportedVersions
/**
* Version par défaut de l'API pour le script spip_loader.php.
*/
public static function spipLoaderApi():int {
public static function spipLoaderApi(): int {
// @codeCoverageIgnoreStart
if (!self::$config) {
self::init();
@ -780,7 +780,7 @@ class SupportedVersions
$strExtensions = '';
foreach ($extensions as $extension => $version) {
$strExtensions .= $extension.($version == '*' ? '' : $versionMarker.$version).', ';
$strExtensions .= $extension . ($version == '*' ? '' : $versionMarker . $version) . ', ';
}
return preg_replace('/, $/', '', $strExtensions) ?? '';

Loading…
Cancel
Save