refactored report and update abstracts

This commit is contained in:
denisdulici
2019-11-23 21:47:20 +03:00
parent eef7eaa12f
commit 51a7fa86fc
37 changed files with 54 additions and 48 deletions

View File

@ -1,31 +0,0 @@
<?php
namespace App\Listeners\Update;
class Listener
{
const ALIAS = '';
const VERSION = '';
/**
* Check if should listen.
*
* @param $event
* @return boolean
*/
protected function check($event)
{
// Apply only to the specified alias
if ($event->alias != static::ALIAS) {
return false;
}
// Do not apply to the same or newer versions
if (version_compare($event->old, static::VERSION, '>=')) {
return false;
}
return true;
}
}

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V10;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use File;
class Version106 extends Listener

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V10;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use DB;
class Version107 extends Listener

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V10;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Common\Company;
use App\Models\Expense\Bill;
use App\Models\Expense\BillStatus;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V10;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Common\Company;
use Artisan;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V11;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Auth\Role;
use App\Models\Auth\Permission;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V11;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Common\Company;
use App\Utilities\Installer;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V11;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Setting\Currency;
use Artisan;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V11;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Auth\Role;
use App\Models\Auth\Permission;
use Illuminate\Support\Facades\Schema;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V12;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Auth\Role;
use App\Models\Auth\Permission;
use App\Models\Common\Company;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V12;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use Artisan;
class Version1210 extends Listener

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V12;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use Artisan;
class Version1211 extends Listener

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V12;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Auth\Role;
use App\Models\Auth\Permission;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V12;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Auth\Permission;
use File;
use Illuminate\Support\Str;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V12;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use Artisan;
class Version129 extends Listener

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V13;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Auth\Role;
use App\Models\Auth\Permission;
use Artisan;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V13;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Auth\Role;
use App\Models\Auth\Permission;
use Artisan;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V13;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Common\Company;
use App\Utilities\Installer;
use Artisan;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V13;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Common\Company;
use App\Utilities\Overrider;
use App\Models\Banking\Account;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V13;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Auth\Role;
use App\Models\Auth\Permission;
use Artisan;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V13;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use Date;
class Version135 extends Listener

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V13;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use Date;
class Version138 extends Listener

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V13;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Income\InvoiceItem;
use App\Models\Income\InvoiceItemTax;
use App\Models\Setting\Tax;

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V20;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use App\Models\Auth\User;
use App\Models\Auth\Role;
use App\Models\Auth\Permission;
@ -32,8 +32,7 @@ class Version200 extends Listener
*/
public function handle(Event $event)
{
// Check if should listen
if (!$this->check($event)) {
if ($this->skipThisUpdate($event)) {
return;
}

View File

@ -2,8 +2,8 @@
namespace App\Listeners\Update\V13;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Listeners\Update\Listener;
use Artisan;
class Version201 extends Listener
@ -20,8 +20,7 @@ class Version201 extends Listener
*/
public function handle(Event $event)
{
// Check if should listen
if (!$this->check($event)) {
if ($this->skipThisUpdate($event)) {
return;
}