Skip to content

Commit d18e995

Browse files
committed
Merge branch '3.4' into 4.0
* 3.4: Fixed typo Improved variable naming
2 parents 1ffb8dc + efc7e32 commit d18e995

File tree

10 files changed

+24
-24
lines changed

10 files changed

+24
-24
lines changed

best_practices/business-logic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ looking for mapping information::
160160
*/
161161
class Post
162162
{
163-
const NUM_ITEMS = 10;
163+
const NUMBER_OF_ITEMS = 10;
164164

165165
/**
166166
* @ORM\Id

components/form.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ Your integration with the Validation component will look something like this::
309309
use Symfony\Component\Validator\Validation;
310310

311311
$vendorDirectory = realpath(__DIR__.'/../vendor');
312-
$vendorFormDirectory = $vendorDir.'/symfony/form';
312+
$vendorFormDirectory = $vendorDirectory.'/symfony/form';
313313
$vendorValidatorDirectory = $vendorDirectory.'/symfony/validator';
314314

315315
// creates the validator - details will vary

components/serializer.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,14 +447,14 @@ and :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`::
447447

448448
$serializer = new Serializer(array($normalizer), array(new JsonEncoder()));
449449

450-
$obj = new Company();
451-
$obj->name = 'Acme Inc.';
452-
$obj->address = '123 Main Street, Big City';
450+
$company = new Company();
451+
$company->name = 'Acme Inc.';
452+
$company->address = '123 Main Street, Big City';
453453

454-
$json = $serializer->serialize($obj, 'json');
454+
$json = $serializer->serialize($company, 'json');
455455
// {"org_name": "Acme Inc.", "org_address": "123 Main Street, Big City"}
456-
$objCopy = $serializer->deserialize($json, Company::class, 'json');
457-
// Same data as $obj
456+
$companyCopy = $serializer->deserialize($json, Company::class, 'json');
457+
// Same data as $company
458458

459459
.. _using-camelized-method-names-for-underscored-attributes:
460460

controller/soap_web_service.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Below is an example calling the service using a `NuSOAP`_ client. This example
9999
assumes that the ``index()`` method in the controller above is accessible via
100100
the route ``/soap``::
101101

102-
$soapClient = new \Soapclient('http://example.com/index.php/soap?wsdl');
102+
$soapClient = new \SoapClient('http://example.com/index.php/soap?wsdl');
103103

104104
$result = $soapClient->call('hello', array('name' => 'Scott'));
105105

form/unit_testing.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,20 @@ make sure the ``FormRegistry`` uses the created instance::
129129

130130
class TestedTypeTest extends TypeTestCase
131131
{
132-
private $entityManager;
132+
private $objectManager;
133133

134134
protected function setUp()
135135
{
136136
// mock any dependencies
137-
$this->entityManager = $this->createMock(ObjectManager::class);
137+
$this->objectManager = $this->createMock(ObjectManager::class);
138138

139139
parent::setUp();
140140
}
141141

142142
protected function getExtensions()
143143
{
144144
// create a type instance with the mocked dependencies
145-
$type = new TestedType($this->entityManager);
145+
$type = new TestedType($this->objectManager);
146146

147147
return array(
148148
// register the type instances with the PreloadedExtension

routing/custom_route_loader.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ and configure the service and method to call:
9595
// app/config/routing.php
9696
use Symfony\Component\Routing\RouteCollection;
9797
98-
$collection = new RouteCollection();
99-
$collection->addCollection(
98+
$routes = new RouteCollection();
99+
$routes->addCollection(
100100
$loader->import("admin_route_loader:loadRoutes", "service")
101101
);
102102
103-
return $collection;
103+
return $routes;
104104
105105
In this example, the routes are loaded by calling the ``loadRoutes()`` method of
106106
the service whose ID is ``admin_route_loader``. Your service doesn't have to

security/custom_password_authenticator.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ the user::
5252
throw new CustomUserMessageAuthenticationException('Invalid username or password');
5353
}
5454

55-
$passwordValid = $this->encoder->isPasswordValid($user, $token->getCredentials());
55+
$isPasswordValid = $this->encoder->isPasswordValid($user, $token->getCredentials());
5656

57-
if ($passwordValid) {
57+
if ($isPasswordValid) {
5858
$currentHour = date('G');
5959
if ($currentHour < 14 || $currentHour > 16) {
6060
// CAUTION: this message will be returned to the client
@@ -132,7 +132,7 @@ inside of it.
132132

133133
Inside this method, the password encoder is needed to check the password's validity::
134134

135-
$passwordValid = $this->encoder->isPasswordValid($user, $token->getCredentials());
135+
$isPasswordValid = $this->encoder->isPasswordValid($user, $token->getCredentials());
136136

137137
This is a service that is already available in Symfony and it uses the password algorithm
138138
that is configured in the security configuration (e.g. ``security.yaml``) under

security/expressions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ Additionally, you have access to a number of functions inside the expression:
7676
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
7777
// ...
7878

79-
public function index(AuthorizationCheckerInterface $auth)
79+
public function index(AuthorizationCheckerInterface $authorizationChecker)
8080
{
81-
$access1 = $auth->isGranted('IS_AUTHENTICATED_REMEMBERED');
81+
$access1 = $authorizationChecker->isGranted('IS_AUTHENTICATED_REMEMBERED');
8282

83-
$access2 = $auth->isGranted(new Expression(
83+
$access2 = $authorizationChecker->isGranted(new Expression(
8484
'is_remember_me() or is_fully_authenticated()'
8585
));
8686
}

security/guard_authentication.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ Customizing Error Messages
427427
--------------------------
428428

429429
When ``onAuthenticationFailure()`` is called, it is passed an ``AuthenticationException``
430-
that describes *how* authentication failed via its ``$e->getMessageKey()`` (and
431-
``$e->getMessageData()``) method. The message will be different based on *where*
430+
that describes *how* authentication failed via its ``$exception->getMessageKey()`` (and
431+
``$exception->getMessageData()``) method. The message will be different based on *where*
432432
authentication fails (i.e. ``getUser()`` versus ``checkCredentials()``).
433433

434434
But, you can easily return a custom message by throwing a

service_container/shared.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ in your service definition:
3737
$container->register(SomeNonSharedService::class)
3838
->setShared(false);
3939
40-
Now, whenever you request an the ``App\SomeNonSharedService`` from the container,
40+
Now, whenever you request the ``App\SomeNonSharedService`` from the container,
4141
you will be passed a new instance.

0 commit comments

Comments
 (0)