Completed
Push — master ( d6407a...75846b )
by Jeroen
02:30
created
src/ValueObjects/Uuid.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     /**
33 33
      * @param string $string
34 34
      *
35
-     * @return string
35
+     * @return Uuid
36 36
      */
37 37
     public static function fromString(string $string): string
38 38
     {
Please login to merge, or discard this patch.
src/Console/Schedule.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@
 block discarded – undo
4 4
 
5 5
 class Schedule
6 6
 {
7
-	/**
8
-	 * @param string $name
9
-	 */
10
-	public function command(string $name)
11
-	{
7
+    /**
8
+     * @param string $name
9
+     */
10
+    public function command(string $name)
11
+    {
12 12
 
13
-	}
13
+    }
14 14
 }
15 15
\ No newline at end of file
Please login to merge, or discard this patch.
src/Console/OutputAwareTrait.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -6,31 +6,31 @@
 block discarded – undo
6 6
 
7 7
 trait OutputAwareTrait
8 8
 {
9
-	/**
10
-	 * @var OutputInterface
11
-	 */
12
-	protected $output;
9
+    /**
10
+     * @var OutputInterface
11
+     */
12
+    protected $output;
13 13
 
14
-	/**
15
-	 * Set an output.
16
-	 *
17
-	 * @param OutputInterface $output
18
-	 * @return $this
19
-	 */
20
-	public function setOutput(OutputInterface $output)
21
-	{
22
-		$this->output = $output;
14
+    /**
15
+     * Set an output.
16
+     *
17
+     * @param OutputInterface $output
18
+     * @return $this
19
+     */
20
+    public function setOutput(OutputInterface $output)
21
+    {
22
+        $this->output = $output;
23 23
 
24
-		return $this;
25
-	}
24
+        return $this;
25
+    }
26 26
 
27
-	/**
28
-	 * Get the output.
29
-	 *
30
-	 * @return OutputInterface
31
-	 */
32
-	public function getOutput()
33
-	{
34
-		return $this->output;
35
-	}
27
+    /**
28
+     * Get the output.
29
+     *
30
+     * @return OutputInterface
31
+     */
32
+    public function getOutput()
33
+    {
34
+        return $this->output;
35
+    }
36 36
 }
Please login to merge, or discard this patch.
src/Kernel/AbstractKernel.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -18,29 +18,29 @@
 block discarded – undo
18 18
      */
19 19
     public function __construct()
20 20
     {
21
-    	$this->registerExceptionHandler();
21
+        $this->registerExceptionHandler();
22 22
 
23
-    	$this->createContainer();
23
+        $this->createContainer();
24 24
 
25
-    	$this->loadEnvironment();
25
+        $this->loadEnvironment();
26 26
     }
27 27
 
28 28
     private function registerExceptionHandler()
29
-	{
30
-		$handler = new Handler(new DefaultFormatter());
29
+    {
30
+        $handler = new Handler(new DefaultFormatter());
31 31
 
32
-	}
32
+    }
33 33
 
34 34
     private function createContainer()
35
-	{
36
-		$container = new Container;
37
-		$container->delegate(new ReflectionContainer);
38
-		$this->setContainer($container);
39
-	}
40
-
41
-	private function loadEnvironment()
42
-	{
43
-		$environment = new Dotenv(getcwd() . '/../');
44
-		$environment->load();
45
-	}
35
+    {
36
+        $container = new Container;
37
+        $container->delegate(new ReflectionContainer);
38
+        $this->setContainer($container);
39
+    }
40
+
41
+    private function loadEnvironment()
42
+    {
43
+        $environment = new Dotenv(getcwd() . '/../');
44
+        $environment->load();
45
+    }
46 46
 }
Please login to merge, or discard this patch.
src/Exceptions/Formatters/DefaultFormatter.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
 class DefaultFormatter implements FormatterInterface
8 8
 {
9 9
 
10
-	public function format(\Throwable $e): array
11
-	{
12
-		return [
13
-			'message' => $e->getMessage(),
14
-			'file' => $e->getFile(),
15
-			'line' => $e->getLine(),
16
-			'trace' => $e->getTrace(),
17
-		];
18
-	}
10
+    public function format(\Throwable $e): array
11
+    {
12
+        return [
13
+            'message' => $e->getMessage(),
14
+            'file' => $e->getFile(),
15
+            'line' => $e->getLine(),
16
+            'trace' => $e->getTrace(),
17
+        ];
18
+    }
19 19
 }
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
src/Exceptions/Handler.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -101,6 +101,9 @@
 block discarded – undo
101 101
 		}
102 102
 	}
103 103
 
104
+	/**
105
+	 * @param integer $statusCode
106
+	 */
104 107
 	public function sendException($data, $statusCode)
105 108
 	{
106 109
 		header("HTTP/1.0 " . $statusCode . " Internal Server Error");
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
 	protected function disablePHPDisplayErrors()
36 36
 	{
37
-		ini_set( 'display_errors', 0 );
37
+		ini_set('display_errors', 0);
38 38
 	}
39 39
 
40 40
 	/**
Please login to merge, or discard this patch.
Indentation   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -7,106 +7,106 @@
 block discarded – undo
7 7
 
8 8
 class Handler
9 9
 {
10
-	const ERROR_HANDLER = 'handleError';
11
-	const EXCEPTION_HANDLER = 'handleException';
12
-	const SHUTDOWN_HANDLER = 'handleShutdown';
13
-
14
-	/**
15
-	 * @var FormatterInterface
16
-	 */
17
-	private $formatter;
18
-
19
-	/**
20
-	 * Handler constructor.
21
-	 *
22
-	 * @param FormatterInterface $formatter
23
-	 */
24
-	public function __construct(FormatterInterface $formatter)
25
-	{
26
-		$this->formatter = $formatter;
27
-
28
-		$this->disablePHPDisplayErrors();
29
-
30
-		$this->registerErrorHandler();
31
-		$this->registerExceptionHandler();
32
-		$this->registerShutdownHandler();
33
-	}
34
-
35
-	protected function disablePHPDisplayErrors()
36
-	{
37
-		ini_set( 'display_errors', 0 );
38
-	}
39
-
40
-	/**
41
-	 * Register the PHP error handler.
42
-	 *
43
-	 * @return void
44
-	 */
45
-	protected function registerErrorHandler()
46
-	{
47
-		set_error_handler([$this, self::ERROR_HANDLER]);
48
-	}
49
-
50
-	/**
51
-	 * Register the PHP exception handler.
52
-	 *
53
-	 * @return void
54
-	 */
55
-	protected function registerExceptionHandler()
56
-	{
57
-		set_exception_handler([$this, self::EXCEPTION_HANDLER]);
58
-	}
59
-
60
-	/**
61
-	 * Register a function for execution on shutdown
62
-	 *
63
-	 * @return void
64
-	 */
65
-	protected function registerShutdownHandler()
66
-	{
67
-		register_shutdown_function([$this, self::SHUTDOWN_HANDLER]);
68
-	}
69
-
70
-	/**
71
-	 * @param int $level
72
-	 * @param string $message
73
-	 * @param string $file
74
-	 * @param int $line
75
-	 *
76
-	 * @throws ErrorException
77
-	 */
78
-	public function handleError(int $level, string $message, string $file = '', int $line = 0)
79
-	{
80
-		throw new ErrorException($message, 0, $level, $file, $line);
81
-	}
82
-
83
-	/**
84
-	 * @param \Throwable $e
85
-	 */
86
-	public function handleException(\Throwable $e)
87
-	{
88
-		$data = json_encode($this->formatter->format($e));
89
-		$this->sendException($data, 500);
90
-	}
91
-
92
-	/**
93
-	 * Handle the PHP shutdown event.
94
-	 */
95
-	public function handleShutdown()
96
-	{
97
-		$error = error_get_last();
98
-
99
-		if ($error) {
100
-			$this->handleException(new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']));
101
-		}
102
-	}
103
-
104
-	public function sendException($data, $statusCode)
105
-	{
106
-		header("HTTP/1.0 " . $statusCode . " Internal Server Error");
107
-		header('Content-Type: application/json; charset=utf-8');
108
-		echo $data;
109
-
110
-		return;
111
-	}
10
+    const ERROR_HANDLER = 'handleError';
11
+    const EXCEPTION_HANDLER = 'handleException';
12
+    const SHUTDOWN_HANDLER = 'handleShutdown';
13
+
14
+    /**
15
+     * @var FormatterInterface
16
+     */
17
+    private $formatter;
18
+
19
+    /**
20
+     * Handler constructor.
21
+     *
22
+     * @param FormatterInterface $formatter
23
+     */
24
+    public function __construct(FormatterInterface $formatter)
25
+    {
26
+        $this->formatter = $formatter;
27
+
28
+        $this->disablePHPDisplayErrors();
29
+
30
+        $this->registerErrorHandler();
31
+        $this->registerExceptionHandler();
32
+        $this->registerShutdownHandler();
33
+    }
34
+
35
+    protected function disablePHPDisplayErrors()
36
+    {
37
+        ini_set( 'display_errors', 0 );
38
+    }
39
+
40
+    /**
41
+     * Register the PHP error handler.
42
+     *
43
+     * @return void
44
+     */
45
+    protected function registerErrorHandler()
46
+    {
47
+        set_error_handler([$this, self::ERROR_HANDLER]);
48
+    }
49
+
50
+    /**
51
+     * Register the PHP exception handler.
52
+     *
53
+     * @return void
54
+     */
55
+    protected function registerExceptionHandler()
56
+    {
57
+        set_exception_handler([$this, self::EXCEPTION_HANDLER]);
58
+    }
59
+
60
+    /**
61
+     * Register a function for execution on shutdown
62
+     *
63
+     * @return void
64
+     */
65
+    protected function registerShutdownHandler()
66
+    {
67
+        register_shutdown_function([$this, self::SHUTDOWN_HANDLER]);
68
+    }
69
+
70
+    /**
71
+     * @param int $level
72
+     * @param string $message
73
+     * @param string $file
74
+     * @param int $line
75
+     *
76
+     * @throws ErrorException
77
+     */
78
+    public function handleError(int $level, string $message, string $file = '', int $line = 0)
79
+    {
80
+        throw new ErrorException($message, 0, $level, $file, $line);
81
+    }
82
+
83
+    /**
84
+     * @param \Throwable $e
85
+     */
86
+    public function handleException(\Throwable $e)
87
+    {
88
+        $data = json_encode($this->formatter->format($e));
89
+        $this->sendException($data, 500);
90
+    }
91
+
92
+    /**
93
+     * Handle the PHP shutdown event.
94
+     */
95
+    public function handleShutdown()
96
+    {
97
+        $error = error_get_last();
98
+
99
+        if ($error) {
100
+            $this->handleException(new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']));
101
+        }
102
+    }
103
+
104
+    public function sendException($data, $statusCode)
105
+    {
106
+        header("HTTP/1.0 " . $statusCode . " Internal Server Error");
107
+        header('Content-Type: application/json; charset=utf-8');
108
+        echo $data;
109
+
110
+        return;
111
+    }
112 112
 }
113 113
\ No newline at end of file
Please login to merge, or discard this patch.
src/Http/Middleware/Resolver.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@
 block discarded – undo
8 8
 class Resolver implements ResolverInterface
9 9
 {
10 10
 
11
-	/**
12
-	 *
13
-	 * Converts a middleware queue entry to a callable or an implementation of
14
-	 * MiddlewareInterface.
15
-	 *
16
-	 * @param mixed $entry The middleware queue entry.
17
-	 *
18
-	 * @return callable|MiddlewareInterface
19
-	 *
20
-	 */
21
-	public function __invoke($entry)
22
-	{
23
-		(new $entry)->run();
24
-	}
11
+    /**
12
+     *
13
+     * Converts a middleware queue entry to a callable or an implementation of
14
+     * MiddlewareInterface.
15
+     *
16
+     * @param mixed $entry The middleware queue entry.
17
+     *
18
+     * @return callable|MiddlewareInterface
19
+     *
20
+     */
21
+    public function __invoke($entry)
22
+    {
23
+        (new $entry)->run();
24
+    }
25 25
 }
26 26
\ No newline at end of file
Please login to merge, or discard this patch.
src/Console/Command.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 abstract class Command
6 6
 {
7
-	/**
8
-	 * Execute the console command.
9
-	 *
10
-	 * @return mixed
11
-	 */
12
-	abstract public function handle();
7
+    /**
8
+     * Execute the console command.
9
+     *
10
+     * @return mixed
11
+     */
12
+    abstract public function handle();
13 13
 }
14 14
\ No newline at end of file
Please login to merge, or discard this patch.
src/Console/Interfaces/OutputAware.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -6,19 +6,19 @@
 block discarded – undo
6 6
 
7 7
 interface OutputAware
8 8
 {
9
-	/**
10
-	 * Set an output
11
-	 *
12
-	 * @param OutputInterface $output
13
-	 *
14
-	 * @return mixed
15
-	 */
16
-	public function setOutput(OutputInterface $output);
9
+    /**
10
+     * Set an output
11
+     *
12
+     * @param OutputInterface $output
13
+     *
14
+     * @return mixed
15
+     */
16
+    public function setOutput(OutputInterface $output);
17 17
 
18
-	/**
19
-	 * Get the output
20
-	 *
21
-	 * @return OutputInterface
22
-	 */
23
-	public function getOutput();
18
+    /**
19
+     * Get the output
20
+     *
21
+     * @return OutputInterface
22
+     */
23
+    public function getOutput();
24 24
 }
25 25
\ No newline at end of file
Please login to merge, or discard this patch.