Skip to content

Commit 9f3a00b

Browse files
committed
Merge branch '5.3' into 5.4
* 5.3: Include match examples in the code block Update unit_testing.rst Update extension.rst Typo Fixed email link issue call `fetchAllAssociative` for a result set Moving RexExp search to its own heading
2 parents f0d803f + 2729567 commit 9f3a00b

File tree

6 files changed

+21
-10
lines changed

6 files changed

+21
-10
lines changed

bundles/extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This is how the extension of an AcmeHelloBundle should look like::
3434
namespace Acme\HelloBundle\DependencyInjection;
3535

3636
use Symfony\Component\DependencyInjection\ContainerBuilder;
37-
use Symfony\Component\DependencyInjection\Extension\Extension;
37+
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
3838

3939
class AcmeHelloExtension extends Extension
4040
{

components/string.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,15 @@ Methods to Search and Replace
333333
// checks if the string contents are exactly the same as the given contents
334334
u('foo')->equalsTo('foo'); // true
335335

336-
// checks if the string content match the given regular expression
336+
// checks if the string content match the given regular expression.
337+
// You can pass flags for preg_match() as second argument. If PREG_PATTERN_ORDER
338+
// or PREG_SET_ORDER are passed, preg_match_all() will be used.
337339
u('avatar-73647.png')->match('/avatar-(\d+)\.png/');
338340
// result = ['avatar-73647.png', '73647']
341+
u('avatar-73647.png')->match('/avatar-(\d+)(-\d+)?\.png/', \PREG_UNMATCHED_AS_NULL);
342+
// result = ['avatar-73647.png', '73647', null]
343+
u('206-555-0100 and 800-555-1212')->match('/\d{3}-\d{3}-\d{4}/', \PREG_PATTERN_ORDER);
344+
// result = [['206-555-0100', '800-555-1212']]
339345

340346
// checks if the string contains any of the other given strings
341347
u('aeiou')->containsAny('a'); // true

contributing/code_of_conduct/care_team.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Members
2121

2222
Here are all the members of the CARE team (in alphabetic order). You can contact
2323
any of them directly using the contact details below or you can also contact all
24-
of them at once by emailing **[email protected]**:
24+
of them at once by emailing ** [email protected] **.
2525
2626
* **Timo Bakx**
2727

create_framework/unit_testing.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ on it will exhibit the same bugs. The good news is that whenever you fix a
88
bug, you are fixing a bunch of applications too.
99

1010
Today's mission is to write unit tests for the framework we have created by
11-
using `PHPUnit`_. Create a PHPUnit configuration file in
12-
``example.com/phpunit.xml.dist``:
11+
using `PHPUnit`_. At first, install PHPUnit as a development dependency:
12+
13+
.. code-block:: terminal
14+
15+
$ composer require --dev phpunit/phpunit
16+
17+
Then, create a PHPUnit configuration file in ``example.com/phpunit.xml.dist``:
1318

1419
.. code-block:: xml
1520

doctrine.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,10 +848,10 @@ In addition, you can query directly with SQL if you need to::
848848
ORDER BY p.price ASC
849849
';
850850
$stmt = $conn->prepare($sql);
851-
$stmt->executeQuery(['price' => $price]);
851+
$resultSet = $stmt->executeQuery(['price' => $price]);
852852

853853
// returns an array of arrays (i.e. a raw data set)
854-
return $stmt->fetchAllAssociative();
854+
return $resultSet->fetchAllAssociative();
855855
}
856856
}
857857

translation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,12 +755,12 @@ now use the following commands to push (upload) and pull (download) translations
755755
# push new local translations to the Loco provider for the French locale
756756
# and the validators domain.
757757
# it will **not** update existing translations already on the provider.
758-
$ php bin/console translation:push loco --locales fr --domain validators
758+
$ php bin/console translation:push loco --locales fr --domains validators
759759
760760
# push new local translations and delete provider's translations that not
761761
# exists anymore in local files for the French locale and the validators domain.
762762
# it will **not** update existing translations already on the provider.
763-
$ php bin/console translation:push loco --delete-missing --locales fr --domain validators
763+
$ php bin/console translation:push loco --delete-missing --locales fr --domains validators
764764
765765
# check out the command help to see its options (format, domains, locales, etc.)
766766
$ php bin/console translation:push --help
@@ -775,7 +775,7 @@ now use the following commands to push (upload) and pull (download) translations
775775
# pull new translations from the Loco provider to local files for the French
776776
# locale and the validators domain.
777777
# it will **not** overwrite your local files, only add new translations.
778-
$ php bin/console translation:pull loco --locales fr --domain validators
778+
$ php bin/console translation:pull loco --locales fr --domains validators
779779
780780
# check out the command help to see its options (format, domains, locales, intl-icu, etc.)
781781
$ php bin/console translation:pull --help

0 commit comments

Comments
 (0)