PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.27
Booktics – Appointment Booking Calendar for Service Businesses v1.0.27
1.0.29 1.0.28 1.0.27 1.0.26 1.0.25 1.0.24 1.0.23 1.0.22 1.0.21 1.0.20 1.0.19 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.2 1.0.3 All 31 releases
booktics / vendor / stripe / stripe-php / lib / SingletonApiResource.php

SingletonApiResource.php in Booktics – Appointment Booking Calendar for Service Businesses 1.0.27, at vendor/stripe/stripe-php/lib/SingletonApiResource.php

41 lines 959 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Stripe;
4
5 /**
6 * Class SingletonApiResource.
7 */
8 abstract class SingletonApiResource extends ApiResource
9 {
10 protected static function _singletonRetrieve($options = null)
11 {
12 $opts = Util\RequestOptions::parse($options);
13 $instance = new static(null, $opts);
14 $instance->refresh();
15
16 return $instance;
17 }
18
19 /**
20 * @return string the endpoint associated with this singleton class
21 */
22 public static function classUrl()
23 {
24 // Replace dots with slashes for namespaced resources, e.g. if the object's name is
25 // "foo.bar", then its URL will be "/v1/foo/bar".
26
27 /** @phpstan-ignore-next-line */
28 $base = \str_replace('.', '/', static::OBJECT_NAME);
29
30 return "/v1/{$base}";
31 }
32
33 /**
34 * @return string the endpoint associated with this singleton API resource
35 */
36 public function instanceUrl()
37 {
38 return static::classUrl();
39 }
40 }
41