Skip to content

Commit 00eeb17

Browse files
authored
Updated API documentation (#1082)
1 parent b3a3024 commit 00eeb17

3 files changed

Lines changed: 36 additions & 7 deletions

File tree

API.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ public function getContainerTags($idSite, $idContainer, $idContainerVersion)
409409
*
410410
* Note: If the current site already has a default container, another default container will be created.
411411
*
412-
* @param int $idSite
412+
* @param int $idSite The id of the site that the container will be created for
413413
* @return string The ID of the created container.
414414
*/
415415
public function createDefaultContainerForSite($idSite)
@@ -500,6 +500,7 @@ public function createDefaultContainerForSite($idSite)
500500
* @param null|string $startDate Optional, a start date to ensure the tag will be only executed after this date. Please provide the date in UTC.
501501
* @param null|string $endDate Optional, an end date to ensure the tag will not be executed after this date. Please provide the date in UTC.
502502
* @param null|string $description Optional description
503+
* @param string $status Optional status to set when creating the tag.
503504
*
504505
* @return int The ID of the created tag.
505506
*/
@@ -743,7 +744,7 @@ public function getContainerTriggers($idSite, $idContainer, $idContainerVersion)
743744
* @param int $idContainerVersion The ID of the container version, a container may have multiple versions and
744745
* the list of triggers will be different per container. Therefore you need to provide
745746
* the ID of the version you are referring to.
746-
* @param int $type The type of trigger you want create, for example "AllElements".
747+
* @param string $type The type of trigger you want create, for example "AllElements".
747748
* @param string $name The name this trigger should have
748749
* @param array $parameters A key/value pair to define values for specific parameters. For example array('parameterName' => 'value')
749750
* @param array[] $conditions An array containing one or multiple conditions to filter when a trigger will be triggered. For example:
@@ -786,6 +787,7 @@ public function addContainerTrigger($idSite, $idContainer, $idContainerVersion,
786787
* array(array('actual' => 'VARIABLENAME', 'comparison' => 'equals', 'expected' => 'expectedValue'))
787788
* To get a list of available comparisons, call {@link TagManager.getAvailableComparisons}
788789
* @param null|string $description Optional description
790+
* @return null
789791
*/
790792
public function updateContainerTrigger($idSite, $idContainer, $idContainerVersion, $idTrigger, $name, $parameters = [], $conditions = [], $description = '')
791793
{
@@ -815,6 +817,7 @@ public function updateContainerTrigger($idSite, $idContainer, $idContainerVersio
815817
* the list of trigger will be different per container. Therefore you need to provide
816818
* the ID of the version you are referring to.
817819
* @param int $idTrigger The id of the trigger you want to delete.
820+
* @return void
818821
*/
819822
public function deleteContainerTrigger($idSite, $idContainer, $idContainerVersion, $idTrigger)
820823
{
@@ -953,7 +956,7 @@ public function getAvailableContainerVariables($idSite, $idContainer, $idContain
953956
* @param string $type The type of variable you want to create.
954957
* @param string $name The name this variable should have
955958
* @param array $parameters A key/value pair to define values for specific parameters. For example array('parameterName' => 'value')
956-
* @param null|string $defaultValue Optionally a default value
959+
* @param false|null|string $defaultValue Optionally a default value.
957960
* @param array[] $lookupTable An array containing one or multiple lookup configurations. For example:
958961
* array(array('match_value' => 'inval', 'comparison' => 'equals', 'out_value' => 'outval'))
959962
* For a list of available comparisons see {@link TagManager.getAvailableComparisons}
@@ -1012,6 +1015,7 @@ private function forceDeleteVariable($idSite, $idContainerVersion, $idVariable)
10121015
* array(array('match_value' => 'inval', 'comparison' => 'equals', 'out_value' => 'outval'))
10131016
* For a list of available comparisons see {@link TagManager.getAvailableComparisons}
10141017
* @param null|string $description Optional description
1018+
* @return null
10151019
*/
10161020
public function updateContainerVariable($idSite, $idContainer, $idContainerVersion, $idVariable, $name, $parameters = [], $defaultValue = null, $lookupTable = [], $description = '')
10171021
{
@@ -1059,6 +1063,7 @@ public function updateContainerVariable($idSite, $idContainer, $idContainerVersi
10591063
* the list of variable will be different per container. Therefore you need to provide
10601064
* the ID of the version you are referring to.
10611065
* @param int $idVariable The id of the variable you want to delete.
1066+
* @return void
10621067
*/
10631068
public function deleteContainerVariable($idSite, $idContainer, $idContainerVersion, $idVariable)
10641069
{
@@ -1158,8 +1163,8 @@ public function updateContainer($idSite, $idContainer, $name, $description = '',
11581163
* @param string $idContainer The id of a container, for example "6OMh6taM"
11591164
* @param string $name The name this version should have
11601165
* @param string $description Optionally the description this version should have
1161-
* @param null $idContainerVersion By default a new version based on the current draft version will be created. However,
1162-
* You can also create a new version from a previously created version.
1166+
* @param int|null $idContainerVersion By default, a new version based on the current draft version will be created.
1167+
* You can also create a new version from a previously created version.
11631168
* @return int The ID of the created version.
11641169
*/
11651170
public function createContainerVersion($idSite, $idContainer, $name, $description = '', $idContainerVersion = null)
@@ -1387,7 +1392,6 @@ public function disablePreviewMode($idSite, $idContainer)
13871392
* Updates the debug siteurl cookie
13881393
*
13891394
* @param int $idSite The id of the site the given container belongs to
1390-
* @param string $idContainer The id of a container, for example "6OMh6taM"
13911395
* @param string $url The url to enable debug
13921396
*/
13931397
public function changeDebugUrl($idSite, $url)
@@ -1447,7 +1451,7 @@ public function exportContainerVersion($idSite, $idContainer, $idContainerVersio
14471451
* @param string $idContainer The id of a container, for example "6OMh6taM"
14481452
* @param string $backupName If specified, a backup of the current draft will be created under this version name.
14491453
* @param bool $_isDraftRestoreCall A boolean parameter to specify, if its a backup restore call to avoid nesting exception if backup version has errors
1450-
* @return array
1454+
* @return void
14511455
*/
14521456
public function importContainerVersion($exportedContainerVersion, $idSite, $idContainer, $backupName = '', bool $_isDraftRestoreCall = false)
14531457
{

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Changelog
22

3+
0.2.7 - 02/03/2026
4+
5+
* Updated API documentation
6+
37
0.2.6
48

59
* Fix changing name of variable causes removing trigger in a tag

phpstan.neon

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
parameters:
2+
level: 1
3+
phpVersion: 70200
4+
tmpDir: /tmp/phpstan/TagManager/main
5+
paths:
6+
- .
7+
excludePaths:
8+
- tests/*
9+
- vendor/
10+
- github-action-tests/
11+
bootstrapFiles:
12+
- ../../bootstrap-phpstan.php
13+
universalObjectCratesClasses:
14+
- Piwik\Config
15+
- Piwik\View
16+
- Piwik\ViewDataTable\Config
17+
scanDirectories:
18+
# ../../ does not actually seem to give us anything
19+
# that ../plugins/ does not, but including it for
20+
# completeness. It does not seem to slow down performance.
21+
- ../../

0 commit comments

Comments
 (0)