1818/**
1919 * Simple PHP Redmine client.
2020 *
21+ * @deprecated `Redmine\Client` is deprecated, use `Redmine\Client\NativeCurlClient` or `Redmine\Client\Psr18Client` instead
22+ *
2123 * @author Kevin Saliou <kevin at saliou dot name>
2224 * Website: http://github.com/kbsali/php-redmine-api
2325 *
@@ -119,7 +121,7 @@ public function __construct($url, $apikeyOrUsername, $pass = null)
119121 */
120122 public function __get ($ name )
121123 {
122- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use getApi() instead. ' , E_USER_DEPRECATED );
124+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use getApi() instead. ' , E_USER_DEPRECATED );
123125
124126 return $ this ->getApi (strval ($ name ));
125127 }
@@ -135,7 +137,7 @@ public function __get($name)
135137 */
136138 public function api ($ name )
137139 {
138- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use getApi() instead. ' , E_USER_DEPRECATED );
140+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use getApi() instead. ' , E_USER_DEPRECATED );
139141
140142 return $ this ->getApi (strval ($ name ));
141143 }
@@ -149,7 +151,7 @@ public function api($name)
149151 */
150152 public function getUrl ()
151153 {
152- @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
154+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
153155
154156 return $ this ->url ;
155157 }
@@ -230,7 +232,7 @@ public function getLastResponseBody(): string
230232 */
231233 public function get ($ path , $ decode = true )
232234 {
233- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use requestGet() instead. ' , E_USER_DEPRECATED );
235+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use requestGet() instead. ' , E_USER_DEPRECATED );
234236
235237 if (false === $ json = $ this ->runRequest ($ path , 'GET ' )) {
236238 return false ;
@@ -257,7 +259,7 @@ public function get($path, $decode = true)
257259 */
258260 public function decode ($ json )
259261 {
260- @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
262+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
261263
262264 if (empty ($ json )) {
263265 return '' ;
@@ -285,7 +287,7 @@ public function decode($json)
285287 */
286288 public function post ($ path , $ data )
287289 {
288- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use requestPost() instead. ' , E_USER_DEPRECATED );
290+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use requestPost() instead. ' , E_USER_DEPRECATED );
289291
290292 return $ this ->runRequest ($ path , 'POST ' , $ data );
291293 }
@@ -302,7 +304,7 @@ public function post($path, $data)
302304 */
303305 public function put ($ path , $ data )
304306 {
305- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use requestPut() instead. ' , E_USER_DEPRECATED );
307+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use requestPut() instead. ' , E_USER_DEPRECATED );
306308
307309 return $ this ->runRequest ($ path , 'PUT ' , $ data );
308310 }
@@ -318,7 +320,7 @@ public function put($path, $data)
318320 */
319321 public function delete ($ path )
320322 {
321- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use requestDelete() instead. ' , E_USER_DEPRECATED );
323+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use requestDelete() instead. ' , E_USER_DEPRECATED );
322324
323325 return $ this ->runRequest ($ path , 'DELETE ' );
324326 }
@@ -334,7 +336,7 @@ public function delete($path)
334336 */
335337 public function setCheckSslCertificate ($ check = false )
336338 {
337- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use setCurlOption() instead. ' , E_USER_DEPRECATED );
339+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use setCurlOption() instead. ' , E_USER_DEPRECATED );
338340
339341 $ this ->checkSslCertificate = $ check ;
340342
@@ -350,7 +352,7 @@ public function setCheckSslCertificate($check = false)
350352 */
351353 public function getCheckSslCertificate ()
352354 {
353- @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
355+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
354356
355357 return $ this ->checkSslCertificate ;
356358 }
@@ -366,7 +368,7 @@ public function getCheckSslCertificate()
366368 */
367369 public function setCheckSslHost ($ check = false )
368370 {
369- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use setCurlOption() instead. ' , E_USER_DEPRECATED );
371+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use setCurlOption() instead. ' , E_USER_DEPRECATED );
370372
371373 $ this ->checkSslHost = (bool ) $ check ;
372374
@@ -382,7 +384,7 @@ public function setCheckSslHost($check = false)
382384 */
383385 public function getCheckSslHost ()
384386 {
385- @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
387+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
386388
387389 return $ this ->checkSslHost ;
388390 }
@@ -399,7 +401,7 @@ public function getCheckSslHost()
399401 */
400402 public function setSslVersion ($ sslVersion = 0 )
401403 {
402- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use setCurlOption() instead. ' , E_USER_DEPRECATED );
404+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use setCurlOption() instead. ' , E_USER_DEPRECATED );
403405
404406 $ this ->sslVersion = $ sslVersion ;
405407
@@ -415,7 +417,7 @@ public function setSslVersion($sslVersion = 0)
415417 */
416418 public function getSslVersion ()
417419 {
418- @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
420+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
419421
420422 return $ this ->sslVersion ;
421423 }
@@ -431,7 +433,7 @@ public function getSslVersion()
431433 */
432434 public function setUseHttpAuth ($ use = true )
433435 {
434- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use setCurlOption() instead. ' , E_USER_DEPRECATED );
436+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use setCurlOption() instead. ' , E_USER_DEPRECATED );
435437
436438 $ this ->useHttpAuth = $ use ;
437439
@@ -447,7 +449,7 @@ public function setUseHttpAuth($use = true)
447449 */
448450 public function getUseHttpAuth ()
449451 {
450- @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
452+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
451453
452454 return $ this ->useHttpAuth ;
453455 }
@@ -463,7 +465,7 @@ public function getUseHttpAuth()
463465 */
464466 public function setPort ($ port = null )
465467 {
466- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use setCurlOption() instead. ' , E_USER_DEPRECATED );
468+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use setCurlOption() instead. ' , E_USER_DEPRECATED );
467469
468470 if (null !== $ port ) {
469471 $ this ->port = (int ) $ port ;
@@ -481,7 +483,7 @@ public function setPort($port = null)
481483 */
482484 public function getResponseCode ()
483485 {
484- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use getLastResponseStatusCode() instead. ' , E_USER_DEPRECATED );
486+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use getLastResponseStatusCode() instead. ' , E_USER_DEPRECATED );
485487
486488 return (int ) $ this ->getLastResponseStatusCode ();
487489 }
@@ -497,7 +499,7 @@ public function getResponseCode()
497499 */
498500 public function getPort ()
499501 {
500- @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
502+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
501503
502504 if (null !== $ this ->port ) {
503505 return $ this ->port ;
@@ -543,11 +545,11 @@ public function stopImpersonateUser(): void
543545 public function setImpersonateUser ($ username = null )
544546 {
545547 if (null === $ username ) {
546- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use stopImpersonateUser() instead. ' , E_USER_DEPRECATED );
548+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use stopImpersonateUser() instead. ' , E_USER_DEPRECATED );
547549
548550 $ this ->stopImpersonateUser ();
549551 } else {
550- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use startImpersonateUser() instead. ' , E_USER_DEPRECATED );
552+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use startImpersonateUser() instead. ' , E_USER_DEPRECATED );
551553
552554 $ this ->startImpersonateUser ($ username );
553555 }
@@ -564,7 +566,7 @@ public function setImpersonateUser($username = null)
564566 */
565567 public function getImpersonateUser ()
566568 {
567- @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
569+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
568570
569571 return $ this ->impersonateUser ;
570572 }
@@ -578,7 +580,7 @@ public function getImpersonateUser()
578580 */
579581 public function setCustomHost ($ customHost = null )
580582 {
581- @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use setCurlOption() instead. ' , E_USER_DEPRECATED );
583+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated, use setCurlOption() instead. ' , E_USER_DEPRECATED );
582584
583585 $ this ->customHost = $ customHost ;
584586
@@ -592,7 +594,7 @@ public function setCustomHost($customHost = null)
592594 */
593595 public function getCustomHost ()
594596 {
595- @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
597+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
596598
597599 return $ this ->customHost ;
598600 }
@@ -635,7 +637,7 @@ public function unsetCurlOption($option)
635637 */
636638 public function getCurlOptions ()
637639 {
638- @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
640+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
639641
640642 return $ this ->curlOptions ;
641643 }
@@ -653,7 +655,7 @@ public function getCurlOptions()
653655 */
654656 public function prepareRequest ($ path , $ method = 'GET ' , $ data = '' )
655657 {
656- @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
658+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
657659
658660 $ this ->responseCode = 0 ;
659661 $ this ->responseContentType = '' ;
@@ -786,7 +788,7 @@ private function setHttpHeader($path)
786788 */
787789 public function processCurlResponse ($ response , $ contentType )
788790 {
789- @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
791+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
790792
791793 if ($ response ) {
792794 // if response is XML, return an SimpleXMLElement object
@@ -815,7 +817,7 @@ public function processCurlResponse($response, $contentType)
815817 */
816818 protected function runRequest ($ path , $ method = 'GET ' , $ data = '' )
817819 {
818- @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
820+ @trigger_error ('The ' . __METHOD__ . ' method is deprecated. You should stop using it, as it will be removed in the future. ' , E_USER_DEPRECATED );
819821
820822 $ curl = $ this ->prepareRequest ($ path , $ method , $ data );
821823
0 commit comments