Skip to content

Commit

Permalink
Merge branch '3.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Dec 9, 2018
2 parents 8677237 + 1fc51c5 commit f7ee6e0
Show file tree
Hide file tree
Showing 28 changed files with 72 additions and 86 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG-3.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

This changelog references the relevant changes (bug and security fixes) done to `orchestra/foundation`.

### 3.6.2

Released: 2018-12-09

### Fixes

* Rename invalid `orchestra.reauth` middleware alias to `orchestra.sudo`.

### 3.6.1

Released: 2018-08-07
Expand Down
42 changes: 10 additions & 32 deletions src/Console/Commands/AssembleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PDOException;
use Illuminate\Console\Command;
use Orchestra\Contracts\Memory\Provider;
use Orchestra\Contracts\Memory\Provider as Memory;
use Orchestra\Contracts\Foundation\Foundation;

class AssembleCommand extends Command
Expand All @@ -25,63 +25,41 @@ class AssembleCommand extends Command
protected $description = 'Refresh application setup (during composer install/update)';

/**
* The application foundation implementation.
*
* @var \Orchestra\Contracts\Foundation\Foundation
*/
protected $foundation;

/**
* The memory provider implementation.
*
* @var \Orchestra\Contracts\Memory\Provider
*/
protected $memory;

/**
* Construct a new command.
* Execute the console command.
*
* @param \Orchestra\Contracts\Foundation\Foundation $foundation
* @param \Orchestra\Contracts\Memory\Provider $memory
*/
public function __construct(Foundation $foundation, Provider $memory)
{
$this->foundation = $foundation;
$this->memory = $memory;

parent::__construct();
}

/**
* Execute the console command.
*
* @return void
*/
public function handle()
public function handle(Foundation $foundation, Memory $memory)
{
$this->setupApplication();

$this->refreshApplication();
$this->refreshApplication($foundation, $memory);

$this->optimizeApplication();
}

/**
* Refresh application for Orchestra Platform.
*
* @param \Orchestra\Contracts\Foundation\Foundation $foundation
* @param \Orchestra\Contracts\Memory\Provider $memory
*
* @return void
*/
protected function refreshApplication(): void
protected function refreshApplication(Foundation $foundation, Memory $memory): void
{
if (! $this->foundation->installed()) {
if (! $foundation->installed()) {
$this->error('Abort as application is not installed!');

return;
}

$this->call('extension:detect', ['--quiet' => true]);

$extensions = $this->memory->get('extensions.active', []);
$extensions = $memory->get('extensions.active', []);

try {
foreach ($extensions as $extension => $config) {
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Controllers/Account/ReauthenticateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Support\Facades\Redirect;
use Mpociot\Reauthenticate\ReauthLimiter;
use Orchestra\Foundation\Validation\Account as AccountValidator;
use Orchestra\Foundation\Validations\Account as AccountValidator;

class ReauthenticateController extends Controller
{
Expand All @@ -17,7 +17,7 @@ protected function onCreate()
{
parent::onCreate();

$this->middleware('orchestra.reauth');
$this->middleware('orchestra.sudo');
}

/**
Expand All @@ -36,7 +36,7 @@ public function show()
* Handle the reauthentication request to the application.
*
* @param \Illuminate\Http\Request $request
* @param \Orchestra\Foundation\Validation\Account $validator
* @param \Orchestra\Foundation\Validations\Account $validator
*
* @return mixed
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Processors/Account/PasswordBroker.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Orchestra\Contracts\Auth\Listener\PasswordResetLink;
use Illuminate\Contracts\Auth\PasswordBroker as Password;
use Orchestra\Contracts\Auth\Command\PasswordBroker as Command;
use Orchestra\Foundation\Validation\AuthenticateUser as Validator;
use Orchestra\Foundation\Validations\AuthenticateUser as Validator;

class PasswordBroker extends Processor implements Command
{
Expand All @@ -23,7 +23,7 @@ class PasswordBroker extends Processor implements Command
/**
* Create a new processor instance.
*
* @param \Orchestra\Foundation\Validation\AuthenticateUser $validator
* @param \Orchestra\Foundation\Validations\AuthenticateUser $validator
* @param \Illuminate\Contracts\Auth\PasswordBroker $password
*/
public function __construct(Validator $validator, Password $password)
Expand Down
4 changes: 2 additions & 2 deletions src/Processors/Account/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Support\Facades\Event;
use Orchestra\Foundation\Processors\Processor;
use Orchestra\Foundation\Validation\Account as Validator;
use Orchestra\Foundation\Validations\Account as Validator;
use Orchestra\Foundation\Http\Presenters\Account as Presenter;

abstract class User extends Processor
Expand All @@ -13,7 +13,7 @@ abstract class User extends Processor
* Create a new processor instance.
*
* @param \Orchestra\Foundation\Http\Presenters\Account $presenter
* @param \Orchestra\Foundation\Validation\Account $validator
* @param \Orchestra\Foundation\Validations\Account $validator
*/
public function __construct(Presenter $presenter, Validator $validator)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Processors/AuthenticateUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Orchestra\Contracts\Auth\Guard;
use Orchestra\Model\User as Eloquent;
use Orchestra\Contracts\Auth\Command\AuthenticateUser as Command;
use Orchestra\Foundation\Validation\AuthenticateUser as Validator;
use Orchestra\Foundation\Validations\AuthenticateUser as Validator;
use Orchestra\Contracts\Auth\Listener\AuthenticateUser as Listener;
use Orchestra\Contracts\Auth\Command\ThrottlesLogins as ThrottlesCommand;

Expand All @@ -16,7 +16,7 @@ class AuthenticateUser extends Authenticate implements Command
* Create a new processor instance.
*
* @param \Orchestra\Contracts\Auth\Guard $auth
* @param \Orchestra\Foundation\Validation\AuthenticateUser $validator
* @param \Orchestra\Foundation\Validations\AuthenticateUser $validator
*/
public function __construct(Guard $auth, Validator $validator)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Processors/Extension/Configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Orchestra\Support\Facades\Extension;
use Orchestra\Support\Facades\Foundation;
use Orchestra\Foundation\Processors\Processor;
use Orchestra\Foundation\Validation\Extension as Validator;
use Orchestra\Foundation\Validations\Extension as Validator;
use Orchestra\Contracts\Extension\Command\Configure as Command;
use Orchestra\Foundation\Http\Presenters\Extension as Presenter;
use Orchestra\Contracts\Extension\Listener\Configure as Listener;
Expand All @@ -18,7 +18,7 @@ class Configure extends Processor implements Command
* Create a new processor instance.
*
* @param \Orchestra\Foundation\Http\Presenters\Extension $presenter
* @param \Orchestra\Foundation\Validation\Extension $validator
* @param \Orchestra\Foundation\Validations\Extension $validator
*/
public function __construct(Presenter $presenter, Validator $validator)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Processors/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Illuminate\Support\Facades\Config;
use Orchestra\Contracts\Memory\Provider;
use Orchestra\Support\Facades\Foundation;
use Orchestra\Foundation\Validation\Setting as Validator;
use Orchestra\Foundation\Validations\Setting as Validator;
use Orchestra\Foundation\Http\Presenters\Setting as Presenter;
use Orchestra\Contracts\Foundation\Command\SystemUpdater as SystemUpdateCommand;
use Orchestra\Contracts\Foundation\Command\SettingUpdater as SettingUpdateCommand;
Expand All @@ -27,7 +27,7 @@ class Setting extends Processor implements SystemUpdateCommand, SettingUpdateCom
* Create a new processor instance.
*
* @param \Orchestra\Foundation\Http\Presenters\Setting $presenter
* @param \Orchestra\Foundation\Validation\Setting $validator
* @param \Orchestra\Foundation\Validations\Setting $validator
* @param \Orchestra\Contracts\Memory\Provider $memory
*/
public function __construct(Presenter $presenter, Validator $validator, Provider $memory)
Expand Down
4 changes: 2 additions & 2 deletions src/Processors/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Illuminate\Support\Facades\Event;
use Orchestra\Model\User as Eloquent;
use Orchestra\Support\Facades\Foundation;
use Orchestra\Foundation\Validation\User as Validator;
use Orchestra\Foundation\Validations\User as Validator;
use Orchestra\Foundation\Http\Presenters\User as Presenter;
use Orchestra\Contracts\Foundation\Command\Account\UserViewer as UserViewerCommand;
use Orchestra\Contracts\Foundation\Command\Account\UserCreator as UserCreatorCommand;
Expand All @@ -24,7 +24,7 @@ class User extends Processor implements UserCreatorCommand, UserRemoverCommand,
* Create a new processor instance.
*
* @param \Orchestra\Foundation\Http\Presenters\User $presenter
* @param \Orchestra\Foundation\Validation\User $validator
* @param \Orchestra\Foundation\Validations\User $validator
*/
public function __construct(Presenter $presenter, Validator $validator)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Validation/Account.php → src/Validations/Account.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Orchestra\Foundation\Validation;
namespace Orchestra\Foundation\Validations;

use Orchestra\Support\Validator;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Orchestra\Foundation\Validation;
namespace Orchestra\Foundation\Validations;

use Laravie\Authen\Authen;
use Orchestra\Support\Validator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Orchestra\Foundation\Validation;
namespace Orchestra\Foundation\Validations;

use Orchestra\Support\Validator;

Expand Down
2 changes: 1 addition & 1 deletion src/Validation/Setting.php → src/Validations/Setting.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Orchestra\Foundation\Validation;
namespace Orchestra\Foundation\Validations;

use Orchestra\Support\Validator;
use Illuminate\Contracts\Validation\Validator as ValidatorResolver;
Expand Down
2 changes: 1 addition & 1 deletion src/Validation/User.php → src/Validations/User.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Orchestra\Foundation\Validation;
namespace Orchestra\Foundation\Validations;

use Orchestra\Support\Validator;

Expand Down
2 changes: 1 addition & 1 deletion tests/Controller/Users/CreatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function its_cant_create_a_user_due_to_database_errors()
{
$this->instance(UserProcessor::class, $processor = m::mock(UserProcessor::class.'[saving]', [
$this->app->make(\Orchestra\Foundation\Http\Presenters\User::class),
$this->app->make(\Orchestra\Foundation\Validation\User::class),
$this->app->make(\Orchestra\Foundation\Validations\User::class),
]))->shouldAllowMockingProtectedMethods();

$processor->shouldReceive('saving')->once()->andThrows('\Exception');
Expand Down
2 changes: 1 addition & 1 deletion tests/Controller/Users/EditorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function its_cant_edit_a_user_due_to_database_errors()
{
$this->instance(UserProcessor::class, $processor = m::mock(UserProcessor::class.'[saving]', [
$this->app->make(\Orchestra\Foundation\Http\Presenters\User::class),
$this->app->make(\Orchestra\Foundation\Validation\User::class),
$this->app->make(\Orchestra\Foundation\Validations\User::class),
]))->shouldAllowMockingProtectedMethods();

$second = $this->createUserAsMember();
Expand Down
2 changes: 1 addition & 1 deletion tests/Controller/Users/RemoverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function it_cant_delete_user_due_to_database_errors()
{
$this->instance(UserProcessor::class, $processor = m::mock(UserProcessor::class.'[fireEvent]', [
$this->app->make(\Orchestra\Foundation\Http\Presenters\User::class),
$this->app->make(\Orchestra\Foundation\Validation\User::class),
$this->app->make(\Orchestra\Foundation\Validations\User::class),
]))->shouldAllowMockingProtectedMethods();

$processor->shouldReceive('fireEvent')->with('deleting', m::type('Array'))->andThrows('\Exception');
Expand Down
6 changes: 3 additions & 3 deletions tests/Feature/Processor/Account/ProfileCreatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function it_can_show_create_page()
public function it_can_store_profile()
{
$presenter = $this->app->make('Orchestra\Foundation\Http\Presenters\Account');
$validator = $this->app->make('Orchestra\Foundation\Validation\Account');
$validator = $this->app->make('Orchestra\Foundation\Validations\Account');

$stub = m::mock(ProfileCreator::class.'[notifyCreatedUser]', [
$presenter, $validator,
Expand Down Expand Up @@ -59,7 +59,7 @@ public function it_can_store_profile()
public function it_can_store_profile_without_sending_notification()
{
$presenter = $this->app->make('Orchestra\Foundation\Http\Presenters\Account');
$validator = $this->app->make('Orchestra\Foundation\Validation\Account');
$validator = $this->app->make('Orchestra\Foundation\Validations\Account');

$stub = m::mock(ProfileCreator::class.'[notifyCreatedUser]', [
$presenter, $validator,
Expand Down Expand Up @@ -92,7 +92,7 @@ public function it_can_store_profile_without_sending_notification()
public function it_cant_store_profile_given_database_fails()
{
$presenter = $this->app->make('Orchestra\Foundation\Http\Presenters\Account');
$validator = $this->app->make('Orchestra\Foundation\Validation\Account');
$validator = $this->app->make('Orchestra\Foundation\Validations\Account');

$stub = m::mock(ProfileCreator::class.'[saving]', [
$presenter, $validator,
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Processor/Account/ProfileUpdaterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function it_cant_update_given_database_fails()
$this->actingAs($user = $this->createUserAsMember());

$presenter = $this->app->make('Orchestra\Foundation\Http\Presenters\Account');
$validator = $this->app->make('Orchestra\Foundation\Validation\Account');
$validator = $this->app->make('Orchestra\Foundation\Validations\Account');

$stub = m::mock(ProfileUpdater::class.'[saving]', [
$presenter, $validator,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Orchestra\Tests\Feature\Validation;
namespace Orchestra\Tests\Feature\Validations;

use Orchestra\Tests\Feature\TestCase;
use Orchestra\Foundation\Validation\Account;
use Orchestra\Foundation\Validations\Account;
use Orchestra\Foundation\Testing\Installation;

class AccountTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Orchestra\Tests\Feature\Validation;
namespace Orchestra\Tests\Feature\Validations;

use Orchestra\Tests\Feature\TestCase;
use Orchestra\Foundation\Validation\AuthenticateUser;
use Orchestra\Foundation\Validations\AuthenticateUser;

class AuthenticateUserTest extends TestCase
{
Expand All @@ -16,7 +16,7 @@ public function it_declares_proper_signature()
}

/**
* Test Orchestra\Foundation\Validation\Auth validation.
* Test Orchestra\Foundation\Validations\Auth validation.
*
* @test
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Orchestra\Tests\Feature\Validation;
namespace Orchestra\Tests\Feature\Validations;

use Orchestra\Tests\Feature\TestCase;
use Orchestra\Foundation\Validation\Extension;
use Orchestra\Foundation\Validations\Extension;

class ExtensionTest extends TestCase
{
Expand All @@ -12,7 +12,7 @@ public function it_declares_proper_signature()
{
$stub = $this->app->make(Extension::class);

$this->assertInstanceOf('\Orchestra\Foundation\Validation\Extension', $stub);
$this->assertInstanceOf('\Orchestra\Foundation\Validations\Extension', $stub);
$this->assertInstanceOf('\Orchestra\Support\Validator', $stub);
}
}
Loading

0 comments on commit f7ee6e0

Please sign in to comment.