• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-php / 11129599820

01 Oct 2024 04:33PM UTC coverage: 62.613% (-1.3%) from 63.944%
11129599820

push

github

web-flow
Support for APIs in the new API version 2024-09-30.acacia (#1756)

175 of 409 new or added lines in 26 files covered. (42.79%)

3 existing lines in 3 files now uncovered.

3547 of 5665 relevant lines covered (62.61%)

2.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/Service/ServiceNavigatorTrait.php
1
<?php
2

3
namespace Stripe\Service;
4

5
/**
6
 * Trait for service factories or auxiliary services
7
 * that have to navigate to other services.
8
 */
9
trait ServiceNavigatorTrait
10
{
11
    /** @var array<string, AbstractService|AbstractServiceFactory> */
12
    protected $services = [];
13

14
    /** @var \Stripe\StripeClientInterface */
15
    protected $client;
16

NEW
17
    protected function getServiceClass($name)
×
18
    {
NEW
19
        \trigger_error('Undefined property: ' . static::class . '::$' . $name);
×
20
    }
21

NEW
22
    public function __get($name)
×
23
    {
NEW
24
        $serviceClass = $this->getServiceClass($name);
×
NEW
25
        if (null !== $serviceClass) {
×
NEW
26
            if (!\array_key_exists($name, $this->services)) {
×
NEW
27
                $this->services[$name] = new $serviceClass($this->client);
×
28
            }
29

NEW
30
            return $this->services[$name];
×
31
        }
32

NEW
33
        \trigger_error('Undefined property: ' . static::class . '::$' . $name);
×
34

NEW
35
        return null;
×
36
    }
37

38
    /**
39
     * @param string $name
40
     *
41
     * @return null|AbstractService|AbstractServiceFactory
42
     */
NEW
43
    public function getService($name)
×
44
    {
NEW
45
        $serviceClass = $this->getServiceClass($name);
×
NEW
46
        if (null !== $serviceClass) {
×
NEW
47
            if (!\array_key_exists($name, $this->services)) {
×
NEW
48
                $this->services[$name] = new $serviceClass($this->client);
×
49
            }
50

NEW
51
            return $this->services[$name];
×
52
        }
53

NEW
54
        \trigger_error('Undefined property: ' . static::class . '::$' . $name);
×
55

NEW
56
        return null;
×
57
    }
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc