Skip to content

Commit

Permalink
Correct grammar mistakes. (#41426)
Browse files Browse the repository at this point in the history
Co-authored-by: Leo <contact@leonguyen.com>
  • Loading branch information
LeoNguyenHQ and Leo committed Mar 11, 2022
1 parent a7b21b8 commit f691533
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 40 deletions.
6 changes: 3 additions & 3 deletions src/Illuminate/Auth/DatabaseUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ public function retrieveByCredentials(array $credentials)
}
}

// Now we are ready to execute the query to see if we have an user matching
// the given credentials. If not, we will just return nulls and indicate
// that there are no matching users for these given credential arrays.
// Now we are ready to execute the query to see if we have a user matching
// the given credentials. If not, we will just return null and indicate
// that there are no matching users from the given credential arrays.
$user = $query->first();

return $this->getGenericUser($user);
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Concerns/ManagesTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function transaction(Closure $callback, $attempts = 1)

// If we catch an exception we'll rollback this transaction and try again if we
// are not out of attempts. If we are out of attempts we will just throw the
// exception back out and let the developer handle an uncaught exceptions.
// exception back out, and let the developer handle an uncaught exception.
catch (Throwable $e) {
$this->handleTransactionException(
$e, $currentAttempt, $attempts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function handle()
}

/**
* Get the status for the given ran migrations.
* Get the status for the given run migrations.
*
* @param array $ran
* @param array $batches
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,16 +345,16 @@ public function relationsToArray()
$attributes = [];

foreach ($this->getArrayableRelations() as $key => $value) {
// If the values implements the Arrayable interface we can just call this
// If the values implement the Arrayable interface we can just call this
// toArray method on the instances which will convert both models and
// collections to their proper array form and we'll set the values.
if ($value instanceof Arrayable) {
$relation = $value->toArray();
}

// If the value is null, we'll still go ahead and set it in this list of
// attributes since null is used to represent empty relationships if
// if it a has one or belongs to type relationships on the models.
// attributes, since null is used to represent empty relationships if
// it has a has one or belongs to type relationships on the models.
elseif (is_null($value)) {
$relation = $value;
}
Expand Down
12 changes: 6 additions & 6 deletions src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ public function belongsTo($related, $foreignKey = null, $ownerKey = null, $relat
$foreignKey = Str::snake($relation).'_'.$instance->getKeyName();
}

// Once we have the foreign key names, we'll just create a new Eloquent query
// for the related models and returns the relationship instance which will
// actually be responsible for retrieving and hydrating every relations.
// Once we have the foreign key names we'll just create a new Eloquent query
// for the related models and return the relationship instance which will
// actually be responsible for retrieving and hydrating every relation.
$ownerKey = $ownerKey ?: $instance->getKeyName();

return $this->newBelongsTo(
Expand Down Expand Up @@ -554,9 +554,9 @@ public function morphToMany($related, $name, $table = null, $foreignPivotKey = n

$relatedPivotKey = $relatedPivotKey ?: $instance->getForeignKey();

// Now we're ready to create a new query builder for this related model and
// the relationship instances for this relation. This relations will set
// appropriate query constraints then entirely manages the hydrations.
// Now we're ready to create a new query builder for the related model and
// the relationship instances for this relation. This relation will set
// appropriate query constraints then entirely manage the hydrations.
if (! $table) {
$words = preg_split('/(_)/u', $name, -1, PREG_SPLIT_DELIM_CAPTURE);

Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ public function match(array $models, Collection $results, $relation)
*/
protected function buildDictionary(Collection $results)
{
// First we will build a dictionary of child models keyed by the foreign key
// of the relation so that we will easily and quickly match them to their
// parents without having a possibly slow inner loops for every models.
// First we'll build a dictionary of child models keyed by the foreign key
// of the relation so that we will easily and quickly match them to the
// parents without having a possibly slow inner loop for every model.
$dictionary = [];

foreach ($results as $result) {
Expand Down
16 changes: 8 additions & 8 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,9 +716,9 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
$value, $operator, func_num_args() === 2
);

// If the columns is actually a Closure instance, we will assume the developer
// wants to begin a nested where statement which is wrapped in parenthesis.
// We'll add that Closure to the query then return back out immediately.
// If the column is actually a Closure instance, we will assume the developer
// wants to begin a nested where statement which is wrapped in parentheses.
// We will add that Closure to the query and return back out immediately.
if ($column instanceof Closure && is_null($operator)) {
return $this->whereNested($column, $boolean);
}
Expand Down Expand Up @@ -1003,7 +1003,7 @@ public function whereIn($column, $values, $boolean = 'and', $not = false)
$type = $not ? 'NotIn' : 'In';

// If the value is a query builder instance we will assume the developer wants to
// look for any values that exists within this given query. So we will add the
// look for any values that exist within this given query. So, we will add the
// query accordingly so that this query is properly executed when it is run.
if ($this->isQueryable($values)) {
[$query, $bindings] = $this->createSub($values);
Expand All @@ -1022,7 +1022,7 @@ public function whereIn($column, $values, $boolean = 'and', $not = false)

$this->wheres[] = compact('type', 'column', 'values', 'boolean');

// Finally we'll add a binding for each values unless that value is an expression
// Finally, we'll add a binding for each value unless that value is an expression
// in which case we will just skip over it since it will be the query as a raw
// string and not as a parameterized place-holder to be replaced by the PDO.
$this->addBinding($this->cleanBindings($values), 'where');
Expand Down Expand Up @@ -2878,9 +2878,9 @@ public function exists()
$this->grammar->compileExists($this), $this->getBindings(), ! $this->useWritePdo
);

// If the results has rows, we will get the row and see if the exists column is a
// boolean true. If there is no results for this query we will return false as
// there are no rows for this query at all and we can return that info here.
// If the results have rows, we will get the row and see if the exists column is a
// boolean true. If there are no results for this query we will return false as
// there are no rows for this query at all, and we can return that info here.
if (isset($results[0])) {
$results = (array) $results[0];

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Schema/Grammars/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected function getColumns(Blueprint $blueprint)
$columns = [];

foreach ($blueprint->getAddedColumns() as $column) {
// Each of the column types have their own compiler functions which are tasked
// Each of the column types has their own compiler functions, which are tasked
// with turning the column definition into its SQL format for this platform
// used by the connection. The column's modifiers are compiled and added.
$sql = $this->wrap($column).' '.$this->getType($column);
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Queue/Capsule/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public function __construct(Container $container = null)
{
$this->setupContainer($container ?: new Container);

// Once we have the container setup, we will setup the default configuration
// options in the container "config" bindings. This just makes this queue
// manager behave correctly since all the correct binding are in place.
// Once we have the container setup, we will set up the default configuration
// options in the container "config" bindings. This'll just make the queue
// manager behave correctly since all the correct bindings are in place.
$this->setupDefaultConfiguration();

$this->setupManager();
Expand Down
8 changes: 4 additions & 4 deletions src/Illuminate/Queue/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ protected function stopWorkerIfLostConnection($e)
public function process($connectionName, $job, WorkerOptions $options)
{
try {
// First we will raise the before job event and determine if the job has already ran
// First we will raise the before job event and determine if the job has already run
// over its maximum attempt limits, which could primarily happen when this job is
// continually timing out and not actually throwing any exceptions from itself.
$this->raiseBeforeJobEvent($connectionName, $job);
Expand All @@ -422,9 +422,9 @@ public function process($connectionName, $job, WorkerOptions $options)
return $this->raiseAfterJobEvent($connectionName, $job);
}

// Here we will fire off the job and let it process. We will catch any exceptions so
// they can be reported to the developers logs, etc. Once the job is finished the
// proper events will be fired to let any listeners know this job has finished.
// Here we will fire off the job and let it process. We will catch any exceptions, so
// they can be reported to the developer's logs, etc. Once the job is finished the
// proper events will be fired to let any listeners know this job has completed.
$job->fire();

$this->raiseAfterJobEvent($connectionName, $job);
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Testing/Fluent/AssertableJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public static function fromArray(array $data): self
}

/**
* Create a new instance from a AssertableJsonString.
* Create a new instance from an AssertableJsonString.
*
* @param \Illuminate\Testing\AssertableJsonString $json
* @return static
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Validation/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ protected function addExtensions(Validator $validator)
$validator->addExtensions($this->extensions);

// Next, we will add the implicit extensions, which are similar to the required
// and accepted rule in that they are run even if the attributes is not in a
// array of data that is given to a validator instances via instantiation.
// and accepted rule in that they're run even if the attributes aren't in an
// array of data which is given to a validator instance via instantiation.
$validator->addImplicitExtensions($this->implicitExtensions);

$validator->addDependentExtensions($this->dependentExtensions);
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Validation/ValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static function withMessages(array $messages)
}

/**
* Create a error message summary from the validation errors.
* Create an error message summary from the validation errors.
*
* @param \Illuminate\Contracts\Validation\Validator $validator
* @return string
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/View/Compilers/ComponentTagCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ protected function componentString(string $component, array $attributes)
return [Str::camel($key) => $value];
});

// If the component doesn't exists as a class we'll assume it's a class-less
// If the component doesn't exist as a class, we'll assume it's a class-less
// component and pass the component as a view parameter to the data so it
// can be accessed within the component and we can render out the view.
if (! class_exists($class)) {
Expand Down Expand Up @@ -365,7 +365,7 @@ public function guessViewName($name)
*/
public function partitionDataAndAttributes($class, array $attributes)
{
// If the class doesn't exists, we'll assume it's a class-less component and
// If the class doesn't exist, we'll assume it is a class-less component and
// return all of the attributes as both data and attributes since we have
// now way to partition them. The user can exclude attributes manually.
if (! class_exists($class)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/View/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected function renderContents()
$contents = $this->getContents();

// Once we've finished rendering the view, we'll decrement the render count
// so that each sections get flushed out next time a view is created and
// so that each section gets flushed out next time a view is created and
// no old sections are staying around in the memory of an environment.
$this->factory->decrementRender();

Expand Down

0 comments on commit f691533

Please sign in to comment.