aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2015-05-18 09:49:37 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2015-05-18 09:49:37 +0200
commitcedbbdb85a5897e48e276ada329242d48dd719d9 (patch)
treeedca9fd34da51311413702cd74e579b19629c4fe /Documentation
parent8df23c4758c8a692d523c966c7b9b79bbf9771c3 (diff)
downloadUstring-cedbbdb85a5897e48e276ada329242d48dd719d9.zip
Ustring-cedbbdb85a5897e48e276ada329242d48dd719d9.tar.gz
Ustring-cedbbdb85a5897e48e276ada329242d48dd719d9.tar.bz2
Move to PSR-1 and PSR-2.
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/En/Index.xyl18
-rw-r--r--Documentation/Fr/Index.xyl18
2 files changed, 20 insertions, 16 deletions
diff --git a/Documentation/En/Index.xyl b/Documentation/En/Index.xyl
index 1fd45ca..72182ac 100644
--- a/Documentation/En/Index.xyl
+++ b/Documentation/En/Index.xyl
@@ -205,10 +205,11 @@ echo $title->toAscii();
<pre><code class="language-php">$emoji = new Hoa\String\String('I ❤ Unicode');
$maths = new Hoa\String\String('∀ i ∈ ℕ');
-echo $arabic->toAscii(), "\n",
- $japanese->toAscii(), "\n",
- $emoji->toAscii(), "\n",
- $maths->toAscii(), "\n";
+echo
+ $arabic->toAscii(), "\n",
+ $japanese->toAscii(), "\n",
+ $emoji->toAscii(), "\n",
+ $maths->toAscii(), "\n";
/**
* Will output:
@@ -286,8 +287,9 @@ echo $arabic->toAscii(), "\n",
<code>IteratorAggregate</code> method, being the
<code>Hoa\String\String::getIterator</code> method. Let's see on the Arabic
example:</p>
- <pre><code class="language-php">foreach($arabic as $letter)
+ <pre><code class="language-php">foreach ($arabic as $letter) {
echo $letter, "\n";
+}
/**
* Will output:
@@ -392,8 +394,7 @@ var_dump($matches['direct_object']);
replacements to apply. If the replacement is a callable, then the
<code>preg_replace_callback</code> function will be used.</p>
<p>Thus, we will modify our French example to be more polite:</p>
- <pre><code class="language-php">$french->replace('#(?:\w[\'\b])(?&amp;lt;verb>aime)#', function ( $matches ) {
-
+ <pre><code class="language-php">$french->replace('#(?:\w[\'\b])(?&amp;lt;verb>aime)#', function ($matches) {
return 'vous ' . $matches['verb'];
});
@@ -545,8 +546,9 @@ $n = count($search);
echo 'Try to match ', $x, ' in ', $y, ' with at most ', $k, ' difference(s):', "\n";
echo $n, ' match(es) found:', "\n";
-foreach($search as $position)
+foreach ($search as $position) {
echo ' • ', substr($y, $position['i'], $position['l'), "\n";
+}
/**
* Will output:
diff --git a/Documentation/Fr/Index.xyl b/Documentation/Fr/Index.xyl
index ca146c5..e16ae52 100644
--- a/Documentation/Fr/Index.xyl
+++ b/Documentation/Fr/Index.xyl
@@ -211,10 +211,11 @@ echo $title->toAscii();
<pre><code class="language-php">$emoji = new Hoa\String\String('I ❤ Unicode');
$maths = new Hoa\String\String('∀ i ∈ ℕ');
-echo $arabic->toAscii(), "\n",
- $japanese->toAscii(), "\n",
- $emoji->toAscii(), "\n",
- $maths->toAscii(), "\n";
+echo
+ $arabic->toAscii(), "\n",
+ $japanese->toAscii(), "\n",
+ $emoji->toAscii(), "\n",
+ $maths->toAscii(), "\n";
/**
* Will output:
@@ -294,8 +295,9 @@ echo $arabic->toAscii(), "\n",
<code>IteratorAggregate</code>, soit la méthode
<code>Hoa\String\String::getIterator</code>. Voyons plutôt sur l'exemple en
arabe :</p>
- <pre><code class="language-php">foreach($arabic as $letter)
+ <pre><code class="language-php">foreach ($arabic as $letter) {
echo $letter, "\n";
+}
/**
* Will output:
@@ -406,8 +408,7 @@ var_dump($matches['direct_object']);
alors la fonction <code>preg_replace_callback</code> sera utilisée.</p>
<p>Ainsi, nous allons modifier notre exemple français pour qu'il soit plus
poli :</p>
- <pre><code class="language-php">$french->replace('#(?:\w[\'\b])(?&amp;lt;verb>aime)#', function ( $matches ) {
-
+ <pre><code class="language-php">$french->replace('#(?:\w[\'\b])(?&amp;lt;verb>aime)#', function ($matches) {
return 'vous ' . $matches['verb'];
});
@@ -561,8 +562,9 @@ $n = count($search);
echo 'Try to match ', $x, ' in ', $y, ' with at most ', $k, ' difference(s):', "\n";
echo $n, ' match(es) found:', "\n";
-foreach($search as $position)
+foreach ($search as $position) {
echo ' • ', substr($y, $position['i'], $position['l'), "\n";
+}
/**
* Will output: