Skip to content

Commit c940ac8

Browse files
committed
Deploying to gh-pages from @ 68e218f 🚀
1 parent 38a63b0 commit c940ac8

File tree

7 files changed

+67
-67
lines changed

7 files changed

+67
-67
lines changed

macros/classes.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ <h2 id="options"><a class="header" href="#options">Options</a></h2>
177177
<li><code>name</code> - Changes the name of the class when exported to PHP. The Rust struct
178178
name is kept the same. If no name is given, the name of the struct is used.
179179
Useful for namespacing classes.</li>
180-
<li><code>rename</code> - Changes the case of the class name when exported to PHP.</li>
180+
<li><code>change_case</code> - Changes the case of the class name when exported to PHP.</li>
181181
<li><code>#[php(extends(ce = ce_fn, stub = "ParentClass"))]</code> - Sets the parent class of the class. Can only be used once.
182182
<code>ce_fn</code> must be a function with the signature <code>fn() -&gt; &amp;'static ClassEntry</code>.</li>
183183
<li><code>#[php(implements(ce = ce_fn, stub = "InterfaceName"))]</code> - Implements the given interface on the class. Can be used
@@ -192,8 +192,8 @@ <h2 id="options"><a class="header" href="#options">Options</a></h2>
192192
<ul>
193193
<li><code>name</code> - Allows you to rename the property, e.g.
194194
<code>#[php(name = "new_name")]</code></li>
195-
<li><code>rename</code> - Allows you to rename the property using rename rules, e.g.
196-
<code>#[php(rename = PascalCase)]</code></li>
195+
<li><code>change_case</code> - Allows you to rename the property using rename rules, e.g.
196+
<code>#[php(change_case = PascalCase)]</code></li>
197197
</ul>
198198
<h2 id="restrictions"><a class="header" href="#restrictions">Restrictions</a></h2>
199199
<h3 id="no-lifetime-parameters"><a class="header" href="#no-lifetime-parameters">No lifetime parameters</a></h3>

macros/constant.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ <h1 id="php_const-attribute"><a class="header" href="#php_const-attribute"><code
175175
<ul>
176176
<li><code>name</code> - Allows you to rename the property, e.g.
177177
<code>#[php(name = "new_name")]</code></li>
178-
<li><code>rename</code> - Allows you to rename the property using rename rules, e.g.
179-
<code>#[php(rename = PascalCase)]</code></li>
178+
<li><code>change_case</code> - Allows you to rename the property using rename rules, e.g.
179+
<code>#[php(change_case = PascalCase)]</code></li>
180180
</ul>
181181
<h2 id="examples"><a class="header" href="#examples">Examples</a></h2>
182182
<pre><pre class="playground"><code class="language-rust no_run"><span class="boring">#![cfg_attr(windows, feature(abi_vectorcall))]

macros/impl.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,14 @@ <h1 id="php_impl-attribute"><a class="header" href="#php_impl-attribute"><code>#
176176
<code>impl</code> block.</p>
177177
<p>If you want to use async Rust, use <code>#[php_async_impl]</code>, instead: see <a href="./async_impl.html">here »</a> for more info.</p>
178178
<h2 id="options"><a class="header" href="#options">Options</a></h2>
179-
<p>By default all constants are renamed to UPPER_CASE and all methods are renamed to
180-
camelCase. This can be changed by passing the <code>rename_methods</code> and
181-
<code>rename_constants</code> as <code>#[php]</code> attributes on the <code>impl</code> block. The options are:</p>
179+
<p>By default all constants are renamed to <code>UPPER_CASE</code> and all methods are renamed to
180+
camelCase. This can be changed by passing the <code>change_method_case</code> and
181+
<code>change_constant_case</code> as <code>#[php]</code> attributes on the <code>impl</code> block. The options are:</p>
182182
<ul>
183-
<li><code>#[php(rename_methods = "snake_case")]</code> - Renames the method to snake case.</li>
184-
<li><code>#[php(rename_constants = "snake_case")]</code> - Renames the constant to snake case.</li>
183+
<li><code>#[php(change_method_case = "snake_case")]</code> - Renames the method to snake case.</li>
184+
<li><code>#[php(change_constant_case = "snake_case")]</code> - Renames the constant to snake case.</li>
185185
</ul>
186-
<p>See the <a href="./php.html#name-and-rename"><code>name</code> and <code>rename</code></a> section for a list of all
186+
<p>See the <a href="./php.html#name-and-change_case"><code>name</code> and <code>change_case</code></a> section for a list of all
187187
available cases.</p>
188188
<h2 id="methods"><a class="header" href="#methods">Methods</a></h2>
189189
<p>Methods basically follow the same rules as functions, so read about the
@@ -227,8 +227,8 @@ <h2 id="property-getters-and-setters"><a class="header" href="#property-getters-
227227
setters. This is done with the <code>#[php(getter)]</code> and <code>#[php(setter)]</code> attributes. By
228228
default, the <code>get_</code> or <code>set_</code> prefix is trimmed from the start of the function
229229
name, and the remainder is used as the property name.</p>
230-
<p>If you want to use a different name for the property, you can pass a <code>rename</code>
231-
option to the attribute which will change the property name.</p>
230+
<p>If you want to use a different name for the property, you can pass a <code>name</code> or
231+
<code>change_case</code> option to the <code>#[php]</code> attribute which will change the property name.</p>
232232
<p>Properties do not necessarily have to have both a getter and a setter, if the
233233
property is immutable the setter can be omitted, and vice versa for getters.</p>
234234
<p>The <code>#[php(getter)]</code> and <code>#[php(setter)]</code> attributes are mutually exclusive on methods.

macros/php.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ <h1 id="php-attributes"><a class="header" href="#php-attributes"><code>#[php]</c
191191
}
192192
<span class="boring">fn main() {}</span></code></pre></pre>
193193
<p>Which attributes are available depends on the element you are annotating:</p>
194-
<div class="table-wrapper"><table><thead><tr><th>Attribute</th><th><code>const</code></th><th><code>fn</code></th><th><code>struct</code></th><th><code>struct</code> Field</th><th><code>impl</code></th><th><code>impl</code> <code>const</code></th><th><code>impl</code> <code>fn</code></th></tr></thead><tbody>
194+
<div class="table-wrapper"><table><thead><tr><th>Attribute</th><th><code>const</code></th><th><code>fn</code></th><th><code>struct</code></th><th><code>struct</code> field</th><th><code>impl</code></th><th><code>impl</code> <code>const</code></th><th><code>impl</code> <code>fn</code></th></tr></thead><tbody>
195195
<tr><td>name</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
196-
<tr><td>rename</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
197-
<tr><td>rename_methods</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
198-
<tr><td>rename_constants</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
196+
<tr><td>change_case</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
197+
<tr><td>change_method_case</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
198+
<tr><td>change_constant_case</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
199199
<tr><td>flags</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
200200
<tr><td>prop</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
201201
<tr><td>extends</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
@@ -210,11 +210,11 @@ <h1 id="php-attributes"><a class="header" href="#php-attributes"><code>#[php]</c
210210
<tr><td>abstract_method</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
211211
</tbody></table>
212212
</div>
213-
<h2 id="name-and-rename"><a class="header" href="#name-and-rename"><code>name</code> and <code>rename</code></a></h2>
214-
<p><code>name</code> and <code>rename</code> are mutually exclusive. The <code>name</code> attribute is used to set the name of
215-
an item to a string literal. The <code>rename</code> attribute is used to change the case of the name.</p>
213+
<h2 id="name-and-change_case"><a class="header" href="#name-and-change_case"><code>name</code> and <code>change_case</code></a></h2>
214+
<p><code>name</code> and <code>change_case</code> are mutually exclusive. The <code>name</code> attribute is used to set the name of
215+
an item to a string literal. The <code>change_case</code> attribute is used to change the case of the name.</p>
216216
<pre><code class="language-rs">#[php(name = "NEW_NAME")]
217-
#[php(rename = snake_case)]]
217+
#[php(change_case = snake_case)]]
218218
</code></pre>
219219
<p>Available cases are:</p>
220220
<ul>

migration-guides/v0.14.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ <h3 id="functions"><a class="header" href="#functions">Functions</a></h3>
205205
<p><strong>Supported <code>#[php]</code> attributes:</strong></p>
206206
<ul>
207207
<li><code>#[php(name = "NEW_NAME")]</code> - Renames the function</li>
208-
<li><code>#[php(rename = case)]</code> - Changes the case of the function name</li>
208+
<li><code>#[php(change_case = case)]</code> - Changes the case of the function name</li>
209209
<li><code>#[php(vis = "public")]</code> - Changes the visibility of the function</li>
210210
<li><code>#[php(defaults(a = 5, test = 100))]</code> - Sets default values for function arguments</li>
211211
<li><code>#[php(variadic)]</code> - Marks the function as variadic. The last argument must be a <code>&amp;[&amp;Zval]</code></li>
@@ -259,16 +259,16 @@ <h3 id="classes"><a class="header" href="#classes">Classes</a></h3>
259259
<p><strong>Supported <code>#[php]</code> attributes (<code>struct</code>):</strong></p>
260260
<ul>
261261
<li><code>#[php(name = "NEW_NAME")]</code> - Renames the class</li>
262-
<li><code>#[php(rename = case)]</code> - Changes the case of the class name</li>
262+
<li><code>#[php(change_case = case)]</code> - Changes the case of the class name</li>
263263
<li><code>#[php(vis = "public")]</code> - Changes the visibility of the class</li>
264264
<li><code>#[php(extends(ce = ce_fn, stub = "ParentClass")]</code> - Extends a parent class</li>
265265
<li><code>#[php(implements(ce = ce_fn, stub = "Interface"))]</code> - Implements an interface</li>
266266
<li><code>#[php(prop)]</code> - Marks a field as a property</li>
267267
</ul>
268268
<p><strong>Supported <code>#[php]</code> attributes (<code>impl</code>):</strong></p>
269269
<ul>
270-
<li><code>#[php(rename_consts = case)]</code> - Changes the case of the constant names. Can be overridden by attributes on the constants.</li>
271-
<li><code>#[php(rename_methods = case)]</code> - Changes the case of the method names. Can be overridden by attributes on the methods.</li>
270+
<li><code>#[php(change_constant_case = case)]</code> - Changes the case of the constant names. Can be overridden by attributes on the constants.</li>
271+
<li><code>#[php(change_method_case = case)]</code> - Changes the case of the method names. Can be overridden by attributes on the methods.</li>
272272
</ul>
273273
<p>For elements in the <code>#[php_impl]</code> block see the respective function and constant attributes.</p>
274274
<h4 id="extends-and-implements"><a class="header" href="#extends-and-implements">Extends and Implements</a></h4>
@@ -298,7 +298,7 @@ <h3 id="constants"><a class="header" href="#constants">Constants</a></h3>
298298
<p><strong>Supported <code>#[php]</code> attributes:</strong></p>
299299
<ul>
300300
<li><code>#[php(name = "NEW_NAME")]</code> - Renames the constant</li>
301-
<li><code>#[php(rename = case)]</code> - Changes the case of the constant name</li>
301+
<li><code>#[php(change_case = case)]</code> - Changes the case of the constant name</li>
302302
<li><code>#[php(vis = "public")]</code> - Changes the visibility of the constant</li>
303303
</ul>
304304
<h3 id="extern"><a class="header" href="#extern">Extern</a></h3>
@@ -334,10 +334,10 @@ <h3 id="php-attributes"><a class="header" href="#php-attributes"><code>#[php]</c
334334
<p>Attributes like <code>#[rename]</code> or <code>#[prop]</code> have been moved to the <code>#[php]</code> attribute.</p>
335335
<p>The <code>#[php]</code> attribute on an item are combined with each other. This means that
336336
the following variants are equivalent:</p>
337-
<pre><code class="language-rs">#[php(rename = case)]
337+
<pre><code class="language-rs">#[php(change_case = case)]
338338
#[php(vis = "public")]
339339
</code></pre>
340-
<pre><code class="language-rs">#[php(rename = case, vis = "public")]
340+
<pre><code class="language-rs">#[php(change_case = case, vis = "public")]
341341
</code></pre>
342342
<h3 id="renaming-and-case-changes"><a class="header" href="#renaming-and-case-changes">Renaming and Case Changes</a></h3>
343343
<p>Default case was adjusted to match PSR standards:</p>
@@ -348,15 +348,15 @@ <h3 id="renaming-and-case-changes"><a class="header" href="#renaming-and-case-ch
348348
<li>Constant names are now <code>UPPER_CASE</code></li>
349349
<li>Function names are now <code>snake_case</code></li>
350350
</ul>
351-
<p>This can be changed using the <code>rename</code> attribute on the item.
352-
Additionally, the <code>rename_methods</code> and <code>rename_consts</code> attributes can be used
351+
<p>This can be changed using the <code>change_case</code> attribute on the item.
352+
Additionally, the <code>change_method_case</code> and <code>change_constant_case</code> attributes can be used
353353
to change the case of all methods and constants in a class.</p>
354-
<h4 id="name-vs-rename"><a class="header" href="#name-vs-rename"><code>name</code> vs <code>rename</code></a></h4>
354+
<h4 id="name-vs-change_case"><a class="header" href="#name-vs-change_case"><code>name</code> vs <code>change_case</code></a></h4>
355355
<p>Previously the (re)name parameter was used to rename items. This has been
356356
unified to use <code>name</code> to set the name of an item to a string literal. The
357-
<code>rename</code> parameter is now used to change the case of the name.</p>
357+
<code>change_case</code> parameter is now used to change the case of the name.</p>
358358
<pre><code class="language-rs">#[php(name = "NEW_NAME")]
359-
#[php(rename = snake_case)]]
359+
#[php(change_case = snake_case)]]
360360
</code></pre>
361361
<p>Available cases are:</p>
362362
<ul>

0 commit comments

Comments
 (0)