Completed
Push — master ( bff359...005b00 )
by John
01:53
created
src/AccessControl/MultiAndAccessControl.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
      * @param \LunixREST\Request\Request $request
12 12
      * @return bool true if all of the $accessControls' validate access methods returned true for the given request
13 13
      */
14
-    public function validateAccess(Request $request){
15
-        foreach($this->accessControls as $accessControl){
16
-            if(!$accessControl->validateAccess($request)){
14
+    public function validateAccess(Request $request) {
15
+        foreach ($this->accessControls as $accessControl) {
16
+            if (!$accessControl->validateAccess($request)) {
17 17
                 return false;
18 18
             }
19 19
         }
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
      * @param $apiKey
25 25
      * @return bool true if all of the $accessControls' validate key methods returned true for the given request
26 26
      */
27
-    public function validateKey($apiKey){
28
-        foreach($this->accessControls as $accessControl){
29
-            if(!$accessControl->validateKey($apiKey)){
27
+    public function validateKey($apiKey) {
28
+        foreach ($this->accessControls as $accessControl) {
29
+            if (!$accessControl->validateKey($apiKey)) {
30 30
                 return false;
31 31
             }
32 32
         }
Please login to merge, or discard this patch.
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
      * @param \LunixREST\Request\Request $request
12 12
      * @return bool true if all of the $accessControls' validate access methods returned true for the given request
13 13
      */
14
-    public function validateAccess(Request $request){
15
-        foreach($this->accessControls as $accessControl){
16
-            if(!$accessControl->validateAccess($request)){
14
+    public function validateAccess(Request $request) {
15
+        foreach($this->accessControls as $accessControl) {
16
+            if(!$accessControl->validateAccess($request)) {
17 17
                 return false;
18 18
             }
19 19
         }
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
      * @param $apiKey
25 25
      * @return bool true if all of the $accessControls' validate key methods returned true for the given request
26 26
      */
27
-    public function validateKey($apiKey){
28
-        foreach($this->accessControls as $accessControl){
29
-            if(!$accessControl->validateKey($apiKey)){
27
+    public function validateKey($apiKey) {
28
+        foreach($this->accessControls as $accessControl) {
29
+            if(!$accessControl->validateKey($apiKey)) {
30 30
                 return false;
31 31
             }
32 32
         }
Please login to merge, or discard this patch.
src/Configuration/Configuration.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,6 +2,6 @@
 block discarded – undo
2 2
 namespace LunixREST\Configuration;
3 3
 
4 4
 interface Configuration {
5
-	public function get($key);
6
-	public function set($key);
5
+    public function get($key);
6
+    public function set($key);
7 7
 }
Please login to merge, or discard this patch.
src/Endpoint/DoctrineEndpoint.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 class DoctrineEndpoint extends DefaultEndpoint {
10 10
     protected $entityManager;
11 11
 
12
-    public function __construct(EntityManager $em){
12
+    public function __construct(EntityManager $em) {
13 13
         $this->entityManager = $em;
14 14
     }
15 15
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 class DoctrineEndpoint extends DefaultEndpoint {
10 10
     protected $entityManager;
11 11
 
12
-    public function __construct(EntityManager $em){
12
+    public function __construct(EntityManager $em) {
13 13
         $this->entityManager = $em;
14 14
     }
15 15
 }
Please login to merge, or discard this patch.
src/Endpoint/DoctrineNamespaceEndpointFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      * @throws UnknownEndpointException
21 21
      */
22 22
     public function getEndpoint(string $name, string $version): Endpoint {
23
-        $className = $this->buildVersionedEndpointNamespace($version) . $name;
23
+        $className = $this->buildVersionedEndpointNamespace($version).$name;
24 24
         return new $className($this->entityManager);
25 25
     }
26 26
 }
Please login to merge, or discard this patch.
examples/helloworld/src/Endpoints/v1_0/helloworld.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,5 +17,5 @@
 block discarded – undo
17 17
         $helloWorld = new \HelloWorld\Models\HelloWorld();
18 18
 
19 19
         return $helloWorld;
20
-	}
20
+    }
21 21
 }
Please login to merge, or discard this patch.
examples/geophone/src/EndpointFactory/EndpointFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      * @throws UnknownEndpointException
22 22
      */
23 23
     public function getEndpoint(string $name, string $version): Endpoint {
24
-        switch($version) {
24
+        switch ($version) {
25 25
             case "1":
26 26
                 switch (strtolower($name)) {
27 27
                     case "phonenumbers":
Please login to merge, or discard this patch.
examples/geophone/src/Endpoints/v1/PhoneNumbers.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,6 +20,6 @@
 block discarded – undo
20 20
 
21 21
 
22 22
     public function get(Request $request): ResponseData{
23
-		return $this->geoPhone->lookupNumber($request->getInstance());
24
-	}
23
+        return $this->geoPhone->lookupNumber($request->getInstance());
24
+    }
25 25
 }
Please login to merge, or discard this patch.
examples/geophone/src/Models/GeoPhone.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     /**
15 15
      * @param string $filename
16 16
      */
17
-    public function __construct($filename = 'data.csv'){
17
+    public function __construct($filename = 'data.csv') {
18 18
         $this->fileHandle = fopen($filename, 'r');
19 19
     }
20 20
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         $nextThree = substr($phoneNumber, 3, 3);
30 30
 
31 31
         while (($data = fgetcsv($this->fileHandle)) !== FALSE) {
32
-            if($areaCode == $data[0] && $nextThree == $data[1]){
32
+            if ($areaCode == $data[0] && $nextThree == $data[1]) {
33 33
                 return new LookupResponse($data[2], $data[3]);
34 34
             }
35 35
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     /**
15 15
      * @param string $filename
16 16
      */
17
-    public function __construct($filename = 'data.csv'){
17
+    public function __construct($filename = 'data.csv') {
18 18
         $this->fileHandle = fopen($filename, 'r');
19 19
     }
20 20
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         $nextThree = substr($phoneNumber, 3, 3);
30 30
 
31 31
         while (($data = fgetcsv($this->fileHandle)) !== FALSE) {
32
-            if($areaCode == $data[0] && $nextThree == $data[1]){
32
+            if($areaCode == $data[0] && $nextThree == $data[1]) {
33 33
                 return new LookupResponse($data[2], $data[3]);
34 34
             }
35 35
         }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         $areaCode = substr($phoneNumber, 0, 3);
29 29
         $nextThree = substr($phoneNumber, 3, 3);
30 30
 
31
-        while (($data = fgetcsv($this->fileHandle)) !== FALSE) {
31
+        while (($data = fgetcsv($this->fileHandle)) !== false) {
32 32
             if($areaCode == $data[0] && $nextThree == $data[1]){
33 33
                 return new LookupResponse($data[2], $data[3]);
34 34
             }
Please login to merge, or discard this patch.
src/Endpoint/NamespaceEndpointFactory.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
      * @throws UnknownEndpointException
23 23
      */
24 24
     public function getEndpoint(string $name, string $version): Endpoint {
25
-        $className = $this->buildVersionedEndpointNamespace($version) . $name;
26
-        if(!class_exists($className)){
25
+        $className = $this->buildVersionedEndpointNamespace($version).$name;
26
+        if (!class_exists($className)) {
27 27
             throw new UnknownEndpointException("Could not find $className");
28 28
         }
29 29
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $classesInNamespace = [];
40 40
 
41 41
         $namespace = $this->buildVersionedEndpointNamespace($version);
42
-        foreach(get_declared_classes() as $name) {
42
+        foreach (get_declared_classes() as $name) {
43 43
             if (strpos($name, $namespace) === 0) {
44 44
                 $classesInNamespace[] = $name;
45 45
             }
@@ -49,6 +49,6 @@  discard block
 block discarded – undo
49 49
     }
50 50
 
51 51
     protected function buildVersionedEndpointNamespace(string $version): string {
52
-        return $this->endpointNamespace . '\v' . str_replace('.', '_', $version) . '\\';
52
+        return $this->endpointNamespace.'\v'.str_replace('.', '_', $version).'\\';
53 53
     }
54 54
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
      */
24 24
     public function getEndpoint(string $name, string $version): Endpoint {
25 25
         $className = $this->buildVersionedEndpointNamespace($version) . $name;
26
-        if(!class_exists($className)){
26
+        if(!class_exists($className)) {
27 27
             throw new UnknownEndpointException("Could not find $className");
28 28
         }
29 29
 
Please login to merge, or discard this patch.