GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (28)

Security Analysis    no request data  

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

  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  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.
  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.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
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/API/Serializers/LaravelModelSerializer.php (3 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
namespace Solvire\API\Serializers;
3
4
use Illuminate\Database\Eloquent\Model;
5
use Solvire\API\Serializers\DataFields\SplitPointField;
6
use Solvire\API\Serializers\DataFields\SerializerField;
7
use Solvire\API\Serializers\DataFields\TransformerField;
8
9
/**
10
 * Map a Laravel 5.x model to a serializer
11
 *
12
 * @author solvire <[email protected]>
13
 * @package Serializers
14
 * @namespace Solvire\API\Serializers
15
 */
16
abstract class LaravelModelSerializer extends BaseSerializer
17
{
18
19
    /**
20
     *
21
     * @var Model
22
     */
23
    protected $model = null;
24
25
    /**
26
     *
27
     * @param Model $model            
28
     * @return \Solvire\API\Serializers\LaravelModelSerializer
29
     */
30 1
    public function setModel(Model $model)
31
    {
32 1
        $this->model = $model;
33 1
        return $this;
34
    }
35
36
    /**
37
     *
38
     * @return Model
39
     */
40 1
    public function getModel()
41
    {
42 1
        return $this->model;
43
    }
44
45 1
    public function jsonSerialize()
46
    {
47 1
        return $this->toArray();
48
    }
49
50
    /**
51
     * is update = when updating the database
52
     *
53
     * @param string $isUpdate            
54
     * @return multitype:NULL
0 ignored issues
show
The doc-type multitype:NULL could not be parsed: Unknown type name "multitype:NULL" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
55
     */
56 1
    public function toArray($isUpdate = false)
0 ignored issues
show
The parameter $isUpdate is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
57
    {
58 1
        $ret = [];
59 1
        $dfc = $this->getDataFieldCollection();
60 1
        foreach ($dfc as $name => $dataField) {
61
            
62
            // write only fields should not be displayed 
63 1
            if($dataField->writeOnly())
64 1
                continue;
65
            
66 1
            $ret[$name] = $dataField->getData();
67 1
        }
68
        
69 1
        return $ret;
70
    }
71
72
    /**
73
     *
74
     * @param array $data            
0 ignored issues
show
There is no parameter named $data. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
75
     */
76 1
    public function loadData($model)
77
    {
78
        
79
        // make sure that this is a laravel model
80 1
        if (! $model instanceof Model)
81 1
            throw new \RuntimeException("the object must be of type Illuminate\Database\Eloquent\Model ");
82
            
83
        // loop through all the set fields in the collection
84
        // if they have a matching name then load them up from the model
85
        // if they have a matching columnName then find the value and load that up instead
86 1
        $dfc = $this->getDataFieldCollection();
87 1
        foreach ($dfc as $name => $dataField) {
88 1
            $col = $dataField->columnName();
89
            
90
            // i don't think laravel has a point type data field
91
            // we need to check to see if it's a point field split and combine it
92 1
            if ($dataField instanceof SplitPointField) {
93 1
                $this->loadSplitPoint($dataField, $model);
94 1
                continue;
95
            }
96
            
97
            
98
            // if this is a child serializer object then pass it down
99
            // we assume that since we are in laravel environment that we will have subs of the same
100
            // also assuming that the name of the column is the function name 
101 1
            if($dataField instanceof SerializerField) {
102
                
103
                // this might be better as a callback instead 
104
                // get the field name to call
105 1
                $dataField->setData($model);
106 1
                continue;
107
                
108
            }
109
            
110
            // if this is a child transformer object then pass it down
111
            // I need more use cases to see where htis will break 
112 1
            if($dataField instanceof TransformerField) {
113
                $dataField->setData($model);
114
                continue;
115
            }
116
            
117
            
118
            // if we have a column name then use that first
119 1
            $data = ($col) ? $model->$col : $model->$name;
120
            
121 1
            if (($data === null) && ! $dataField->allowNull())
122 1
                continue;
123
            
124 1
            if (($data === '') && ! $dataField->allowEmpty())
125 1
                continue;
126
            
127 1
            $dataField->setData($data);
128 1
        }
129
        
130 1
        return $this;
131
    }
132
133 1
    public function loadSplitPoint($dataField, $model)
134
    {
135 1
        $lat = $dataField->getLatitudeColumn();
136 1
        $lon = $dataField->getLongitudeColumn();
137 1
        $dataField->setData([
138 1
            'latitude' => $model->$lat,
139
            'longitude' => $model->$lon
140 1
        ]);
141 1
    }
142
}
143