Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TMP] Enhance PHPDoc #2583

Draft
wants to merge 14 commits into
base: 4.6
Choose a base branch
from
Prev Previous commit
Next Next commit
Update changes from ibexa/core#463
  • Loading branch information
adriendupuis committed Feb 3, 2025
commit 87ab607b04cd03bc12cc6b754659fc8671639607
Original file line number Diff line number Diff line change
Expand Up @@ -39139,21 +39139,20 @@ <h4>Parameters</h4>
<h4>Return values</h4>
<p class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</p>
<section class="phpdocumentor-description">
<p>Hash with relation type as key and array of destination content ids as value.</p>
<p>Example:
<code class="prettyprint">
array(
\Ibexa\Contracts\Core\Repository\Values\Content\Relation::LINK =&gt; array(
&quot;contentIds&quot; =&gt; array( 12, 13, 14 ),
&quot;locationIds&quot; =&gt; array( 24 )
),
\Ibexa\Contracts\Core\Repository\Values\Content\Relation::EMBED =&gt; array(
&quot;contentIds&quot; =&gt; array( 12 ),
&quot;locationIds&quot; =&gt; array( 24, 45 )
),
\Ibexa\Contracts\Core\Repository\Values\Content\Relation::FIELD =&gt; array( 12 )
)
</code></p>
<p>Hash with relation type as key and array of destination content IDs as value.</p>
<p>Example:</p>
<pre class="prettyprint"><code class="prettyprint">[
\Ibexa\Contracts\Core\Repository\Values\Content\Relation::LINK =&gt; [
'contentIds' =&gt; [12, 13, 14],
'locationIds' =&gt; [24]
],
\Ibexa\Contracts\Core\Repository\Values\Content\Relation::EMBED =&gt; [
'contentIds&quot; =&gt; [12],
'locationIds' =&gt; [24, 45]
],
\Ibexa\Contracts\Core\Repository\Values\Content\Relation::FIELD =&gt; [12]
]
</code></pre>

</section>

Expand Down Expand Up @@ -39258,20 +39257,19 @@ <h3 id="method_getValidatorConfigurationSchema">
<p>Best practice:</p>
<p>It is considered best practice to return a hash map, which contains
rudimentary settings structures, like e.g. for the &quot;ezstring&quot; FieldType</p>
<code class="prettyprint">
array(
'stringLength' => array(
'minStringLength' => array(
'type' => 'int',
'default' => 0,
),
'maxStringLength' => array(
'type' => 'int'
'default' => null,
)
),
);
</code>
<pre class="prettyprint"><code class="prettyprint">[
'stringLength' =&gt; [
'minStringLength' =&gt; [
'type' =&gt; 'int',
'default' =&gt; 0,
],
'maxStringLength' =&gt; [
'type' =&gt; 'int'
'default' =&gt; null,
],
],
];
</code></pre>

</section>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39237,21 +39237,20 @@ <h4>Parameters</h4>
<h4>Return values</h4>
<p class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</p>
<section class="phpdocumentor-description">
<p>Hash with relation type as key and array of destination content ids as value.</p>
<p>Example:
<code class="prettyprint">
array(
\Ibexa\Contracts\Core\Repository\Values\Content\Relation::LINK =&gt; array(
&quot;contentIds&quot; =&gt; array( 12, 13, 14 ),
&quot;locationIds&quot; =&gt; array( 24 )
),
\Ibexa\Contracts\Core\Repository\Values\Content\Relation::EMBED =&gt; array(
&quot;contentIds&quot; =&gt; array( 12 ),
&quot;locationIds&quot; =&gt; array( 24, 45 )
),
\Ibexa\Contracts\Core\Repository\Values\Content\Relation::FIELD =&gt; array( 12 )
)
</code></p>
<p>Hash with relation type as key and array of destination content IDs as value.</p>
<p>Example:</p>
<pre class="prettyprint"><code class="prettyprint">[
\Ibexa\Contracts\Core\Repository\Values\Content\Relation::LINK =&gt; [
'contentIds' =&gt; [12, 13, 14],
'locationIds' =&gt; [24]
],
\Ibexa\Contracts\Core\Repository\Values\Content\Relation::EMBED =&gt; [
'contentIds&quot; =&gt; [12],
'locationIds' =&gt; [24, 45]
],
\Ibexa\Contracts\Core\Repository\Values\Content\Relation::FIELD =&gt; [12]
]
</code></pre>

</section>

Expand Down Expand Up @@ -39356,20 +39355,19 @@ <h3 id="method_getValidatorConfigurationSchema">
<p>Best practice:</p>
<p>It is considered best practice to return a hash map, which contains
rudimentary settings structures, like e.g. for the &quot;ezstring&quot; FieldType</p>
<code class="prettyprint">
array(
'stringLength' => array(
'minStringLength' => array(
'type' => 'int',
'default' => 0,
),
'maxStringLength' => array(
'type' => 'int'
'default' => null,
)
),
);
</code>
<pre class="prettyprint"><code class="prettyprint">[
'stringLength' =&gt; [
'minStringLength' =&gt; [
'type' =&gt; 'int',
'default' =&gt; 0,
],
'maxStringLength' =&gt; [
'type' =&gt; 'int'
'default' =&gt; null,
],
],
];
</code></pre>

</section>

Expand Down Expand Up @@ -40100,19 +40098,18 @@ <h3 id="method_checkValueType">
<div class="phpdocumentor-label-line">
</div>
<section class="phpdocumentor-description">
<p>This is an operation method for <abbr title="\Ibexa\Contracts\Core\FieldType\Generic\acceptValue()">acceptValue()</abbr>.</p>
<p>This is an operation method for <a href="classes/Ibexa-Contracts-Core-FieldType-Generic-Type.html#method_acceptValue"><abbr title="\Ibexa\Contracts\Core\FieldType\Generic\Type::acceptValue()">Type::acceptValue()</abbr></a>.</p>
<p>Default implementation expects the value class to reside in the same namespace as its
FieldType class and is named &quot;Value&quot;.</p>
<p>Example implementation:
<code class="prettyprint">
protected function checkValueType($value): void
{
if ( !$inputValue instanceof \My\FieldType\CookieJar\Value ) )
{
throw new InvalidArgumentException( &quot;Given value type is not supported.&quot; );
}
}
</code></p>
<p>Example implementation:</p>
<pre class="prettyprint"><code class="prettyprint"> protected function checkValueType($value): void
{
if (!$inputValue instanceof \My\FieldType\CookieJar\Value))
{
throw new InvalidArgumentException(&quot;Given value type isn't supported.&quot;);
}
}
</code></pre>

</section>
<h4>Parameters</h4>
Expand All @@ -40138,7 +40135,7 @@ <h4>Parameters</h4>
</td>
<td>
<section class="phpdocumentor-description">
<p>A value returned by <abbr title="\Ibexa\Contracts\Core\FieldType\Generic\createValueFromInput()">createValueFromInput()</abbr>.</p>
<p>A value returned by <a href="classes/Ibexa-Contracts-Core-FieldType-Generic-Type.html#method_createValueFromInput"><abbr title="\Ibexa\Contracts\Core\FieldType\Generic\Type::createValueFromInput()">Type::createValueFromInput()</abbr></a>.</p>

</section>

Expand Down Expand Up @@ -40202,19 +40199,18 @@ <h3 id="method_createValueFromInput">
<section class="phpdocumentor-description">
<p>If given $inputValue could not be converted or is already an instance of dedicate value object,
the method should simply return it.</p>
<p>This is an operation method for <abbr title="\Ibexa\Contracts\Core\FieldType\Generic\acceptValue()">acceptValue()</abbr>.</p>
<p>Example implementation:
<code class="prettyprint">
protected function createValueFromInput( $inputValue )
{
if ( is_array( $inputValue ) )
{
$inputValue = \My\FieldType\CookieJar\Value( $inputValue );
}</p>
<pre class="prettyprint"><code class="prettyprint"> return $inputValue;
<p>This is an operation method for <a href="classes/Ibexa-Contracts-Core-FieldType-Generic-Type.html#method_acceptValue"><abbr title="\Ibexa\Contracts\Core\FieldType\Generic\Type::acceptValue()">Type::acceptValue()</abbr></a>.</p>
<p>Example implementation:</p>
<pre class="prettyprint"><code class="prettyprint"> protected function createValueFromInput($inputValue)
{
if (is_array($inputValue))
{
$inputValue = \My\FieldType\CookieJar\Value($inputValue);
}

return $inputValue;
}
</code></pre>
<p>}
</code></p>

</section>
<h4>Parameters</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
<title>ConstraintViolationAdapter | PHP API Reference (Ibexa Documentation)</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{@see \Symfony\Component\Validator\ConstraintViolationInterface} to
{@see \Ibexa\Contracts\Core\FieldType\ValidationError} adapter." />
<meta name="description" content="Constraint violation validation error." />

<base href="../">
<link rel="icon" href="images/favicon.png"/>
Expand Down Expand Up @@ -38314,7 +38313,7 @@ <h1 id="ConstraintViolationAdapter">
<div class="content-header__found-in copy-to-clipboard" data-copy-value="vendor/ibexa/core/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php">
<abbr title="vendor/ibexa/core/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php">ConstraintViolationAdapter.php</abbr>
:
<span title="at line 20">20</span>
<span title="at line 22">22</span>
<img src="./images/copy.svg" title="Copy path" />
</div>

Expand All @@ -38324,10 +38323,14 @@ <h1 id="ConstraintViolationAdapter">
<a href="classes/Ibexa-Contracts-Core-FieldType-ValidationError.html"><abbr title="\Ibexa\Contracts\Core\FieldType\ValidationError">ValidationError</abbr></a> </div>

</div>
<p>{@see \Symfony\Component\Validator\ConstraintViolationInterface} to
{@see \Ibexa\Contracts\Core\FieldType\ValidationError} adapter.</p>
<p>Constraint violation validation error.</p>


<section class="phpdocumentor-description">
<p>Adapts <abbr title="\Symfony\Component\Validator\ConstraintViolationInterface">ConstraintViolationInterface</abbr> to
<a href="classes/Ibexa-Contracts-Core-FieldType-ValidationError.html"><abbr title="\Ibexa\Contracts\Core\FieldType\ValidationError">ValidationError</abbr></a>.</p>

</section>



Expand All @@ -38354,7 +38357,7 @@ <h3 id="method___construct">
<div class="content-header__found-in copy-to-clipboard" data-copy-value="vendor/ibexa/core/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php">
<abbr title="vendor/ibexa/core/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php">ConstraintViolationAdapter.php</abbr>
:
<span title="at line 35">35</span>
<span title="at line 37">37</span>
<img src="./images/copy.svg" title="Copy path" />
</div>
</div>
Expand Down Expand Up @@ -38415,7 +38418,7 @@ <h3 id="method_getTarget">
<div class="content-header__found-in copy-to-clipboard" data-copy-value="vendor/ibexa/core/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php">
<abbr title="vendor/ibexa/core/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php">ConstraintViolationAdapter.php</abbr>
:
<span title="at line 54">54</span>
<span title="at line 56">56</span>
<img src="./images/copy.svg" title="Copy path" />
</div>
</div>
Expand Down Expand Up @@ -38452,7 +38455,7 @@ <h3 id="method_getTranslatableMessage">
<div class="content-header__found-in copy-to-clipboard" data-copy-value="vendor/ibexa/core/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php">
<abbr title="vendor/ibexa/core/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php">ConstraintViolationAdapter.php</abbr>
:
<span title="at line 41">41</span>
<span title="at line 43">43</span>
<img src="./images/copy.svg" title="Copy path" />
</div>
</div>
Expand Down Expand Up @@ -38489,7 +38492,7 @@ <h3 id="method_setTarget">
<div class="content-header__found-in copy-to-clipboard" data-copy-value="vendor/ibexa/core/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php">
<abbr title="vendor/ibexa/core/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php">ConstraintViolationAdapter.php</abbr>
:
<span title="at line 49">49</span>
<span title="at line 51">51</span>
<img src="./images/copy.svg" title="Copy path" />
</div>
</div>
Expand Down
Loading