Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 988d7ca

Browse files
committed
Merge branch 'master' into hassansin-master
2 parents fc3b9fc + 78b2a10 commit 988d7ca

32 files changed

Lines changed: 198 additions & 76 deletions

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ This page contains guidelines for contributing to the Laravel framework. Please
1010

1111
The pull request process differs for new features and bugs. Before sending a pull request for a new feature, you should first create an issue with `[Proposal]` in the title. The proposal should describe the new feature, as well as implementation ideas. The proposal will then be reviewed and either approved or denied. Once a proposal is approved, a pull request may be created implementing the new feature. Pull requests which do not follow this guideline will be closed immediately.
1212

13-
Pull requests for bugs may be sent without creating any proposal issue. If you believe that you know of a solution for a bug that has been filed on Github, please leave a comment detailing your proposed fix.
13+
Pull requests for bugs may be sent without creating any proposal issue. If you believe that you know of a solution for a bug that has been filed on GitHub, please leave a comment detailing your proposed fix.
1414

1515
### Feature Requests
1616

17-
If you have an idea for a new feature you would like to see added to Laravel, you may create an issue on Github with `[Request]` in the title. The feature request will then be reviewed by a core contributor.
17+
If you have an idea for a new feature you would like to see added to Laravel, you may create an issue on GitHub with `[Request]` in the title. The feature request will then be reviewed by a core contributor.
1818

1919
## Coding Guidelines
2020

src/Illuminate/Auth/Guard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ protected function refreshRememberToken(UserInterface $user)
551551
}
552552

553553
/**
554-
* Create a new remember token for the user if one doens't already exist.
554+
* Create a new remember token for the user if one doesn't already exist.
555555
*
556556
* @param \Illuminate\Auth\UserInterface $user
557557
* @return void

src/Illuminate/Config/FileEnvironmentVariablesLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class FileEnvironmentVariablesLoader implements EnvironmentVariablesLoaderInterf
2121
/**
2222
* Create a new file environment loader instance.
2323
*
24-
* @param \Illumiante\Filesystem\Filesystem $files
24+
* @param \Illuminate\Filesystem\Filesystem $files
2525
* @return void
2626
*/
2727
public function __construct(Filesystem $files, $path = null)

src/Illuminate/Container/Container.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,11 @@ protected function getConcrete($abstract)
455455
// since the container should be able to resolve concretes automatically.
456456
if ( ! isset($this->bindings[$abstract]))
457457
{
458+
if ($this->missingLeadingSlash($abstract) && isset($this->bindings['\\'.$abstract]))
459+
{
460+
$abstract = '\\'.$abstract;
461+
}
462+
458463
return $abstract;
459464
}
460465
else
@@ -463,6 +468,17 @@ protected function getConcrete($abstract)
463468
}
464469
}
465470

471+
/**
472+
* Determine if the given abstract has a leading slash.
473+
*
474+
* @param string $abstract
475+
* @return bool
476+
*/
477+
protected function missingLeadingSlash($abstract)
478+
{
479+
return is_string($abstract) && ! starts_with($abstract, '\\');
480+
}
481+
466482
/**
467483
* Instantiate a concrete instance of the given type.
468484
*

src/Illuminate/Database/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Connection implements ConnectionInterface {
7272
protected $fetchMode = PDO::FETCH_ASSOC;
7373

7474
/**
75-
* The number of active transasctions.
75+
* The number of active transactions.
7676
*
7777
* @var int
7878
*/

src/Illuminate/Database/Connectors/SQLiteConnector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function connect(array $config)
2424

2525
$path = realpath($config['database']);
2626

27-
// Here we'll verify that the SQLite database exists before we gooing further
27+
// Here we'll verify that the SQLite database exists before going any further
2828
// as the developer probably wants to know if the database exists and this
2929
// SQLite driver will not throw any exception if it does not by default.
3030
if ($path === false)

src/Illuminate/Database/Eloquent/Model.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ public function belongsTo($related, $foreignKey = null, $otherKey = null, $relat
743743
{
744744
// If no relation name was given, we will use this debug backtrace to extract
745745
// the calling method's name and use that as the relationship name as most
746-
// of the time this will be what we desire to use for the relatinoships.
746+
// of the time this will be what we desire to use for the relationships.
747747
if (is_null($relation))
748748
{
749749
list(, $caller) = debug_backtrace(false);
@@ -803,7 +803,7 @@ public function morphTo($name = null, $type = null, $id = null)
803803
);
804804
}
805805

806-
// If we are not eager loading the relatinship, we will essentially treat this
806+
// If we are not eager loading the relationship we will essentially treat this
807807
// as a belongs-to style relationship since morph-to extends that class and
808808
// we will pass in the appropriate values so that it behaves as expected.
809809
else
@@ -1313,7 +1313,7 @@ public function push()
13131313

13141314
// To sync all of the relationships to the database, we will simply spin through
13151315
// the relationships and save each model via this "push" method, which allows
1316-
// us to recurse into all of these nested relations for the model instance.
1316+
// us to recurs into all of these nested relations for this model instance.
13171317
foreach ($this->relations as $models)
13181318
{
13191319
foreach (Collection::make($models) as $model)
@@ -2606,7 +2606,12 @@ public function getDirty()
26062606

26072607
foreach ($this->attributes as $key => $value)
26082608
{
2609-
if ( ! array_key_exists($key, $this->original) || $value !== $this->original[$key])
2609+
if ( ! array_key_exists($key, $this->original))
2610+
{
2611+
$dirty[$key] = $value;
2612+
}
2613+
elseif ($value !== $this->original[$key] &&
2614+
! $this->originalIsNumericallyEquivalent($key))
26102615
{
26112616
$dirty[$key] = $value;
26122617
}
@@ -2615,6 +2620,21 @@ public function getDirty()
26152620
return $dirty;
26162621
}
26172622

2623+
/**
2624+
* Deteremine if the new and old values for a given key are numerically equivalent.
2625+
*
2626+
* @param string $key
2627+
* @return bool
2628+
*/
2629+
protected function originalIsNumericallyEquivalent($key)
2630+
{
2631+
$current = $this->attributes[$key];
2632+
2633+
$original = $this->original[$key];
2634+
2635+
return is_numeric($current) && is_numeric($original) && strcmp((string) $current, (string) $original) === 0;
2636+
}
2637+
26182638
/**
26192639
* Get all the loaded relations for the instance.
26202640
*

src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ protected function createAttachRecord($id, $timed)
785785
}
786786

787787
/**
788-
* Set the creation and update timstamps on an attach record.
788+
* Set the creation and update timestamps on an attach record.
789789
*
790790
* @param array $record
791791
* @param bool $exists
@@ -965,7 +965,7 @@ public function getRelatedFreshUpdate()
965965
}
966966

967967
/**
968-
* Get the key for comparing against the pareny key in "has" query.
968+
* Get the key for comparing against the parent key in "has" query.
969969
*
970970
* @return string
971971
*/
@@ -995,7 +995,7 @@ public function getOtherKey()
995995
}
996996

997997
/**
998-
* Get the fully qualified parent key naem.
998+
* Get the fully qualified parent key name.
999999
*
10001000
* @return string
10011001
*/

src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ protected function getQualifiedParentKeyName()
243243
}
244244

245245
/**
246-
* Get the key for comparing against the pareny key in "has" query.
246+
* Get the key for comparing against the parent key in "has" query.
247247
*
248248
* @return string
249249
*/

src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public function update(array $attributes)
236236
}
237237

238238
/**
239-
* Get the key for comparing against the pareny key in "has" query.
239+
* Get the key for comparing against the parent key in "has" query.
240240
*
241241
* @return string
242242
*/
@@ -278,7 +278,7 @@ public function getParentKey()
278278
}
279279

280280
/**
281-
* Get the fully qualified parent key naem.
281+
* Get the fully qualified parent key name.
282282
*
283283
* @return string
284284
*/

0 commit comments

Comments
 (0)