Issues (29)

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/Ressources/RegistrationCertain.php (5 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 Wabel\CertainAPI\Ressources;
3
4
use Wabel\CertainAPI\Interfaces\CertainRessourceInterface;
5
use Wabel\CertainAPI\CertainRessourceAbstract;
6
7
/**
8
 * RegistrationCertain about the Registration entity
9
 *
10
 * @author rbergina
11
 */
12
class RegistrationCertain extends CertainRessourceAbstract implements CertainRessourceInterface
13
{
14
    public function getRessourceName(){
15
        return 'Registration';
16
    }
17
    public function getMandatoryFields()
18
    {
19
        return array('profile');
20
    }
21
22
    /**
23
     * Return with all the result from certain.
24
     * @return RegistrationCertain[]
25
     */
26 View Code Duplication
    public function getRegistrations($params = [])
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
    {
28
        $request=  $this->get(null,$params);
29
        if($request->isSuccessFul()){
30
            $registrationCertainResults = $request->getResults();
31
            return $registrationCertainResults->registrations;
32
        }
33
        return null;
34
    }
35
    
36
    /**
37
     * Return with all the result from certain.
38
     * @return RegistrationCertain[]
39
     */
40 View Code Duplication
    public function getRegistrationsByEventCode($eventCode,$params = [])
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
41
    {
42
        $request=  $this->get($eventCode,$params);
43
        if($request->isSuccessFul()){
44
            $registrationCertainResults = $request->getResults();
45
            return $registrationCertainResults->registrations;
46
        }
47
        return null;
48
    }
49
50
    /**
51
     * Return with all the result from certain.
52
     * @param string $eventCode eventCode
53
     * @param string $email email
54
     * @param boolean $returnRegCode To say if we want return a boolean or the regCode
55
     * @param string $orderBySecure in order to get the first registration when we have duplciates
56
     * @return registrationCode|null|boolean|[registrationCode=> "",attendeeTypeCode=>""]
0 ignored issues
show
The doc-type registrationCode=>">registrationCode|null|boolean|[registrationCode=> could not be parsed: Unknown type name "[" at position 30. [(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...
57
     */
58
    public function hasRegistrationsByEventCodeAndEmail($eventCode,$email,$returnRegCode= true,$withAttenteeType=true,$orderBySecure='dateModified_asc')
59
    {
60
        $request=  $this->get($eventCode,[
61
            'email'=> $email,
62
            'orderBy'=> $orderBySecure
63
64
        ]);
65
        if($request->isSuccessFul()){
66
            $registrationCertainResults = $request->getResults();
67
            if($registrationCertainResults->size > 0 && $returnRegCode && $withAttenteeType){
68
                return [
69
                        'registrationCode' => $registrationCertainResults->registrations[0]->registrationCode,
70
                        'attendeeTypeCode' => (isset($registrationCertainResults->registrations[0]->attendeeTypeCode))?$registrationCertainResults->registrations[0]->attendeeTypeCode:'',
71
                    ];
72
            }
73
            elseif($registrationCertainResults->size > 0 && $returnRegCode){
74
                    return $registrationCertainResults->registrations[0]->registrationCode;
75
            } elseif($registrationCertainResults->size > 0  && !$returnRegCode){
76
                return true;
77
            }
78
        } elseif($request->isNotFound()){
79
            return false;
80
        }
81
        return null;
82
    }
83
84
    /**
85
     * Return with the result from certain.
86
     * @param string $eventCode
87
     * @param string $regCode
88
     * @return RegistrationObj
89
     */
90 View Code Duplication
    public function getRegistrationByEventCodeAnRegCode($eventCode,$regCode)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
91
    {
92
        $request=  $this->get($eventCode.'/'.$regCode);
93
        if($request->isSuccessFul()){
94
            $registrationCertainResult= $request->getResults();
95
            return $registrationCertainResult;
96
        }
97
        return null;
98
    }
99
100
    /**
101
     * Update with the result from certain.
102
     * @param string $eventCode
103
     * @param string $regCode
104
     * @return RegistrationObj
105
     */
106 View Code Duplication
    public function updateRegistrationByEventCodeAnRegCode($eventCode,$regCode,$data=[])
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
107
    {
108
        $request=  $this->post($data,[],$eventCode.'/'.$regCode);
109
        if($request->isSuccessFul()){
110
            $registrationCertainResult= $request->getResults();
111
            return $registrationCertainResult;
112
        }
113
        return null;
114
    }
115
116
//    public function substituateRegistration($eventCode,$regCode,$profilePin){
117
//        return $this->updateRegistrationByEventCodeAnRegCode($eventCode, $regCode, [
118
//            'profile' => [
119
//                'pin'=> $profilePin
120
//            ]
121
//        ]);
122
//    }
123
}