Skip to content

Commit

Permalink
updaet doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelfolaron committed Aug 30, 2024
1 parent ec8d1d4 commit fc6a91f
Show file tree
Hide file tree
Showing 29 changed files with 699 additions and 169 deletions.
1 change: 0 additions & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions .phpdoc/template/api-md/index.api-md.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: {{project.name}}
{% include 'config/frontmatter.twig' %}
---

# {{ project.name|raw }}
# {{ project.name|raw }} jsonRPC method namespaces

For an introduction into connecting to the Leantime API please see [Api Usage](https://docs.leantime.io/#/api/usage)

Expand All @@ -14,12 +14,10 @@ RPC Methods are the primary endpoint definition and follow the structure

If `Module` and `Service` have the same name they can be summarized to `leantime.rpc`.`servicee`.`method`

## jsonRPC method namespaces

{% for namespace in project.indexes.namespaces|sort((a,b) => a.FullyQualifiedStructuralElementName <=> b.FullyQualifiedStructuralElementName) %}
{% if namespace.classes|length > 0%}

### `{{ namespace.FullyQualifiedStructuralElementName|replace({"\\": "."})|replace({".Leantime.Domain.": "leantime.rpc."})|replace({".Services": ""}) }}`
## `{{ namespace.FullyQualifiedStructuralElementName|replace({"\\": "."})|replace({".Leantime.Domain.": "leantime.rpc."})|replace({".Services": ""}) }}`

{% if namespace.classes|length > 0 %}

Expand Down
2 changes: 1 addition & 1 deletion .phpdoc/template/md/class.md.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ title: {{ node.FullyQualifiedStructuralElementName }}
{{ node.summary|raw }}

{{ node.description|raw }}
`{{ node.FullyQualifiedStructuralElementName }}`

* Full name: `{{ node.FullyQualifiedStructuralElementName }}`
{% if node.parent %}* Parent class: {{ macros.mdClassLink(node.parent, macros.mdClassPath(node), node.parent.FullyQualifiedStructuralElementName) }}
{% endif %}
{% if node.final %}* This class is marked as **final** and can't be subclassed
Expand Down
6 changes: 2 additions & 4 deletions .phpdoc/template/md/index.md.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ This is an automatically generated documentation for **{{project.name}}**.
[[_TOC_]]
{% endif %}

## Namespaces

{% for namespace in project.indexes.namespaces|sort((a,b) => a.FullyQualifiedStructuralElementName <=> b.FullyQualifiedStructuralElementName) %}
{% if namespace.classes|length > 0 or namespace.traits|length > 0 or namespace.interfaces|length > 0 %}

### {{ namespace.FullyQualifiedStructuralElementName }}
## {{ namespace.FullyQualifiedStructuralElementName }}

{% if namespace.classes|length > 0 %}
#### Classes
### Classes

| Class | Description |
|--- |--- |
Expand Down
14 changes: 14 additions & 0 deletions app/Domain/Api/Services/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class Api
/**
* @param ApiRepository $apiRepository
* @param UserRepository $userRepo
*
* @api
*/
public function __construct(ApiRepository $apiRepository, UserRepository $userRepo)
{
Expand All @@ -35,6 +37,8 @@ public function __construct(ApiRepository $apiRepository, UserRepository $userRe
* @param string $apiKey
*
* @return bool|array
*
* @api
*/
public function getAPIKeyUser(string $apiKey): bool|array
{
Expand Down Expand Up @@ -80,6 +84,8 @@ public function getAPIKeyUser(string $apiKey): bool|array
* @return bool|array returns new user id on success, false on failure
* @throws Exception
*
* @api
*/
public function createAPIKey(array $values): bool|array
{
Expand All @@ -104,6 +110,8 @@ public function createAPIKey(array $values): bool|array
* @access public
*
* @return array|false
*
* @api
*/
public function getAPIKeys(): false|array
{
Expand Down Expand Up @@ -132,6 +140,8 @@ public function getAPIKeys(): false|array
* @return string
*
* @throws Exception
*
* @api
*/
public function randomStr(
int $length = 64,
Expand Down Expand Up @@ -159,6 +169,8 @@ public function randomStr(
* @todo Remove this.
*
* @see ../Controllers/Tickets.php
*
* @api
*/
public function jsonResponse(int $id, ?array $result): void
{
Expand All @@ -183,6 +195,8 @@ public function jsonResponse(int $id, ?array $result): void
* @param string $filepath
*
* @return string|false
*
* @api
*/
public function getCaseCorrectPathFromManifest(string $filepath): string|false
{
Expand Down
23 changes: 23 additions & 0 deletions app/Domain/Calendar/Services/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Calendar
/**
* @param CalendarRepository $calendarRepo
* @param LanguageCore $language
*
*/
public function __construct(CalendarRepository $calendarRepo, LanguageCore $language)
{
Expand All @@ -38,6 +39,8 @@ public function __construct(CalendarRepository $calendarRepo, LanguageCore $lang
* @param int $id The ID of the Google Calendar to delete.
*
* @return bool Returns true if the Google Calendar was successfully deleted, false otherwise.
*
* @api
*/
public function deleteGCal(int $id): bool
{
Expand All @@ -53,6 +56,8 @@ public function deleteGCal(int $id): bool
* @params $params key value array of columns to be updated
*
* @return bool true on success, false on failure
*
* @api
*/
public function patch($id, $params): bool
{
Expand All @@ -73,6 +78,8 @@ public function patch($id, $params): bool
* @params int $eventId Id of event to be checked
*
* @return bool true on success, false on failure
*
* @api
*/
private function userIsAllowedToUpdate($eventId): bool
{
Expand All @@ -98,6 +105,8 @@ private function userIsAllowedToUpdate($eventId): bool
* @params array $values array of event values
*
* @return int|false returns the id on success, false on failure
*
* @api
*/
public function addEvent(array $values): int|false
{
Expand Down Expand Up @@ -128,6 +137,8 @@ public function addEvent(array $values): int|false
* @param int $eventId
*
* @return mixed
*
* @api
*/
public function getEvent(int $eventId): mixed
{
Expand All @@ -143,6 +154,8 @@ public function getEvent(int $eventId): mixed
* @params array $values array of event values
*
* @return bool returns true on success, false on failure
*
* @api
*/
public function editEvent(array $values): bool
{
Expand Down Expand Up @@ -193,6 +206,8 @@ public function editEvent(array $values): bool
* @param int $id
*
* @return int|false returns the id on success, false on failure
*
* @api
*/
public function delEvent(int $id): int|false
{
Expand All @@ -204,6 +219,8 @@ public function delEvent(int $id): int|false
* @param int $userId
*
* @return array|false
*
* @api
*/
public function getExternalCalendar(int $id, int $userId): bool|array
{
Expand All @@ -215,6 +232,8 @@ public function getExternalCalendar(int $id, int $userId): bool|array
* @param int $id
*
* @return void
*
* @api
*/
public function editExternalCalendar(array $values, int $id): void
{
Expand All @@ -230,6 +249,8 @@ public function editExternalCalendar(array $values, int $id): void
* @return IcalCalendar The iCal calendar generated from the calendar events.
* @throws MissingParameterException If either user hash or calendar hash is empty.
*
*
* @api
*/
public function getIcalByHash(string $userHash, string $calHash): IcalCalendar
{
Expand Down Expand Up @@ -406,6 +427,8 @@ public function getCalendar(int $userId): array
* @param int|null $dateTo
*
* @return array
*
* @api
*/
private function mapEventData(
string $title,
Expand Down
14 changes: 11 additions & 3 deletions app/Domain/Canvas/Services/Canvas.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

/**
*
*
* @api
*/
class Canvas
{
Expand All @@ -23,7 +25,9 @@ class Canvas
* @param int $authorId
* @return bool|int False if import failed and the id of the newly created canvas otherwise
* @throws BindingResolutionException
*/
*
* @api
*/
public function import(string $filename, string $canvasName, int $projectId, int $authorId): bool|int
{

Expand Down Expand Up @@ -193,7 +197,9 @@ public function import(string $filename, string $canvasName, int $projectId, int
* @param array $boards Array of project board types
* @return array List of boards with a progress percentage
* @throws BindingResolutionException
*/
*
* @api
*/
public function getBoardProgress(string $projectId = '', array $boards = array()): array
{

Expand Down Expand Up @@ -267,7 +273,9 @@ public function getBoardProgress(string $projectId = '', array $boards = array()
* @param array $boards Array of project board types
* @return array List of boards with a progress percentage
* @throws BindingResolutionException
*/
*
* @api
*/
public function getLastUpdatedCanvas(string $projectId = '', array $boards = array()): array
{
$canvasRepo = app()->make(\Leantime\Domain\Canvas\Repositories\Canvas::class);
Expand Down
15 changes: 15 additions & 0 deletions app/Domain/Clients/Services/Clients.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Clients
* @param TemplateCore $tpl
* @param ProjectRepository $projectRepository
* @param ClientRepository $clientRepository
*
*/
public function __construct(
ProjectRepository $projectRepository,
Expand All @@ -30,6 +31,8 @@ public function __construct(
/**
* @param int $userId
* @return array
*
* @api
*/
public function getUserClients(int $userId): array
{
Expand All @@ -50,6 +53,8 @@ public function getUserClients(int $userId): array

/**
* @return array
*
* @api
*/
public function getAll(array $searchparams = null): array
{
Expand All @@ -64,6 +69,8 @@ public function getAll(array $searchparams = null): array
* @access public
*
* @return bool returns true on success, false on failure
*
* @api
*/
public function patch(int $id, array $params): bool
{
Expand All @@ -77,6 +84,8 @@ public function patch(int $id, array $params): bool
* @access public
*
* @return bool Returns true on success, false on failure
*
* @api
*/
public function editClient(object|array $values): bool
{
Expand All @@ -89,6 +98,8 @@ public function editClient(object|array $values): bool
* @access public
* @param object|array $values Object or array to be created
* @return int|false Returns id of new element or false
*
* @api
*/
public function create(object|array $values): int|false
{
Expand All @@ -101,6 +112,8 @@ public function create(object|array $values): int|false
* @access public
* @param int $id Id of the object to be deleted
* @return bool Returns id of new element or false
*
* @api
*/
public function delete(int $id): bool
{
Expand All @@ -113,6 +126,8 @@ public function delete(int $id): bool
* @access public
* @param int $id Id of the object to be retrieved
* @return object|array|false Returns object or array. False on failure or if item cannot be found
*
* @api
*/
public function get(int $id): object|array|false
{
Expand Down
Loading

0 comments on commit fc6a91f

Please sign in to comment.