This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Basis\Provider; |
||
4 | |||
5 | use Basis\Config; |
||
6 | use Basis\Filesystem; |
||
7 | use Basis\Service; |
||
8 | use Exception; |
||
9 | use League\Container\ServiceProvider\AbstractServiceProvider; |
||
10 | use Tarantool\Client\Client; |
||
11 | use Tarantool\Mapper\Bootstrap; |
||
12 | use Tarantool\Mapper\Entity; |
||
13 | use Tarantool\Mapper\Mapper; |
||
14 | use Tarantool\Mapper\Plugin; |
||
15 | use Tarantool\Mapper\Plugin\Annotation; |
||
16 | use Tarantool\Mapper\Plugin\Sequence; |
||
17 | use Tarantool\Mapper\Plugin\Spy; |
||
18 | use Tarantool\Mapper\Plugin\Temporal; |
||
19 | use Tarantool\Mapper\Schema; |
||
20 | |||
21 | class TarantoolProvider extends AbstractServiceProvider |
||
22 | { |
||
23 | protected $provides = [ |
||
24 | Bootstrap::class, |
||
25 | Client::class, |
||
26 | Mapper::class, |
||
27 | Schema::class, |
||
28 | Spy::class, |
||
29 | Temporal::class, |
||
30 | ]; |
||
31 | |||
32 | 56 | public function register() |
|
33 | { |
||
34 | $this->container->share(Bootstrap::class, function () { |
||
0 ignored issues
–
show
|
|||
35 | 56 | return $this->container->get(Mapper::class)->getBootstrap(); |
|
36 | 56 | }); |
|
37 | |||
38 | $this->getContainer()->share(Client::class, function () { |
||
0 ignored issues
–
show
It seems like you code against a concrete implementation and not the interface
Psr\Container\ContainerInterface as the method share() does only exist in the following implementations of said interface: Basis\Application , Basis\Test\Application , League\Container\Container .
Let’s take a look at an example: interface User
{
/** @return string */
public function getPassword();
}
class MyUser implements User
{
public function getPassword()
{
// return something
}
public function getDisplayName()
{
// return some name.
}
}
class AuthSystem
{
public function authenticate(User $user)
{
$this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
// do something.
}
}
In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different implementation of User which does not have a getDisplayName() method, the code will break. Available Fixes
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types
inside the if block in such a case.
![]() |
|||
39 | 56 | $config = $this->getContainer()->get(Config::class); |
|
40 | $params = [ |
||
41 | 56 | 'uri' => $config['tarantool.connection'], |
|
42 | 'persistent' => false, |
||
43 | 56 | ]; |
|
44 | $client = Client::fromOptions(array_merge($config['tarantool.params'], $params)); |
||
45 | 56 | try { |
|
46 | $client->evaluate("box.session.su('admin')"); |
||
47 | } catch (Exception $e) { |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
|
|||
48 | 56 | } |
|
49 | 56 | return $client; |
|
50 | }); |
||
51 | |||
52 | 56 | $this->getContainer()->share(Mapper::class, function () { |
|
0 ignored issues
–
show
It seems like you code against a concrete implementation and not the interface
Psr\Container\ContainerInterface as the method share() does only exist in the following implementations of said interface: Basis\Application , Basis\Test\Application , League\Container\Container .
Let’s take a look at an example: interface User
{
/** @return string */
public function getPassword();
}
class MyUser implements User
{
public function getPassword()
{
// return something
}
public function getDisplayName()
{
// return some name.
}
}
class AuthSystem
{
public function authenticate(User $user)
{
$this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
// do something.
}
}
In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different implementation of User which does not have a getDisplayName() method, the code will break. Available Fixes
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types
inside the if block in such a case.
![]() |
|||
53 | 56 | $mapper = new Mapper($this->getContainer()->get(Client::class)); |
|
54 | $filesystem = $this->getContainer()->get(Filesystem::class); |
||
55 | 56 | ||
56 | 56 | $mapperCache = $filesystem->getPath('.cache/mapper-meta.php'); |
|
57 | if (file_exists($mapperCache)) { |
||
58 | $meta = include $mapperCache; |
||
59 | $mapper->setMeta($meta); |
||
60 | } |
||
61 | 56 | ||
62 | $annotation = $mapper->getPlugin(Annotation::class); |
||
63 | 56 | ||
64 | 56 | foreach ($filesystem->listClasses('Entity') as $class) { |
|
65 | $annotation->register($class); |
||
66 | 56 | } |
|
67 | 56 | foreach ($filesystem->listClasses('Repository') as $class) { |
|
68 | $annotation->register($class); |
||
69 | } |
||
70 | 56 | ||
71 | 56 | $mapper->getPlugin(Sequence::class); |
|
72 | $mapper->getPlugin(Spy::class); |
||
73 | 56 | ||
74 | 56 | $mapper->getPlugin(Temporal::class) |
|
75 | 56 | ->getAggregator() |
|
76 | ->setReferenceAggregation(false); |
||
77 | 56 | ||
78 | $mapper->application = $this->getContainer(); |
||
0 ignored issues
–
show
The property
application does not seem to exist in Tarantool\Mapper\Mapper .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
79 | 56 | ||
80 | $mapper->serviceName = $this->getContainer()->get(Service::class)->getName(); |
||
0 ignored issues
–
show
The property
serviceName does not seem to exist in Tarantool\Mapper\Mapper .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
81 | |||
82 | 56 | $mapper->getPlugin(new class($mapper) extends Plugin { |
|
83 | public function afterInstantiate(Entity $entity) : Entity |
||
84 | 56 | { |
|
85 | 56 | $entity->app = $this->mapper->application; |
|
0 ignored issues
–
show
The property
app does not seem to exist in Tarantool\Mapper\Entity .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() The property
application does not seem to exist in Tarantool\Mapper\Mapper .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
86 | return $entity; |
||
87 | } |
||
88 | }); |
||
89 | |||
90 | return $mapper; |
||
91 | }); |
||
92 | |||
93 | $this->getContainer()->share(Schema::class, function () { |
||
0 ignored issues
–
show
It seems like you code against a concrete implementation and not the interface
Psr\Container\ContainerInterface as the method share() does only exist in the following implementations of said interface: Basis\Application , Basis\Test\Application , League\Container\Container .
Let’s take a look at an example: interface User
{
/** @return string */
public function getPassword();
}
class MyUser implements User
{
public function getPassword()
{
// return something
}
public function getDisplayName()
{
// return some name.
}
}
class AuthSystem
{
public function authenticate(User $user)
{
$this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
// do something.
}
}
In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different implementation of User which does not have a getDisplayName() method, the code will break. Available Fixes
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types
inside the if block in such a case.
![]() |
|||
94 | return $this->getContainer()->get(Mapper::class)->getSchema(); |
||
95 | }); |
||
96 | |||
97 | $this->getContainer()->share(Spy::class, function () { |
||
0 ignored issues
–
show
It seems like you code against a concrete implementation and not the interface
Psr\Container\ContainerInterface as the method share() does only exist in the following implementations of said interface: Basis\Application , Basis\Test\Application , League\Container\Container .
Let’s take a look at an example: interface User
{
/** @return string */
public function getPassword();
}
class MyUser implements User
{
public function getPassword()
{
// return something
}
public function getDisplayName()
{
// return some name.
}
}
class AuthSystem
{
public function authenticate(User $user)
{
$this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
// do something.
}
}
In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different implementation of User which does not have a getDisplayName() method, the code will break. Available Fixes
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types
inside the if block in such a case.
![]() |
|||
98 | return $this->getContainer()->get(Mapper::class)->getPlugin(Spy::class); |
||
99 | }); |
||
100 | |||
101 | $this->getContainer()->share(Temporal::class, function () { |
||
0 ignored issues
–
show
It seems like you code against a concrete implementation and not the interface
Psr\Container\ContainerInterface as the method share() does only exist in the following implementations of said interface: Basis\Application , Basis\Test\Application , League\Container\Container .
Let’s take a look at an example: interface User
{
/** @return string */
public function getPassword();
}
class MyUser implements User
{
public function getPassword()
{
// return something
}
public function getDisplayName()
{
// return some name.
}
}
class AuthSystem
{
public function authenticate(User $user)
{
$this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
// do something.
}
}
In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different implementation of User which does not have a getDisplayName() method, the code will break. Available Fixes
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types
inside the if block in such a case.
![]() |
|||
102 | return $this->getContainer()->get(Mapper::class)->getPlugin(Temporal::class); |
||
103 | }); |
||
104 | } |
||
105 | } |
||
106 |
Let’s take a look at an example:
In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different implementation of User which does not have a getDisplayName() method, the code will break.
Available Fixes
Change the type-hint for the parameter:
Add an additional type-check:
Add the method to the interface: