Skip to content

Commit 49d6cc0

Browse files
authored
[Php 8.1 Dep] Update stringy vendor patches to update with #[\ReturnTypeWillChange] (#1370)
* update stringy with vendor-patches * update stringy with vendor-patches
1 parent 922e91d commit 49d6cc0

2 files changed

Lines changed: 51 additions & 0 deletions

File tree

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@
154154
"patches": {
155155
"symfony/dependency-injection": [
156156
"patches/symfony-dependency-injection-loader-configurator-servicesconfigurator-php.patch"
157+
],
158+
"danielstjules/stringy": [
159+
"patches/danielstjules-stringy-src-stringy-php.patch"
157160
]
158161
},
159162
"branch-alias": {
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
--- /dev/null
2+
+++ ../src/Stringy.php
3+
@@ -267,6 +267,7 @@ class Stringy implements Countable, IteratorAggregate, ArrayAccess
4+
*
5+
* @return int The number of characters in the string, given the encoding
6+
*/
7+
+ #[\ReturnTypeWillChange]
8+
public function count()
9+
{
10+
return $this->length();
11+
@@ -450,6 +451,7 @@ class Stringy implements Countable, IteratorAggregate, ArrayAccess
12+
*
13+
* @return \ArrayIterator An iterator for the characters in the string
14+
*/
15+
+ #[\ReturnTypeWillChange]
16+
public function getIterator()
17+
{
18+
return new ArrayIterator($this->chars());
19+
@@ -847,6 +849,7 @@ class Stringy implements Countable, IteratorAggregate, ArrayAccess
20+
* @param mixed $offset The index to check
21+
* @return boolean Whether or not the index exists
22+
*/
23+
+ #[\ReturnTypeWillChange]
24+
public function offsetExists($offset)
25+
{
26+
$length = $this->length();
27+
@@ -870,6 +873,7 @@ class Stringy implements Countable, IteratorAggregate, ArrayAccess
28+
* @throws \OutOfBoundsException If the positive or negative offset does
29+
* not exist
30+
*/
31+
+ #[\ReturnTypeWillChange]
32+
public function offsetGet($offset)
33+
{
34+
$offset = (int) $offset;
35+
@@ -890,6 +894,7 @@ class Stringy implements Countable, IteratorAggregate, ArrayAccess
36+
* @param mixed $value Value to set
37+
* @throws \Exception When called
38+
*/
39+
+ #[\ReturnTypeWillChange]
40+
public function offsetSet($offset, $value)
41+
{
42+
// Stringy is immutable, cannot directly set char
43+
@@ -903,6 +908,7 @@ class Stringy implements Countable, IteratorAggregate, ArrayAccess
44+
* @param mixed $offset The index of the character
45+
* @throws \Exception When called
46+
*/
47+
+ #[\ReturnTypeWillChange]
48+
public function offsetUnset($offset)

0 commit comments

Comments
 (0)