Skip to content

Commit

Permalink
fix wording
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 30, 2017
2 parents 01be235 + eacc6e1 commit 40a9fb7
Show file tree
Hide file tree
Showing 47 changed files with 309 additions and 136 deletions.
37 changes: 37 additions & 0 deletions CHANGELOG-5.4.md
@@ -1,5 +1,42 @@
# Release Notes for 5.4.x

## v5.4.6 (2017-01-27)

### Added
- Generate non-existent models with `make:controller` ([#17587](https://github.com/laravel/framework/pull/17587), [382b78c](https://github.com/laravel/framework/commit/382b78ca12282c580ff801a00b2e52faf50c6d38))
- Added `TestResponse::dump()` method ([#17600](https://github.com/laravel/framework/pull/17600))

### Changed
- Switch to `ViewFactory` contract in `Mail/Markdown` ([#17591](https://github.com/laravel/framework/pull/17591))
- Use implicit binding when generating controllers with `make:model` ([#17588](https://github.com/laravel/framework/pull/17588))
- Made PhpRedis method signatures compatibility with Predis ([#17488](https://github.com/laravel/framework/pull/17488))
- Use `config('app.name')` in `markdown/message.blade.php` ([#17604](https://github.com/laravel/framework/pull/17604))
- Use `getStatusCode()` instead of `status()` in `TestResponse::fromBaseResponse()` ([#17590](https://github.com/laravel/framework/pull/17590))

### Fixed
- Fixed loading of `.env.testing` when running PHPUnit ([#17596](https://github.com/laravel/framework/pull/17596))


## v5.4.5 (2017-01-26)

### Fixed
- Fixed database session data not persisting ([#17584](https://github.com/laravel/framework/pull/17584))


## v5.4.4 (2017-01-26)

### Added
- Add `hasMiddlewareGroup()` and `getMiddlewareGroups()` method to `Router` ([#17576](https://github.com/laravel/framework/pull/17576))

### Fixed
- Fixed `--database` option on `migrate` commands ([#17574](https://github.com/laravel/framework/pull/17574))
- Fixed `$sequence` being always overwritten in `PostgresGrammar::compileInsertGetId()` ([#17570](https://github.com/laravel/framework/pull/17570))

### Removed
- Removed various unused parameters from view compilers ([#17554](https://github.com/laravel/framework/pull/17554))
- Removed superfluous `ForceDelete` extension from `SoftDeletingScope` ([#17552](https://github.com/laravel/framework/pull/17552))


## v5.4.3 (2017-01-25)

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/MemcachedStore.php
Expand Up @@ -49,7 +49,7 @@ public function __construct($memcached, $prefix = '')
/**
* Retrieve an item from the cache by key.
*
* @param string|array $key
* @param string $key
* @return mixed
*/
public function get($key)
Expand Down
4 changes: 1 addition & 3 deletions src/Illuminate/Cache/RedisStore.php
Expand Up @@ -53,9 +53,7 @@ public function get($key)
{
$value = $this->connection()->get($this->prefix.$key);

if (! is_null($value) && $value !== false) {
return $this->unserialize($value);
}
return ! is_null($value) ? $this->unserialize($value) : null;
}

/**
Expand Down
16 changes: 6 additions & 10 deletions src/Illuminate/Cache/Repository.php
Expand Up @@ -62,9 +62,7 @@ public function __construct(Store $store)
*/
public function has($key)
{
$value = $this->get($key);

return ! is_null($value) && $value !== false;
return ! is_null($this->get($key));
}

/**
Expand All @@ -85,7 +83,7 @@ public function get($key, $default = null)
// If we could not find the cache value, we will fire the missed event and get
// the default value for this cache value. This default could be a callback
// so we will execute the value function which will resolve it if needed.
if (is_null($value) || $value === false) {
if (is_null($value)) {
$this->event(new CacheMissed($key));

$value = value($default);
Expand Down Expand Up @@ -128,7 +126,7 @@ protected function handleManyResult($keys, $key, $value)
// If we could not find the cache value, we will fire the missed event and get
// the default value for this cache value. This default could be a callback
// so we will execute the value function which will resolve it if needed.
if (is_null($value) || $value === false) {
if (is_null($value)) {
$this->event(new CacheMissed($key));

return isset($keys[$key]) ? value($keys[$key]) : null;
Expand Down Expand Up @@ -218,12 +216,10 @@ public function add($key, $value, $minutes)
);
}

$exists = $this->get($key);

// If the value did not exist in the cache, we will put the value in the cache
// so it exists for subsequent requests. Then, we will return true so it is
// easy to know if the value gets added. Otherwise, we will return false.
if (is_null($exists) || $exists === false) {
if (is_null($this->get($key))) {
$this->put($key, $value, $minutes);

return true;
Expand Down Expand Up @@ -285,7 +281,7 @@ public function remember($key, $minutes, Closure $callback)
// If the item exists in the cache we will just return this immediately and if
// not we will execute the given Closure and cache the result of that for a
// given number of minutes so it's available for all subsequent requests.
if (! is_null($value) && $value !== false) {
if (! is_null($value)) {
return $value;
}

Expand Down Expand Up @@ -320,7 +316,7 @@ public function rememberForever($key, Closure $callback)
// If the item exists in the cache we will just return this immediately and if
// not we will execute the given Closure and cache the result of that for a
// given number of minutes so it's available for all subsequent requests.
if (! is_null($value) && $value !== false) {
if (! is_null($value)) {
return $value;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Console/Command.php
Expand Up @@ -121,7 +121,7 @@ protected function configureUsingFluentDefinition()
{
list($name, $arguments, $options) = Parser::parse($this->signature);

parent::__construct($name);
parent::__construct($this->name = $name);

// After parsing the signature we will spin through the arguments and options
// and set them on this command. These will already be changed into proper
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Container/Container.php
Expand Up @@ -637,7 +637,7 @@ protected function getContextualConcrete($abstract)
}

/**
* Find the concerete binding for the given abstract in the contextual binding array.
* Find the concrete binding for the given abstract in the contextual binding array.
*
* @param string $abstract
* @return string|null
Expand Down
Expand Up @@ -744,7 +744,7 @@ public function getDates()
{
$defaults = [static::CREATED_AT, static::UPDATED_AT];

return $this->timestamps ? array_merge($this->dates, $defaults) : $this->dates;
return $this->usesTimestamps() ? array_merge($this->dates, $defaults) : $this->dates;
}

/**
Expand Down
Expand Up @@ -20,7 +20,7 @@ trait HasTimestamps
*/
public function touch()
{
if (! $this->timestamps) {
if (! $this->usesTimestamps()) {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Model.php
Expand Up @@ -568,7 +568,7 @@ protected function performUpdate(Builder $query)
// First we need to create a fresh query instance and touch the creation and
// update timestamp on the model which are maintained by us for developer
// convenience. Then we will just continue saving the model instances.
if ($this->timestamps) {
if ($this->usesTimestamps()) {
$this->updateTimestamps();
}

Expand Down Expand Up @@ -626,7 +626,7 @@ protected function performInsert(Builder $query)
// First we'll need to create a fresh query instance and touch the creation and
// update timestamps on this model, which are maintained by us for developer
// convenience. After, we will just continue saving these model instances.
if ($this->timestamps) {
if ($this->usesTimestamps()) {
$this->updateTimestamps();
}

Expand Down
10 changes: 7 additions & 3 deletions src/Illuminate/Database/Eloquent/Relations/BelongsTo.php
Expand Up @@ -116,12 +116,16 @@ public function addEagerConstraints(array $models)
*/
protected function getEagerModelKeys(array $models)
{
$keys = [];

// First we need to gather all of the keys from the parent models so we know what
// to query for via the eager loading query. We will add them to an array then
// execute a "where in" statement to gather up all of those related records.
$keys = collect($models)->map(function ($model) {
return $model->{$this->foreignKey};
})->filter()->all();
foreach ($models as $model) {
if (! is_null($value = $model->{$this->foreignKey})) {
$keys[] = $value;
}
}

// If there are no keys that were not null we will just return an array with either
// null or 0 in (depending on if incrementing keys are in use) so the query wont
Expand Down
15 changes: 1 addition & 14 deletions src/Illuminate/Database/Eloquent/SoftDeletingScope.php
Expand Up @@ -9,7 +9,7 @@ class SoftDeletingScope implements Scope
*
* @var array
*/
protected $extensions = ['ForceDelete', 'Restore', 'WithTrashed', 'WithoutTrashed', 'OnlyTrashed'];
protected $extensions = ['Restore', 'WithTrashed', 'WithoutTrashed', 'OnlyTrashed'];

/**
* Apply the scope to a given Eloquent query builder.
Expand Down Expand Up @@ -59,19 +59,6 @@ protected function getDeletedAtColumn(Builder $builder)
return $builder->getModel()->getDeletedAtColumn();
}

/**
* Add the force delete extension to the builder.
*
* @param \Illuminate\Database\Eloquent\Builder $builder
* @return void
*/
protected function addForceDelete(Builder $builder)
{
$builder->macro('forceDelete', function (Builder $builder) {
return $builder->getQuery()->delete();
});
}

/**
* Add the restore extension to the builder.
*
Expand Down
4 changes: 4 additions & 0 deletions src/Illuminate/Database/Migrations/Migrator.php
Expand Up @@ -473,6 +473,10 @@ public function paths()
*/
public function setConnection($name)
{
if (! is_null($name)) {
$this->resolver->setDefaultConnection($name);
}

$this->repository->setSource($name);

$this->connection = $name;
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Query/Grammars/PostgresGrammar.php
Expand Up @@ -75,7 +75,7 @@ protected function compileLock(Builder $query, $value)
*/
public function compileInsertGetId(Builder $query, $values, $sequence)
{
if (! is_null($sequence)) {
if (is_null($sequence)) {
$sequence = 'id';
}

Expand Down
Expand Up @@ -44,7 +44,7 @@ protected function checkForSpecificEnvironmentFile($app)
);
}

if (! env('APP_ENV') || empty($file)) {
if (! env('APP_ENV')) {
return;
}

Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Foundation/Console/ModelMakeCommand.php
Expand Up @@ -73,9 +73,11 @@ protected function createController()
{
$controller = Str::studly(class_basename($this->argument('name')));

$modelName = $this->qualifyClass($this->getNameInput());

$this->call('make:controller', [
'name' => "{$controller}Controller",
'--resource' => $this->option('resource'),
'--model' => $this->option('resource') ? $modelName : null,
]);
}

Expand Down
Expand Up @@ -18,7 +18,9 @@ class ValidatePostSize
*/
public function handle($request, Closure $next)
{
if ($request->server('CONTENT_LENGTH') > $this->getPostMaxSize()) {
$max = $this->getPostMaxSize();

if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
throw new PostTooLargeException;
}

Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Foundation/Inspiring.php
Expand Up @@ -27,7 +27,8 @@ public static function quote()
'He who is contented is rich. - Laozi',
'Very little is needed to make a happy life. - Marcus Antoninus',
'It is quality rather than quantity that matters. - Lucius Annaeus Seneca',

'Genius is one percent inspiration and ninety-nine percent perspiration. - Thomas Edison',
'Computer science is no more about computers than astronomy is about telescopes. - Edsger Dijkstra',
])->random();
}
}
20 changes: 19 additions & 1 deletion src/Illuminate/Foundation/Testing/TestResponse.php
Expand Up @@ -20,7 +20,7 @@ class TestResponse extends Response
public static function fromBaseResponse($response)
{
$testResponse = new static(
$response->getContent(), $response->status()
$response->getContent(), $response->getStatusCode()
);

$testResponse->headers = $response->headers;
Expand Down Expand Up @@ -382,4 +382,22 @@ protected function session()
{
return app('session.store');
}

/**
* Dump the content from the response.
*
* @return void
*/
public function dump()
{
$content = $this->getContent();

$json = json_decode($content);

if (json_last_error() === JSON_ERROR_NONE) {
$content = $json;
}

dd($content);
}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/helpers.php
Expand Up @@ -494,7 +494,7 @@ function factory()
$arguments = func_get_args();

if (isset($arguments[1]) && is_string($arguments[1])) {
return $factory->of($arguments[0], $arguments[1])->times(isset($arguments[2]) ? $arguments[2] : 1);
return $factory->of($arguments[0], $arguments[1])->times(isset($arguments[2]) ? $arguments[2] : null);
} elseif (isset($arguments[1])) {
return $factory->of($arguments[0])->times($arguments[1]);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Mail/Markdown.php
Expand Up @@ -5,7 +5,7 @@
use Parsedown;
use Illuminate\Support\Arr;
use Illuminate\Support\HtmlString;
use Illuminate\View\Factory as ViewFactory;
use Illuminate\Contracts\View\Factory as ViewFactory;
use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;

class Markdown
Expand Down
@@ -1 +1 @@
[{{ $slot }}]({{ $url }})
{{ $slot }}: {{ $url }}
Expand Up @@ -2,7 +2,7 @@
{{-- Header --}}
@slot('header')
@component('mail::header', ['url' => config('app.url')])
Product Name
{{ config('app.name') }}
@endcomponent
@endslot

Expand All @@ -21,7 +21,7 @@
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
© 2016 {{ config('app.name') }}. All rights reserved.
© {{ date('Y') }} {{ config('app.name') }}. All rights reserved.
@endcomponent
@endslot
@endcomponent
@@ -1,5 +1,6 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

Expand Down

0 comments on commit 40a9fb7

Please sign in to comment.