-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from xp-forge/feature/each-with-params
Add support for `each` with block params
- Loading branch information
Showing
8 changed files
with
182 additions
and
136 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php namespace com\handlebarsjs; | ||
|
||
use lang\Value; | ||
use util\Objects; | ||
|
||
class BlockParams implements Value { | ||
public $names; | ||
|
||
/** | ||
* Creates a new constant | ||
* | ||
* @param string[] $names | ||
*/ | ||
public function __construct($names) { | ||
$this->names= $names; | ||
} | ||
|
||
/** | ||
* (string) cast overloading | ||
* | ||
* @return string | ||
*/ | ||
public function __toString() { | ||
return 'as |'.implode(' ', $this->names).'|'; | ||
} | ||
|
||
/** | ||
* Compares | ||
* | ||
* @param var $value | ||
* @return int | ||
*/ | ||
public function compareTo($value) { | ||
return $value instanceof self ? Objects::compare($this->names, $value->names) : 1; | ||
} | ||
|
||
/** @return string */ | ||
public function hashCode() { | ||
return Objects::hashOf($this->names); | ||
} | ||
|
||
/** @return string */ | ||
public function toString() { | ||
return nameof($this).'('.implode(' ', $this->names).')'; | ||
} | ||
} |
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
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
Oops, something went wrong.