Skip to content

Commit

Permalink
fixing lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ridz1208 committed Dec 2, 2024
1 parent d3d499c commit 8aa0218
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 29 deletions.
Binary file removed modules/biobank/php/.endpoint.class.inc.swp
Binary file not shown.
6 changes: 2 additions & 4 deletions modules/biobank/php/endpoint.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,9 @@ abstract class Endpoint
$pathparts = explode('/', $path);

// Check if sub-handlers are supported
// TODO: This can later be replaced with a check for the subhandler interface
// implementation rather than just checking if the function exists.
if ($this instanceof SubHandlerInterface && count($pathparts) > 1) {
if ($this instanceof HasSubEndpoints && count($pathparts) > 1) {
$subpath = $pathparts[1];
$subhandler = $this->getSubHandler($subpath);
$subhandler = $this->getSubEndpoint($subpath);

// Remove the handled part of the path and pass the remainder
$remainingPath = implode('/', array_slice($pathparts, 1));
Expand Down
25 changes: 25 additions & 0 deletions modules/biobank/php/hassubendpoints.class.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php declare(strict_types=1);

namespace LORIS\biobank;

/**
* HasSubEndpoints interface to be implemented by endpoints that needs to route to a
* sub-endpoint.
*
* @package LORIS
* @subpackage Biobank
* @author Henri Rabalais <[email protected]>
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public
* License
*/
interface HasSubEndpoints
{
/**
* Returns a sub-endpoint for a given subpath
*
* @param string $subpath The subpath to check for a sub-endpoint.
*
* @return Endpoint The sub-endpoint for the subpath
*/
public function getSubEndpoint(string $subpath): Endpoint;
}
25 changes: 0 additions & 25 deletions modules/biobank/php/subhandler.class.inc

This file was deleted.

0 comments on commit 8aa0218

Please sign in to comment.