Skip to content

Commit d7b02ac

Browse files
committed
Add PHPDocs
1 parent 61308e9 commit d7b02ac

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/SearchEngines.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ class SearchEngines
4444
/**
4545
* Instantiate the class and allows you to define the current search engine.
4646
*
47-
* @param string|null $current
47+
* @param string|null $current Set the current search engine name or null to
48+
* use the default
4849
*/
4950
public function __construct(?string $current = null)
5051
{
@@ -78,7 +79,8 @@ public function getAll() : array
7879
*
7980
* @since 4.5
8081
*
81-
* @return array<string,string>
82+
* @return array<string,string> search engine names as keys and URLs as
83+
* values
8284
*/
8385
public function getEngines() : array
8486
{
@@ -109,8 +111,8 @@ public function add(string $name, string $url) : static
109111
*
110112
* @since 4.5
111113
*
112-
* @param string $name
113-
* @param string $url
114+
* @param string $name The search engine name
115+
* @param string $url The search engine base URL
114116
*
115117
* @return static
116118
*/
@@ -126,9 +128,9 @@ public function setEngine(string $name, string $url) : static
126128
/**
127129
* Returns the base URL of an engine; throws exception if it does not exist.
128130
*
129-
* @param string $name
131+
* @param string $name The search engine name
130132
*
131-
* @return string
133+
* @return string The search engine base URL
132134
*/
133135
public function getUrl(string $name) : string
134136
{
@@ -141,7 +143,7 @@ public function getUrl(string $name) : string
141143
/**
142144
* Sets the current search engine; validates existence.
143145
*
144-
* @param string $name
146+
* @param string $name The search engine name
145147
*
146148
* @return static
147149
*/
@@ -165,7 +167,7 @@ public function getCurrent() : string
165167
}
166168

167169
/**
168-
* Returns the URL of the current engine.
170+
* Returns the base URL of the current engine.
169171
*
170172
* @return string
171173
*/
@@ -177,10 +179,10 @@ public function getCurrentUrl() : string
177179
/**
178180
* Generates a search link with the given query, using the current engine or a specific name.
179181
*
180-
* @param string $query
181-
* @param string|null $name
182+
* @param string $query A string to be URL-encoded
183+
* @param string|null $name the search engine name or null to use the current
182184
*
183-
* @return string
185+
* @return string Returns the link to search for the exception
184186
*/
185187
public function makeLink(string $query, ?string $name = null) : string
186188
{

0 commit comments

Comments
 (0)