Issues (86)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  Header Injection
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Trucker/TruckerServiceProvider.php (4 issues)

1
<?php
2
3
namespace Trucker;
4
5
use Illuminate\Config\FileLoader;
6
use Illuminate\Config\Repository;
7
use Illuminate\Container\Container;
8
use Illuminate\Support\ServiceProvider;
9
10
/**
11
 * Service Provider for interacting with the Trucker class.
12
 *
13
 * @author Alessandro Manno <[email protected]>
14
 */
15
class TruckerServiceProvider extends ServiceProvider
16
{
17
    /**
18
     * Bootstrap the application events.
19
     */
20
    public function boot()
21
    {
22
        // Register classes
23
    }
24
25
    /**
26
     * Register the service provider.
27
     */
28
    public function register()
29
    {
30
        // done with boot()
31
        $this->app = static::make($this->app);
0 ignored issues
show
Documentation Bug introduced by
It seems like static::make($this->app) of type Illuminate\Container\Container is incompatible with the declared type Illuminate\Foundation\Application of property $app.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
32
    }
33
34
    /**
35
     * Get the services provided by the provider.
36
     *
37
     * @return array
38
     */
39
    public function provides()
40
    {
41
        return ['trucker'];
42
    }
43
44
    public static function make(Container $app = null)
45
    {
46
        if (!$app) {
47
            $app = new Container();
48
        }
49
50
        $serviceProvider = new static($app);
51
52
        //bind paths
53
        $app = $serviceProvider->bindPaths($app);
54
55
        // Bind classes
56
        $app = $serviceProvider->bindCoreClasses($app);
57
        $app = $serviceProvider->bindClasses($app);
58
59
        return $app;
60
    }
61
62
    /**
63
     * Bind the Trucker paths.
64
     *
65
     * @param Container $app
66
     *
67
     * @return Container
68
     */
69
    public function bindPaths(Container $app)
70
    {
71
        $app->bind('trucker.bootstrapper', function ($app) {
72
            return new Bootstrapper($app);
73
        });
74
75
        // Bind paths
76
        $app['trucker.bootstrapper']->bindPaths();
77
78
        return $app;
79
    }
80
81
    /**
82
     * Bind the core classes.
83
     *
84
     * @param Container $app
85
     *
86
     * @return Container
87
     */
88
    public function bindCoreClasses(Container $app)
89
    {
90
        $app->bindIf('files', 'Illuminate\Filesystem\Filesystem');
91
92
        $app->bindIf('config', function ($app) {
93
            $fileloader = new FileLoader($app['files'], __DIR__ . '/../config');
94
95
            return new Repository($fileloader, 'config');
96
        }, true);
97
98
        // Register factory and custom configurations
99
        $app = $this->registerConfig($app);
100
101
        return $app;
102
    }
103
104
    /**
105
     * Bind the ActiveResource classes to the Container.
106
     *
107
     * @param Container $app
108
     *
109
     * @return Container
110
     */
111
    public function bindClasses(Container $app)
112
    {
113
        $app->singleton('trucker.urls', function ($app) {
114
            return new Url\UrlGenerator($app);
115
        });
116
117
        $app->singleton('trucker.config-manager', function ($app) {
118
            return new Support\ConfigManager($app);
119
        });
120
121
        $app->bind('trucker.instance-finder', function ($app) {
122
            return new Finders\InstanceFinder($app);
123
        });
124
125
        $app->bind('trucker.collection-finder', function ($app) {
126
            return new Finders\CollectionFinder($app);
127
        });
128
129
        $app->bind('trucker.response', function ($app) {
130
            return new Responses\Response($app);
131
        });
132
133
        $app->bind('trucker.model', function () {
134
            return new Resource\Model();
135
        });
136
137
        //Factories
138
        $app->bind('trucker.conditions', function ($app) {
139
            return new Factories\QueryConditionFactory($app);
140
        });
141
142
        $app->bind('trucker.transporter', function ($app) {
143
            return new Factories\ApiTransporterFactory($app);
144
        });
145
146
        $app->bind('trucker.order', function ($app) {
147
            return new Factories\QueryResultOrderFactory($app);
148
        });
149
150
        $app->bind('trucker.interpreter', function ($app) {
151
            return new Factories\ResponseInterpreterFactory($app);
152
        });
153
154
        $app->bind('trucker.error-handler', function ($app) {
155
            return new Factories\ErrorHandlerFactory($app);
156
        });
157
158
        $app->bind('trucker.request-factory', function ($app) {
159
            return new Factories\RequestFactory($app);
160
        });
161
162
        $app->bind('trucker.auth', function ($app) {
163
            return new Factories\AuthFactory($app);
164
        });
165
166
        return $app;
167
    }
168
169
    /**
170
     * Register factory and custom configurations.
171
     *
172
     * @param Container $app
173
     *
174
     * @return Container
175
     */
176
    protected function registerConfig(Container $app)
177
    {
178
        // Register config file(filename)
179
        $app['config']->package('alexmanno/trucker', __DIR__ . '/../config');
0 ignored issues
show
The method package() does not exist on Illuminate\Support\Facades\Config. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

179
        $app['config']->/** @scrutinizer ignore-call */ 
180
                        package('alexmanno/trucker', __DIR__ . '/../config');

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
180
        $app['config']->getLoader();
0 ignored issues
show
The method getLoader() does not exist on Illuminate\Support\Facades\Config. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

180
        $app['config']->/** @scrutinizer ignore-call */ 
181
                        getLoader();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
181
182
        // Register custom config
183
        $custom = $app['path.trucker.config'];
184
        if (file_exists($custom)) {
185
            $app['config']->afterLoading('trucker', function ($group, $items) use ($custom) {
0 ignored issues
show
The method afterLoading() does not exist on Illuminate\Support\Facades\Config. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

185
            $app['config']->/** @scrutinizer ignore-call */ 
186
                            afterLoading('trucker', function ($group, $items) use ($custom) {

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
186
                $customItems = $custom . '/' . $group . '.php';
187
                if (!file_exists($customItems)) {
188
                    return $items;
189
                }
190
191
                $customItems = include $customItems;
192
193
                return array_replace_recursive($items, $customItems);
194
            });
195
        }
196
197
        return $app;
198
    }
199
}
200