Skip to content

Commit

Permalink
Headers, Galette 1.1.0 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Jan 25, 2024
1 parent fc30d64 commit 0dea8a8
Show file tree
Hide file tree
Showing 39 changed files with 438 additions and 831 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: CS
run: |
cd galette-core/galette/plugins/plugin-objectslend
../../vendor/bin/phpcs -n -p --standard=../../../phpcs-rules.xml lib/ ./*.php
../../vendor/bin/phpcs lib/ ./*.php
- name: Check missing symbols
run: |
Expand All @@ -76,3 +76,8 @@ jobs:
cd galette-core/galette/plugins/plugin-objectslend
../../vendor/bin/phpstan analyze --ansi --memory-limit=2G --no-interaction --no-progress
if: matrix.php-versions == '8.1'

- name: Headers checks
run: |
cd galette-core/galette/plugins/plugin-objectslend
../../vendor/bin/docheader --docheader=../../../.docheader check lib ./*.php
27 changes: 4 additions & 23 deletions _config.inc.php
Original file line number Diff line number Diff line change
@@ -1,41 +1,22 @@
<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
* Configuration file for ObjectsLend plugin
*
* PHP version 5
*
* Copyright © 2013-2016 Mélissa Djebel
* Copyright © 2017 The Galette Team
* Copyright © 2003-2024 The Galette Team
*
* This file is part of Galette (http://galette.tuxfamily.org).
* This file is part of Galette (https://galette.eu).
*
* ObjectsLend is free software: you can redistribute it and/or modify
* Galette is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ObjectsLend is distributed in the hope that it will be useful,
* Galette is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Galette. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugins
* @package ObjectsLend
*
* @author Mélissa Djebel <melissa.djebel@gmx.net>
* @author Johan Cwiklinski <johan@x-tnd.be>
* @copyright 2013-2016 Mélissa Djebel
* Copyright © 2017 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @version 0.7
* @link http://galette.tuxfamily.org
* @since Available since 0.7
*/

define('LEND_PREFIX', 'lend_');
25 changes: 4 additions & 21 deletions _define.php
Original file line number Diff line number Diff line change
@@ -1,47 +1,30 @@
<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
* Configuration file for ObjectsLend plugin
*
* PHP version 5
*
* Copyright © 2013-2016 Mélissa Djebel
* Copyright © 2017-2023 The Galette Team
* Copyright © 2003-2024 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
* ObjectsLend is free software: you can redistribute it and/or modify
* Galette is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ObjectsLend is distributed in the hope that it will be useful,
* Galette is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Galette. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugins
* @package ObjectsLend
*
* @author Mélissa Djebel <melissa.djebel@gmx.net>
* @author Johan Cwiklinski <johan@x-tnd.be>
* @copyright 2013-2016 Mélissa Djebel
* @copyright 2017-2023 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link https://galette.eu
*/

$this->register(
'Galette Objects Lend', //Name
'Manage rent/lend of object', //Short description
'Mélissa Djebel, Johan Cwiklinski', //Author
'2.0.0', //Version
'1.0.0', //Galette version compatibility
'1.1.0', //Galette version compatibility
'objectslend', //routing name and translation domain
'2023-12-07', //Date
[
Expand Down
20 changes: 2 additions & 18 deletions _routes.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
* ObjectsLend routes
*
* PHP version 5
*
* Copyright © 2017-2023 The Galette Team
* Copyright © 2003-2024 The Galette Team
*
* This file is part of Galette (http://galette.tuxfamily.org).
* This file is part of Galette (https://galette.eu).
*
* Galette is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -23,16 +17,6 @@
*
* You should have received a copy of the GNU General Public License
* along with Galette. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugins
* @package GaletteObjectsLend
*
* @author Johan Cwiklinski <johan@x-tnd.be>
* @copyright 2017-2023 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @version SVN: $Id$
* @link http://galette.tuxfamily.org
* @since 2017-11-19
*/

use Analog\Analog;
Expand Down
56 changes: 17 additions & 39 deletions lib/GaletteObjectsLend/Controllers/Crud/CategoriesController.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
* Categories controller
*
* PHP version 5
* Copyright © 2003-2024 The Galette Team
*
* Copyright © 2021-2023 The Galette Team
*
* This file is part of Galette (http://galette.tuxfamily.org).
* This file is part of Galette (https://galette.eu).
*
* Galette is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -23,15 +17,6 @@
*
* You should have received a copy of the GNU General Public License
* along with Galette. If not, see <http://www.gnu.org/licenses/>.
*
* @category Controllers
* @package GaletteObjectsLend
*
* @author Johan Cwiklinski <johan@x-tnd.be>
* @copyright 2021-2023 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link http://galette.tuxfamily.org
* @since 2021-05-09
*/

namespace GaletteObjectsLend\Controllers\Crud;
Expand All @@ -49,23 +34,16 @@
/**
* Categories controller
*
* @category Controllers
* @name CategoriesController
* @package GaletteObjectsLend
* @author Johan Cwiklinski <johan@x-tnd.be>
* @copyright 2021-2023 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link http://galette.tuxfamily.org
* @since 2021-05-09
* @author Johan Cwiklinski <johan@x-tnd.be>
*/

class CategoriesController extends AbstractPluginController
{
/**
* @var array
* @var array<string, mixed>
*/
#[Inject("Plugin Galette Objects Lend")]
protected $module_info;
protected array $module_info;

// CRUD - Create

Expand Down Expand Up @@ -101,14 +79,14 @@ public function doAdd(Request $request, Response $response): Response
/**
* List page
*
* @param Request $request PSR Request
* @param Response $response PSR Response
* @param string $option One of 'page' or 'order'
* @param string|integer $value Value of the option
* @param Request $request PSR Request
* @param Response $response PSR Response
* @param string|null $option One of 'page' or 'order'
* @param integer|string|null $value Value of the option
*
* @return Response
*/
public function list(Request $request, Response $response, $option = null, $value = null): Response
public function list(Request $request, Response $response, string $option = null, int|string $value = null): Response
{
if (isset($this->session->objectslend_filter_categories)) {
$filters = $this->session->objectslend_filter_categories;
Expand Down Expand Up @@ -212,7 +190,7 @@ public function filter(Request $request, Response $response): Response
*
* @return Response
*/
public function edit(Request $request, Response $response, int $id = null, $action = 'edit'): Response
public function edit(Request $request, Response $response, int $id = null, string $action = 'edit'): Response
{
if ($this->session->objectslend_category !== null) {

Check failure on line 195 in lib/GaletteObjectsLend/Controllers/Crud/CategoriesController.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 on ubuntu-latest

Access to an undefined property RKA\Session::$objectslend_category.

Check failure on line 195 in lib/GaletteObjectsLend/Controllers/Crud/CategoriesController.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 on ubuntu-latest

Access to an undefined property RKA\Session::$objectslend_category.
$category = $this->session->objectslend_category;
Expand Down Expand Up @@ -255,7 +233,7 @@ public function edit(Request $request, Response $response, int $id = null, $acti
*
* @return Response
*/
public function doEdit(Request $request, Response $response, int $id = null, $action = 'edit'): Response
public function doEdit(Request $request, Response $response, int $id = null, string $action = 'edit'): Response
{
$post = $request->getParsedBody();
$category = new LendCategory($this->zdb, $this->plugins, $id);
Expand Down Expand Up @@ -337,7 +315,7 @@ public function doEdit(Request $request, Response $response, int $id = null, $ac
/**
* Get redirection URI
*
* @param array $args Route arguments
* @param array<string,mixed> $args Route arguments
*
* @return string
*/
Expand All @@ -349,7 +327,7 @@ public function redirectUri(array $args): string
/**
* Get form URI
*
* @param array $args Route arguments
* @param array<string,mixed> $args Route arguments
*
* @return string
*/
Expand All @@ -364,7 +342,7 @@ public function formUri(array $args): string
/**
* Get confirmation removal page title
*
* @param array $args Route arguments
* @param array<string,mixed> $args Route arguments
*
* @return string
*/
Expand All @@ -380,8 +358,8 @@ public function confirmRemoveTitle(array $args): string
/**
* Remove object
*
* @param array $args Route arguments
* @param array $post POST values
* @param array<string,mixed> $args Route arguments
* @param array<string,mixed> $post POST values
*
* @return boolean
*/
Expand Down
Loading

0 comments on commit 0dea8a8

Please sign in to comment.