Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev code clean up and moving components to a namespace.
- Loading branch information
Showing
92 changed files
with
811 additions
and
786 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
<?php | ||
namespace ls\components; | ||
|
||
/** | ||
* This class wraps a Closure and returns the closures' result when serialized to string. | ||
* Class DeferredValue | ||
* Class ls\components\DeferredValue | ||
*/ | ||
class DeferredValue { | ||
class DeferredValue | ||
{ | ||
private $closure; | ||
public function __construct(\Closure $closure) { | ||
|
||
public function __construct(\Closure $closure) | ||
{ | ||
$this->closure = $closure; | ||
} | ||
|
||
public function __toString() { | ||
public function __toString() | ||
{ | ||
$result = call_user_func($this->closure); | ||
|
||
return "" . $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.