PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.7.0.11
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.7.0.11
1.8.13.1 1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 All 212 releases
charitable / vendor / stripe / stripe-php / lib / SingletonApiResource.php

SingletonApiResource.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.7.0.11, 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