Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit d0c6899

Browse files
committed
Cleanup trailing whitespace
1 parent 3e390b1 commit d0c6899

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

ReactJS.php

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,32 @@
1414
* Requires V8JS PHP extension: http://php.net/v8js
1515
*/
1616
class ReactJS {
17-
17+
1818
private
1919
/**
2020
* Name of the component to render
2121
* @var string
2222
*/
2323
$component,
24-
24+
2525
/**
2626
* Properties that go along with the component
2727
* @var mixed
2828
*/
2929
$data = null,
30-
30+
3131
/**
3232
* Instance of V8Js class
3333
* @var object
3434
*/
3535
$v8,
36-
36+
3737
/**
3838
* Custom error handler
3939
* @var callable
4040
*/
4141
$errorHandler;
42-
42+
4343
/**
4444
* Initialize by passing JS code as a string.
4545
* The application source code is concatenated string
@@ -64,7 +64,7 @@ function __construct($libsrc, $appsrc) {
6464
$this->v8 = new V8Js();
6565
$this->executeJS($concatenated);
6666
}
67-
67+
6868
/**
6969
* Which components is to be rendered along with it's data
7070
* E.g.
@@ -80,7 +80,7 @@ function setComponent($component, $data = null) {
8080
$this->data = json_encode($data);
8181
return $this;
8282
}
83-
83+
8484
/**
8585
* Custom error handler. The default one var_dumps the exception
8686
* and die()s.
@@ -92,7 +92,7 @@ function setErrorHandler($err) {
9292
$this->errorHandler = $err;
9393
return $this;
9494
}
95-
95+
9696
/**
9797
* Returns the markup to print to the page
9898
*
@@ -106,18 +106,18 @@ function getMarkup() {
106106

107107
return $this->executeJS($js);
108108
}
109-
109+
110110
/**
111111
* Returns JS to be inlined in the page (without <script> tags)
112112
* It instantiates the client side, once the JS arrives
113-
*
113+
*
114114
* NOTE: This class makes no attempt to load files JS so you can load it
115115
* however is appropriate - from a CDN, asynchronously, etc.
116116
*
117-
* e.g. getJS('document.body');
117+
* e.g. getJS('document.body');
118118
* renders in body and doesn't retain a var
119-
* e.g. getJS('#page', "GLOB");
120-
* renders in element id="page" and assigns the component to
119+
* e.g. getJS('#page', "GLOB");
120+
* renders in element id="page" and assigns the component to
121121
* a JavaScript variable named GLOB for later use if needed
122122
* @param string $where A reference to a DOM object, or an ID
123123
* for convenience if prefixed by a #. E.g. "#page"
@@ -134,7 +134,7 @@ function getJS($where, $return_var = null) {
134134
substr($where, 1)
135135
);
136136
}
137-
return
137+
return
138138
($return_var ? "var $return_var = " : "") .
139139
sprintf(
140140
"React.render(React.createElement(%s, %s), %s);",
@@ -163,10 +163,9 @@ private function executeJS($js) {
163163
echo "<pre>";
164164
echo $e->getMessage();
165165
echo "</pre>";
166-
die();
166+
die();
167167
}
168168
}
169169
}
170170

171171
}
172-

0 commit comments

Comments
 (0)