diff --git a/src/KBDocumentation.php b/src/KBDocumentation.php index 958f1ad1..e955ab7b 100644 --- a/src/KBDocumentation.php +++ b/src/KBDocumentation.php @@ -60,7 +60,7 @@ public function getAnchor(): ?string * Used for json_encode function * This can seem useless, do not remove it. * - * @return array + * @return array */ public function jsonSerialize(): array { diff --git a/src/KBEntry.php b/src/KBEntry.php index 7ff7e9cd..e9ca610a 100644 --- a/src/KBEntry.php +++ b/src/KBEntry.php @@ -130,7 +130,7 @@ public function addDocumentation(string $url, ?string $anchor = null ): KBDocume * Used for json_encode function * This can seem useless, do not remove it. * - * @return array + * @return array|bool|string>> */ public function jsonSerialize(): array { diff --git a/src/Search.php b/src/Search.php index 12f8ded5..2deb4573 100644 --- a/src/Search.php +++ b/src/Search.php @@ -21,11 +21,17 @@ class Search */ public static $loaded = false; - public const ANY = -1; - public const MYSQL = 1; - public const MARIADB = 2; - public const DS = DIRECTORY_SEPARATOR; - public static $DATA_DIR = __DIR__.self::DS."..".self::DS."dist".self::DS; + public const ANY = -1; + public const MYSQL = 1; + public const MARIADB = 2; + public const DS = DIRECTORY_SEPARATOR; + + /** + * The directory where the data is located + * + * @var string + */ + public static $DATA_DIR = __DIR__ . self::DS . ".." . self::DS . "dist" . self::DS; /** * Load data from disk @@ -127,7 +133,7 @@ public static function getVariableType(string $name): string /** * Return the list of static variables * - * @return array + * @return array */ public static function getStaticVariables(): array { @@ -137,7 +143,7 @@ public static function getStaticVariables(): array /** * Return the list of dynamic variables * - * @return array + * @return array */ public static function getDynamicVariables(): array { @@ -148,7 +154,7 @@ public static function getDynamicVariables(): array * Return the list of variables having dynamic = $dynamic * * @param bool $dynamic dynamic=true/dynamic=false - * @return array + * @return array */ public static function getVariablesWithDynamic(bool $dynamic): array { diff --git a/src/SlimData.php b/src/SlimData.php index 040530f9..07f8ba27 100644 --- a/src/SlimData.php +++ b/src/SlimData.php @@ -32,14 +32,14 @@ class SlimData extends stdClass implements JsonSerializable /** * Types of documentation * - * @var array + * @var array */ private $types = array("MYSQL" => 1, "MARIADB" => 2); /** * Types of variables * - * @var array + * @var array */ private $varTypes = array( "string" => 1, @@ -56,9 +56,9 @@ class SlimData extends stdClass implements JsonSerializable /** * Create a slimData object * - * @param float|null $version The version - * @param array|null $types The types of documentations - * @param array|null $varTypes The types of variables + * @param float|null $version The version + * @param array|null $types The types of documentations + * @param array|null $varTypes The types of variables */ public function __construct( ?float $version = null, @@ -97,7 +97,7 @@ public function addVariable(string $name, ?string $type, ?bool $dynamic): KBEntr * Used for json_encode function * This can seem useless, do not remove it. * - * @return array + * @return array */ public function jsonSerialize(): array { @@ -113,7 +113,7 @@ public function jsonSerialize(): array if ($var->getType() !== null) { if (isset($this->varTypes[$var->getType()]) === false) { - $this->varTypes[$var->getType()] = "".(count($this->varTypes) + 1); + $this->varTypes[$var->getType()] = count($this->varTypes) + 1; } $variable->t = $this->varTypes[$var->getType()];