Skip to content

Commit

Permalink
Renamed namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
jzaplet committed Oct 7, 2023
1 parent 67ca78c commit 2683a87
Show file tree
Hide file tree
Showing 104 changed files with 362 additions and 362 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"autoload": {
"psr-4": {
"Saas\\": "src/"
"Megio\\": "src/"
}
},
"authors": [
Expand Down
22 changes: 11 additions & 11 deletions config/app.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ services:
- Symfony\Component\Routing\Matcher\UrlMatcher(@routes, @requestContext)
- Symfony\Component\Routing\Generator\UrlGenerator(@routes, @requestContext)

- Saas\Http\Resolver\LinkResolver
- Saas\Http\Resolver\ControllerResolver
- Megio\Http\Resolver\LinkResolver
- Megio\Http\Resolver\ControllerResolver

request:
factory: Symfony\Component\HttpFoundation\Request::createFromGlobals()
Expand All @@ -14,16 +14,16 @@ services:
setup:
- fromRequest(@request)

- Saas\Bootstrap
- Saas\Http\Kernel\App
- Saas\Storage\Storage
- Saas\Debugger\ResponseFormatter
- Saas\Database\CrudHelper\CrudHelper
- Megio\Bootstrap
- Megio\Http\Kernel\App
- Megio\Storage\Storage
- Megio\Debugger\ResponseFormatter
- Megio\Database\CrudHelper\CrudHelper

- Saas\Security\JWT\JWTResolver
- Saas\Security\JWT\ClaimsFormatter
- Saas\Security\Auth\AuthUser
- Saas\Database\Manager\AuthResourceManager
- Megio\Security\JWT\JWTResolver
- Megio\Security\JWT\ClaimsFormatter
- Megio\Security\Auth\AuthUser
- Megio\Database\Manager\AuthResourceManager

includes:
- command.neon
Expand Down
6 changes: 3 additions & 3 deletions config/command.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
# SaaS commands
- Saas\Console\PermissionsUpdateCommand
- Saas\Console\AdminCreateCommand
# Megio commands
- Megio\Console\PermissionsUpdateCommand
- Megio\Console\AdminCreateCommand

# Doctrine ORM commands
#- Doctrine\ORM\Tools\Console\Command\ClearCache\CollectionRegionCommand(@entityManagerProvider)
Expand Down
10 changes: 5 additions & 5 deletions config/events.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
events:
- Saas\Subscriber\AuthRequest
- Saas\Subscriber\AuthRouteRequest
- Saas\Subscriber\AuthCollectionRequest
- Saas\Subscriber\CorsRequest
- Saas\Subscriber\CSPResponse
- Megio\Subscriber\AuthRequest
- Megio\Subscriber\AuthRouteRequest
- Megio\Subscriber\AuthCollectionRequest
- Megio\Subscriber\CorsRequest
- Megio\Subscriber\CSPResponse
4 changes: 2 additions & 2 deletions config/latte.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
latte:
extensions:
- Saas\Extension\Latte\Extension\SaasExtension
- Megio\Extension\Latte\Extension\MegioExtension

services:
- Saas\Extension\Latte\Function\RouteFunction
- Megio\Extension\Latte\Function\RouteFunction
22 changes: 11 additions & 11 deletions router/app.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

use Saas\Helper\Router;
use Saas\Http\Controller\AppController;
use Saas\Http\Request\Auth as Auth;
use Saas\Http\Request\Collection as Collection;
use Saas\Http\Request\Admin as Admin;
use Saas\Http\Request\Resource as Resource;
use Megio\Helper\Router;
use Megio\Http\Controller\AppController;
use Megio\Http\Request\Auth as Auth;
use Megio\Http\Request\Collection as Collection;
use Megio\Http\Request\Admin as Admin;
use Megio\Http\Request\Resource as Resource;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

return static function (RoutingConfigurator $routes): void {
Expand All @@ -23,7 +23,7 @@
->options(['auth' => false]);

// Auth
$auth = $routes->collection('saas.auth.')->prefix('/saas/auth');
$auth = $routes->collection('megio.auth.')->prefix('/megio/auth');

$auth->add('email', '/email')
->methods(['POST'])
Expand All @@ -36,7 +36,7 @@
->options(['inResources' => false]);

// Admin
$admin = $routes->collection('saas.admin.')->prefix('/saas/admin');
$admin = $routes->collection('megio.admin.')->prefix('/megio/admin');

$admin->add('profile', '/profile')
->methods(['POST'])
Expand All @@ -49,20 +49,20 @@
->options(['inResources' => false]);

// Collections
$collection = $routes->collection(Router::ROUTE_COLLECTION_PREFIX)->prefix('/saas/collections');
$collection = $routes->collection(Router::ROUTE_COLLECTION_PREFIX)->prefix('/megio/collections');
$collection->add('show', '/show')->methods(['POST'])->controller(Collection\ShowRequest::class);
$collection->add('show-one', '/show-one')->methods(['POST'])->controller(Collection\ShowOneRequest::class);
$collection->add('create', '/create')->methods(['POST'])->controller(Collection\CreateRequest::class);
$collection->add('delete', '/delete')->methods(['DELETE'])->controller(Collection\DeleteRequest::class);
$collection->add('update', '/update')->methods(['PATCH'])->controller(Collection\UpdateRequest::class);

// Collections navbar
$routes->add(Router::ROUTE_META_NAVBAR, '/saas/collections/navbar')
$routes->add(Router::ROUTE_META_NAVBAR, '/megio/collections/navbar')
->methods(['POST'])
->controller(Collection\NavbarRequest::class);

// Resources
$resources = $routes->collection('saas.resources.')->prefix('/saas/resources');
$resources = $routes->collection('megio.resources.')->prefix('/megio/resources');

$resources->add('show', '/show')
->methods(['POST'])
Expand Down
8 changes: 4 additions & 4 deletions src/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
*/
declare(strict_types=1);

namespace Saas;
namespace Megio;

use Nette\DI\Compiler;
use Nette\Neon\Neon;
use Saas\Debugger\Logger;
use Saas\Extension\Extension;
use Saas\Helper\Path;
use Megio\Debugger\Logger;
use Megio\Extension\Extension;
use Megio\Helper\Path;
use Nette\Bridges\DITracy\ContainerPanel;
use Nette\DI\Container;
use Nette\DI\ContainerLoader;
Expand Down
8 changes: 4 additions & 4 deletions src/Console/AdminCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*/
declare(strict_types=1);

namespace Saas\Console;
namespace Megio\Console;

use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use Saas\Database\Entity\Admin;
use Saas\Database\Entity\EntityException;
use Saas\Database\EntityManager;
use Megio\Database\Entity\Admin;
use Megio\Database\Entity\EntityException;
use Megio\Database\EntityManager;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
Expand Down
6 changes: 3 additions & 3 deletions src/Console/PermissionsUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*/
declare(strict_types=1);

namespace Saas\Console;
namespace Megio\Console;

use Saas\Database\Enum\ResourceType;
use Saas\Database\Manager\AuthResourceManager;
use Megio\Database\Enum\ResourceType;
use Megio\Database\Manager\AuthResourceManager;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Database/CrudHelper/CrudException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
declare(strict_types=1);

namespace Saas\Database\CrudHelper;
namespace Megio\Database\CrudHelper;

class CrudException extends \Exception
{
Expand Down
20 changes: 10 additions & 10 deletions src/Database/CrudHelper/CrudHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
*/
declare(strict_types=1);

namespace Saas\Database\CrudHelper;
namespace Megio\Database\CrudHelper;

use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Table;
use Saas\Database\Entity\Auth\Resource;
use Saas\Database\Entity\Auth\Role;
use Saas\Database\Entity\Auth\Token;
use Saas\Database\EntityManager;
use Saas\Database\Interface\ICrudable;
use Megio\Database\Entity\Auth\Resource;
use Megio\Database\Entity\Auth\Role;
use Megio\Database\Entity\Auth\Token;
use Megio\Database\EntityManager;
use Megio\Database\Interface\ICrudable;

class CrudHelper
{
Expand Down Expand Up @@ -109,7 +109,7 @@ public function getEntitySchema(string $entityClassName): array
* @param string $tableName
* @param string $visiblePropsProperty
* @param bool $schema
* @return \Saas\Database\CrudHelper\EntityMetadata|null
* @return \Megio\Database\CrudHelper\EntityMetadata|null
*/
public function getEntityMetadata(string $tableName, string $visiblePropsProperty, bool $schema = false): ?EntityMetadata
{
Expand Down Expand Up @@ -144,10 +144,10 @@ public function getEntityMetadata(string $tableName, string $visiblePropsPropert
}

/**
* @param \Saas\Database\Interface\ICrudable $entity
* @param \Megio\Database\Interface\ICrudable $entity
* @param array<string, mixed> $props
* @return \Saas\Database\Interface\ICrudable
* @throws \Saas\Database\CrudHelper\CrudException
* @return \Megio\Database\Interface\ICrudable
* @throws \Megio\Database\CrudHelper\CrudException
*/
public function setUpEntityProps(ICrudable $entity, array $props): ICrudable
{
Expand Down
2 changes: 1 addition & 1 deletion src/Database/CrudHelper/EntityMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
declare(strict_types=1);

namespace Saas\Database\CrudHelper;
namespace Megio\Database\CrudHelper;

class EntityMetadata
{
Expand Down
24 changes: 12 additions & 12 deletions src/Database/Entity/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
*/
declare(strict_types=1);

namespace Saas\Database\Entity;
namespace Megio\Database\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Saas\Database\Entity\Auth\Role;
use Saas\Database\Entity\Auth\Resource;
use Saas\Database\Field\TCreatedAt;
use Saas\Database\Field\TEmail;
use Saas\Database\Field\TId;
use Saas\Database\Field\TLastLogin;
use Saas\Database\Field\TPassword;
use Saas\Database\Field\TUpdatedAt;
use Saas\Database\Interface\ICrudable;
use Saas\Database\Interface\IAuthenticable;
use Saas\Database\Repository\AdminRepository;
use Megio\Database\Entity\Auth\Role;
use Megio\Database\Entity\Auth\Resource;
use Megio\Database\Field\TCreatedAt;
use Megio\Database\Field\TEmail;
use Megio\Database\Field\TId;
use Megio\Database\Field\TLastLogin;
use Megio\Database\Field\TPassword;
use Megio\Database\Field\TUpdatedAt;
use Megio\Database\Interface\ICrudable;
use Megio\Database\Interface\IAuthenticable;
use Megio\Database\Repository\AdminRepository;

#[ORM\Table(name: '`admin`')]
#[ORM\Entity(repositoryClass: AdminRepository::class)]
Expand Down
10 changes: 5 additions & 5 deletions src/Database/Entity/Auth/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
*/
declare(strict_types=1);

namespace Saas\Database\Entity\Auth;
namespace Megio\Database\Entity\Auth;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Saas\Database\Enum\ResourceType;
use Saas\Database\Field\TCreatedAt;
use Saas\Database\Field\TId;
use Saas\Database\Repository\Auth\ResourceRepository;
use Megio\Database\Enum\ResourceType;
use Megio\Database\Field\TCreatedAt;
use Megio\Database\Field\TId;
use Megio\Database\Repository\Auth\ResourceRepository;

#[ORM\Table(name: '`auth_resource`')]
#[ORM\Entity(repositoryClass: ResourceRepository::class)]
Expand Down
14 changes: 7 additions & 7 deletions src/Database/Entity/Auth/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
*/
declare(strict_types=1);

namespace Saas\Database\Entity\Auth;
namespace Megio\Database\Entity\Auth;

use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Saas\Database\Entity\Admin;
use Saas\Database\Entity\EntityException;
use Saas\Database\Field\TCreatedAt;
use Saas\Database\Field\TId;
use Saas\Database\Repository\Auth\RoleRepository;
use Megio\Database\Entity\Admin;
use Megio\Database\Entity\EntityException;
use Megio\Database\Field\TCreatedAt;
use Megio\Database\Field\TId;
use Megio\Database\Repository\Auth\RoleRepository;

#[ORM\Table(name: '`auth_role`')]
#[ORM\Entity(repositoryClass: RoleRepository::class)]
Expand Down Expand Up @@ -63,7 +63,7 @@ public function getResources(): Collection
}

/**
* @param \Saas\Database\Entity\Auth\Resource $resource
* @param \Megio\Database\Entity\Auth\Resource $resource
* @return $this
*/
public function addResource(Resource $resource): Role
Expand Down
10 changes: 5 additions & 5 deletions src/Database/Entity/Auth/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
*/
declare(strict_types=1);

namespace Saas\Database\Entity\Auth;
namespace Megio\Database\Entity\Auth;

use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Saas\Database\Field\TCreatedAt;
use Saas\Database\Field\TId;
use Saas\Database\Field\TUpdatedAt;
use Saas\Database\Repository\Auth\TokenRepository;
use Megio\Database\Field\TCreatedAt;
use Megio\Database\Field\TId;
use Megio\Database\Field\TUpdatedAt;
use Megio\Database\Repository\Auth\TokenRepository;

#[ORM\Table(name: '`auth_token`')]
#[ORM\Entity(repositoryClass: TokenRepository::class)]
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Entity/EntityException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
declare(strict_types=1);

namespace Saas\Database\Entity;
namespace Megio\Database\Entity;

class EntityException extends \Exception
{
Expand Down
20 changes: 10 additions & 10 deletions src/Database/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
*/
declare(strict_types=1);

namespace Saas\Database;
namespace Megio\Database;

use Saas\Database\Entity\Admin;
use Saas\Database\Entity\Auth\Resource;
use Saas\Database\Entity\Auth\Role;
use Saas\Database\Entity\Auth\Token;
use Saas\Database\Repository\AdminRepository;
use Saas\Database\Repository\Auth\ResourceRepository;
use Saas\Database\Repository\Auth\RoleRepository;
use Saas\Database\Repository\Auth\TokenRepository;
use Saas\Extension\Doctrine\Doctrine;
use Megio\Database\Entity\Admin;
use Megio\Database\Entity\Auth\Resource;
use Megio\Database\Entity\Auth\Role;
use Megio\Database\Entity\Auth\Token;
use Megio\Database\Repository\AdminRepository;
use Megio\Database\Repository\Auth\ResourceRepository;
use Megio\Database\Repository\Auth\RoleRepository;
use Megio\Database\Repository\Auth\TokenRepository;
use Megio\Extension\Doctrine\Doctrine;

// @phpstan-ignore-next-line
class EntityManager extends \Doctrine\ORM\EntityManager
Expand Down
Loading

0 comments on commit 2683a87

Please sign in to comment.