-
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.
- Loading branch information
Showing
12 changed files
with
208 additions
and
51 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
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,36 @@ | ||
# TwigSafeString | ||
|
||
- **class** `TwigSafeString` (`twig\TwigSafeString`) | ||
- **source** `twig/TwigSafeString.php` | ||
|
||
**Description** | ||
|
||
Value for raw text in templates. | ||
|
||
--- | ||
|
||
#### Methods | ||
|
||
- `->`[`__construct()`](#method-__construct) - _TwigSafeString constructor._ | ||
- `->`[`__toString()`](#method-__tostring) - _Returns a text of safe string_ | ||
|
||
--- | ||
# Methods | ||
|
||
<a name="method-__construct"></a> | ||
|
||
### __construct() | ||
```php | ||
__construct(string $text): void | ||
``` | ||
TwigSafeString constructor. | ||
|
||
--- | ||
|
||
<a name="method-__tostring"></a> | ||
|
||
### __toString() | ||
```php | ||
__toString(): string | ||
``` | ||
Returns a text of safe string |
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,36 @@ | ||
# TwigSafeString | ||
|
||
- **класс** `TwigSafeString` (`twig\TwigSafeString`) | ||
- **исходники** `twig/TwigSafeString.php` | ||
|
||
**Описание** | ||
|
||
Value for raw text in templates. | ||
|
||
--- | ||
|
||
#### Методы | ||
|
||
- `->`[`__construct()`](#method-__construct) - _TwigSafeString constructor._ | ||
- `->`[`__toString()`](#method-__tostring) - _Returns a text of safe string_ | ||
|
||
--- | ||
# Методы | ||
|
||
<a name="method-__construct"></a> | ||
|
||
### __construct() | ||
```php | ||
__construct(string $text): void | ||
``` | ||
TwigSafeString constructor. | ||
|
||
--- | ||
|
||
<a name="method-__tostring"></a> | ||
|
||
### __toString() | ||
```php | ||
__toString(): string | ||
``` | ||
Returns a text of safe string |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
namespace twig; | ||
|
||
/** | ||
* Value for raw text in templates. | ||
* @package twig | ||
*/ | ||
class TwigSafeString | ||
{ | ||
/** | ||
* TwigSafeString constructor. | ||
* @param string $text | ||
*/ | ||
public function __construct(string $text) | ||
{ | ||
} | ||
|
||
/** | ||
* Returns a text of safe string | ||
* @return string | ||
*/ | ||
public function __toString(): string | ||
{ | ||
} | ||
} |
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
30 changes: 30 additions & 0 deletions
30
src-jvm/main/java/php/pkg/twig/classes/TwigSafeString.java
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,30 @@ | ||
package php.pkg.twig.classes; | ||
|
||
import com.mitchellbosecke.pebble.extension.escaper.SafeString; | ||
import php.pkg.twig.TwigExtension; | ||
import php.runtime.annotation.Reflection.Namespace; | ||
import php.runtime.annotation.Reflection.Signature; | ||
import php.runtime.env.Environment; | ||
import php.runtime.lang.BaseWrapper; | ||
import php.runtime.reflection.ClassEntity; | ||
|
||
@Namespace(TwigExtension.NS) | ||
public class TwigSafeString extends BaseWrapper<SafeString> { | ||
public TwigSafeString(Environment env, SafeString wrappedObject) { | ||
super(env, wrappedObject); | ||
} | ||
|
||
public TwigSafeString(Environment env, ClassEntity clazz) { | ||
super(env, clazz); | ||
} | ||
|
||
@Signature | ||
public void __construct(String str) { | ||
__wrappedObject = new SafeString(str); | ||
} | ||
|
||
@Signature | ||
public String __toString() { | ||
return getWrappedObject().toString(); | ||
} | ||
} |
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.