Skip to content

Commit

Permalink
Merge pull request #180 from RonasIT/173-structure-refactoring
Browse files Browse the repository at this point in the history
#173: structure refactoring
  • Loading branch information
DenTray authored Jan 10, 2025
2 parents 3208832 + c3fdb9a commit 45d228b
Show file tree
Hide file tree
Showing 33 changed files with 71 additions and 64 deletions.
4 changes: 2 additions & 2 deletions src/Interfaces/ExporterInterface.php → src/Contracts/ExporterContract.php
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace RonasIT\Support\Interfaces;
namespace RonasIT\Support\Contracts;

interface ExporterInterface
interface ExporterContract
{
/**
* Set fields to export
Expand Down
8 changes: 4 additions & 4 deletions src/Exporters/Exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Storage;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadings;
use RonasIT\Support\Interfaces\ExporterInterface;
use Maatwebsite\Excel\Concerns\WithMapping;
use RonasIT\Support\Contracts\ExporterContract;

abstract class Exporter implements FromQuery, WithHeadings, WithMapping, ExporterInterface
abstract class Exporter implements FromQuery, WithHeadings, WithMapping, ExporterContract
{
use Exportable;

Expand Down
4 changes: 2 additions & 2 deletions src/HelpersServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace RonasIT\Support;

use Illuminate\Routing\Route;
use Illuminate\Routing\Router;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
Expand All @@ -14,8 +15,7 @@
use Maatwebsite\Excel\ExcelServiceProvider;
use RonasIT\Support\Contracts\VersionEnumContract as Version;
use RonasIT\Support\Exceptions\InvalidValidationRuleUsageException;
use RonasIT\Support\Middleware\SecurityMiddleware;
use Illuminate\Routing\Router;
use RonasIT\Support\Http\Middleware\SecurityMiddleware;

class HelpersServiceProvider extends ServiceProvider
{
Expand Down
4 changes: 2 additions & 2 deletions src/BaseRequest.php → src/Http/BaseRequest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace RonasIT\Support;
namespace RonasIT\Support\Http;

use Illuminate\Support\Arr;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Arr;
use RonasIT\Support\Exceptions\InvalidModelException;

class BaseRequest extends FormRequest
Expand Down
2 changes: 1 addition & 1 deletion src/BaseResource.php → src/Http/BaseResource.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace RonasIT\Support;
namespace RonasIT\Support\Http;

use Illuminate\Http\Resources\Json\JsonResource;

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

namespace RonasIT\Support\Middleware;
namespace RonasIT\Support\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace RonasIT\Support\Middleware;
namespace RonasIT\Support\Http\Middleware;

use Closure;
use Illuminate\Cache\Repository;
Expand Down
2 changes: 1 addition & 1 deletion tests/AuthTestTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Auth;
use RonasIT\Support\Tests\Support\Mock\MockAuthUser;
use RonasIT\Support\Tests\Support\Mock\Models\MockAuthUser;
use RonasIT\Support\Traits\AuthTestTrait;
use RonasIT\Support\Traits\FixturesTrait;

Expand Down
4 changes: 2 additions & 2 deletions tests/BaseRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace RonasIT\Support\Tests;

use ReflectionClass;
use RonasIT\Support\BaseRequest;
use RonasIT\Support\Tests\Support\Mock\TestModel;
use RonasIT\Support\Http\BaseRequest;
use RonasIT\Support\Tests\Support\Mock\Models\TestModel;
use RonasIT\Support\Tests\Support\Traits\TableTestStateMockTrait;

class BaseRequestTest extends HelpersTestCase
Expand Down
10 changes: 5 additions & 5 deletions tests/EntityControlTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
use Illuminate\Support\Carbon;
use ReflectionProperty;
use RonasIT\Support\Exceptions\InvalidModelException;
use RonasIT\Support\Tests\Support\Mock\TestRepository;
use RonasIT\Support\Tests\Support\Mock\TestRepositoryNoPrimaryKey;
use RonasIT\Support\Tests\Support\Mock\TestRepositoryWithDifferentTimestampNames;
use RonasIT\Support\Tests\Support\Mock\TestRepositoryWithoutTimestamps;
use RonasIT\Support\Tests\Support\Mock\Repositories\TestRepository;
use RonasIT\Support\Tests\Support\Mock\Repositories\TestRepositoryNoPrimaryKey;
use RonasIT\Support\Tests\Support\Mock\Repositories\TestRepositoryWithDifferentTimestampNames;
use RonasIT\Support\Tests\Support\Mock\Repositories\TestRepositoryWithoutTimestamps;
use RonasIT\Support\Tests\Support\Traits\SqlMockTrait;

class EntityControlTraitTest extends HelpersTestCase
Expand Down Expand Up @@ -791,7 +791,7 @@ public function testModelWithoutPrimaryKey()
{
$this->expectException(InvalidModelException::class);
$this->expectExceptionMessage(
'Model RonasIT\Support\Tests\Support\Mock\TestModelNoPrimaryKey must have primary key.'
'Model RonasIT\Support\Tests\Support\Mock\Models\TestModelNoPrimaryKey must have primary key.'
);

new TestRepositoryNoPrimaryKey();
Expand Down
4 changes: 2 additions & 2 deletions tests/EntityServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace RonasIT\Support\Tests;

use BadMethodCallException;
use ReflectionProperty;
use RonasIT\Support\Services\EntityService;
use RonasIT\Support\Tests\Support\Mock\TestRepository;
use BadMethodCallException;
use RonasIT\Support\Tests\Support\Mock\Repositories\TestRepository;

class EntityServiceTest extends HelpersTestCase
{
Expand Down
8 changes: 4 additions & 4 deletions tests/MailsMockTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
use Illuminate\Support\Facades\Mail;
use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\ExpectationFailedException;
use RonasIT\Support\Tests\Support\Mock\LegacyTestMail;
use RonasIT\Support\Tests\Support\Mock\TestMail;
use RonasIT\Support\Tests\Support\Mock\TestMailManyFromWithName;
use RonasIT\Support\Tests\Support\Mock\TestMailWithAttachments;
use RonasIT\Support\Tests\Support\Mock\Mails\LegacyTestMail;
use RonasIT\Support\Tests\Support\Mock\Mails\TestMail;
use RonasIT\Support\Tests\Support\Mock\Mails\TestMailManyFromWithName;
use RonasIT\Support\Tests\Support\Mock\Mails\TestMailWithAttachments;

class MailsMockTraitTest extends HelpersTestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/ModelTestStateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace RonasIT\Support\Tests;

use ReflectionClass;
use RonasIT\Support\Tests\Support\Mock\TestModel;
use RonasIT\Support\Tests\Support\Mock\TestModelWithoutJsonFields;
use RonasIT\Support\Tests\Support\Mock\Models\TestModel;
use RonasIT\Support\Tests\Support\Mock\Models\TestModelWithoutJsonFields;
use RonasIT\Support\Tests\Support\Traits\TableTestStateMockTrait;

class ModelTestStateTest extends HelpersTestCase
Expand Down
6 changes: 3 additions & 3 deletions tests/NovaTestTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
use RonasIT\Support\Tests\Support\Mock\MockAuthUser;
use RonasIT\Support\Tests\Support\Mock\TestModel;
use RonasIT\Support\Tests\Support\Mock\TestNovaAction;
use RonasIT\Support\Tests\Support\Mock\NovaActions\TestNovaAction;
use RonasIT\Support\Tests\Support\Mock\Models\MockAuthUser;
use RonasIT\Support\Tests\Support\Mock\Models\TestModel;
use RonasIT\Support\Traits\MockTrait;
use RonasIT\Support\Traits\NovaTestTrait;
use Symfony\Component\HttpFoundation\Response;
Expand Down
2 changes: 1 addition & 1 deletion tests/SearchTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use Illuminate\Support\Facades\Config;
use ReflectionClass;
use ReflectionMethod;
use RonasIT\Support\Tests\Support\Mock\TestRepository;
use ReflectionProperty;
use RonasIT\Support\Tests\Support\Mock\Repositories\TestRepository;
use RonasIT\Support\Tests\Support\Traits\SqlMockTrait;

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

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Casts;

use Illuminate\Contracts\Database\Eloquent\CastsAttributes;

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

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Mails;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Mails;

use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Mails;

class TestMailManyFromWithName extends TestMail
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Mails;

class TestMailWithAttachments extends TestMail
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Models;

use Illuminate\Database\Eloquent\Model;

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

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Models;

use Illuminate\Contracts\Auth\Authenticatable;

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

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use RonasIT\Support\Traits\ModelTrait;
use Illuminate\Database\Eloquent\SoftDeletes;
use RonasIT\Support\Tests\Support\Mock\Casts\JSONCustomCast;
use RonasIT\Support\Traits\ModelTrait;

class TestModel extends Model
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Models;

use Illuminate\Database\Eloquent\Model;
use RonasIT\Support\Traits\ModelTrait;
use Illuminate\Database\Eloquent\SoftDeletes;
use RonasIT\Support\Traits\ModelTrait;

class TestModelNoPrimaryKey extends Model
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use RonasIT\Support\Tests\Support\Mock\Casts\JSONCustomCast;
use RonasIT\Support\Traits\ModelTrait;

class TestModelWithDifferentTimestampNames extends Model
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Models;

use Illuminate\Database\Eloquent\Model;
use RonasIT\Support\Traits\ModelTrait;
use Illuminate\Database\Eloquent\SoftDeletes;
use RonasIT\Support\Traits\ModelTrait;

class TestModelWithoutJsonFields extends Model
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use RonasIT\Support\Tests\Support\Mock\Casts\JSONCustomCast;
use RonasIT\Support\Traits\ModelTrait;

class TestModelWithoutTimestamps extends Model
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;

class TestNovaAction
{
public function uriKey(): string
{
return 'test-nova-action';
}
}
<?php

namespace RonasIT\Support\Tests\Support\Mock\NovaActions;

class TestNovaAction
{
public function uriKey(): string
{
return 'test-nova-action';
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Repositories;

use RonasIT\Support\Repositories\BaseRepository;
use RonasIT\Support\Tests\Support\Mock\Models\TestModel;

class TestRepository extends BaseRepository
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Repositories;

use RonasIT\Support\Repositories\BaseRepository;
use RonasIT\Support\Tests\Support\Mock\Models\TestModelNoPrimaryKey;

class TestRepositoryNoPrimaryKey extends BaseRepository
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Repositories;

use RonasIT\Support\Repositories\BaseRepository;
use RonasIT\Support\Tests\Support\Mock\Models\TestModelWithDifferentTimestampNames;

class TestRepositoryWithDifferentTimestampNames extends BaseRepository
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

namespace RonasIT\Support\Tests\Support\Mock;
namespace RonasIT\Support\Tests\Support\Mock\Repositories;

use RonasIT\Support\Repositories\BaseRepository;
use RonasIT\Support\Tests\Support\Mock\Models\TestModelWithoutTimestamps;

class TestRepositoryWithoutTimestamps extends BaseRepository
{
Expand Down

0 comments on commit 45d228b

Please sign in to comment.