Skip to content
This repository was archived by the owner on Oct 20, 2025. It is now read-only.
Merged

Main #63

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
40a6ae2
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
1788641
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
16ca771
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
fbb7710
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
dbadaa1
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
401e70b
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
4ade4a0
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
c8c408a
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
68d0acf
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
1c37a3c
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
c8a1072
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
9d9f3a0
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
73cd4a5
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
a621ab9
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
20db2d4
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
18ca812
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
2504afd
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
151c7b2
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
b98e14c
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
0aff10b
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
3a6e713
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
2229ddc
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
9b2f631
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
3506b25
changed the namespace from PhpSlides\Src to PhpSlides\Core
dconco Dec 25, 2024
5f994a8
fixes error and make main branch be updated with dev
dconco Dec 25, 2024
d0aa303
fixes error and make main branch be updated with dev
dconco Dec 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,8 @@ jobs:

- name: Push changes to main
run: |
git fetch origin main dev
git checkout main
git config pull.rebase false
git pull origin main
git merge origin/dev --allow-unrelated-histories --no-ff
git push origin main
git checkout -b main
git reset --hard dev
git push -u -f origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions Router/MapRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace PhpSlides\Router;

use PhpSlides\Src\Controller\Controller;
use PhpSlides\Src\Foundation\Application;
use PhpSlides\Core\Controller\Controller;
use PhpSlides\Core\Foundation\Application;
use PhpSlides\Router\Interface\MapInterface;

/**
Expand All @@ -18,8 +18,8 @@
*/
class MapRoute extends Controller implements MapInterface
{
use \PhpSlides\Src\Utils\Validate;
use \PhpSlides\Src\Utils\Routes\StrictTypes;
use \PhpSlides\Core\Utils\Validate;
use \PhpSlides\Core\Utils\Routes\StrictTypes;

/**
* @var string|array $route The route(s) to be mapped.
Expand Down
4 changes: 2 additions & 2 deletions Router/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

use Closure;
use PhpSlides\Exception;
use PhpSlides\Src\Traits\FileHandler;
use PhpSlides\Src\Controller\Controller;
use PhpSlides\Core\Traits\FileHandler;
use PhpSlides\Core\Controller\Controller;
use PhpSlides\Router\Interface\RouteInterface;

/**
Expand Down
2 changes: 1 addition & 1 deletion Router/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace PhpSlides\Router;

use component;
use PhpSlides\Src\Foundation\Application;
use PhpSlides\Core\Foundation\Application;

/**
* --------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"autoload": {
"psr-4": {
"PhpSlides\\": "src/Exception/",
"PhpSlides\\Src\\": "src/",
"PhpSlides\\Core\\": "src/",
"PhpSlides\\Router\\": "Router/"
},
"files": ["src/Bootstrap/App.php"]
Expand Down
2 changes: 1 addition & 1 deletion src/Bootstrap/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
/**
* Start the PhpSlides Application
*/
(new \PhpSlides\Src\Foundation\Application())->create();
(new \PhpSlides\Core\Foundation\Application())->create();
4 changes: 2 additions & 2 deletions src/Cache/Cache.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace PhpSlides\Src\Cache;
namespace PhpSlides\Core\Cache;

use PhpSlides\Src\Foundation\Application;
use PhpSlides\Core\Foundation\Application;

/**
* Class Cache
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/Configure.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace PhpSlides\Src\Cli;
namespace PhpSlides\Core\Cli;

trait Configure
{
Expand Down
2 changes: 1 addition & 1 deletion src/Config/config.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

use PhpSlides\Src\Loader\FileLoader;
use PhpSlides\Core\Loader\FileLoader;

(new FileLoader())->load(__DIR__ . '/cors.php');
6 changes: 3 additions & 3 deletions src/Config/cors.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

use PhpSlides\Src\Logger\Logger;
use PhpSlides\Src\Loader\FileLoader;
use PhpSlides\Src\Foundation\Application;
use PhpSlides\Core\Logger\Logger;
use PhpSlides\Core\Loader\FileLoader;
use PhpSlides\Core\Foundation\Application;

$cors =
(new FileLoader())
Expand Down
2 changes: 1 addition & 1 deletion src/Config/env.config.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Dotenv\Dotenv;
use PhpSlides\Src\Foundation\Application;
use PhpSlides\Core\Foundation\Application;

$basePath = Application::$basePath === '' ? 'app/../' : Application::$basePath;

Expand Down
4 changes: 2 additions & 2 deletions src/Config/guards.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use PhpSlides\Src\Loader\FileLoader;
use PhpSlides\Src\Foundation\Application;
use PhpSlides\Core\Loader\FileLoader;
use PhpSlides\Core\Foundation\Application;

return (new FileLoader())
->safeLoad(Application::$configsDir . 'guards.php')
Expand Down
4 changes: 2 additions & 2 deletions src/Config/jwt.config.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

use PhpSlides\Exception;
use PhpSlides\Src\Loader\FileLoader;
use PhpSlides\Src\Foundation\Application;
use PhpSlides\Core\Loader\FileLoader;
use PhpSlides\Core\Foundation\Application;

return (new FileLoader())
->safeLoad(Application::$configsDir . 'jwt.php')
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/ClassController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace PhpSlides\Src\Controller;
namespace PhpSlides\Core\Controller;

use PhpSlides\Exception;

Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Controller.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace PhpSlides\Src\Controller;
namespace PhpSlides\Core\Controller;

abstract class Controller extends RouteController
{
Expand Down
10 changes: 5 additions & 5 deletions src/Controller/RouteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace PhpSlides\Src\Controller;
namespace PhpSlides\Core\Controller;

use PhpSlides\Exception;
use PhpSlides\Src\Http\Request;
use PhpSlides\Src\Logger\Logger;
use PhpSlides\Src\Loader\ViewLoader;
use PhpSlides\Src\Foundation\Application;
use PhpSlides\Core\Http\Request;
use PhpSlides\Core\Logger\Logger;
use PhpSlides\Core\Loader\ViewLoader;
use PhpSlides\Core\Foundation\Application;

class RouteController
{
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Connection.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace PhpSlides\Src\Database;
namespace PhpSlides\Core\Database;

use DB;

Expand Down
4 changes: 2 additions & 2 deletions src/Database/Database.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace PhpSlides\Src\Database;
namespace PhpSlides\Core\Database;

use MeekroORM;
use PhpSlides\Src\Parser\ORMParser;
use PhpSlides\Core\Parser\ORMParser;

/**
* Abstract class for managing database operations with MeekroORM.
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace PhpSlides;

use PhpSlides\Src\Loader\FileLoader;
use PhpSlides\Core\Loader\FileLoader;
use Exception as DefaultException;
use PhpSlides\Interface\SlidesException;

Expand Down
4 changes: 2 additions & 2 deletions src/Exception/template/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ function highlightSpecificLines(block, linesToHighlight) {
: 'http://';

$addr =
\PhpSlides\Src\Foundation\Application::$REMOTE_ADDR .
\PhpSlides\Core\Foundation\Application::$REMOTE_ADDR .
"/hot-reload-a$sid/worker";
$phpslides_version = \PhpSlides\Src\Foundation\Application::PHPSLIDES_VERSION;
$phpslides_version = \PhpSlides\Core\Foundation\Application::PHPSLIDES_VERSION;

if (getenv('HOT_RELOAD') == 'true'): ?>
<script>
Expand Down
8 changes: 4 additions & 4 deletions src/Forgery/Database.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace PhpSlides\Src\Forgery;
namespace PhpSlides\Core\Forgery;

use DB;
use PhpSlides\Src\Logger\DBLogger;
use PhpSlides\Src\Database\Connection;
use PhpSlides\Src\Database\Database as DB_ORM;
use PhpSlides\Core\Logger\DBLogger;
use PhpSlides\Core\Database\Connection;
use PhpSlides\Core\Database\Database as DB_ORM;

/**
* Abstract class for managing database operations.
Expand Down
6 changes: 3 additions & 3 deletions src/Forgery/Forge.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php declare(strict_types=1);

namespace PhpSlides\Src\Forgery;
namespace PhpSlides\Core\Forgery;

use DB;
use PhpSlides\Src\Parser\SqlParser;
use PhpSlides\Src\Foundation\Application;
use PhpSlides\Core\Parser\SqlParser;
use PhpSlides\Core\Foundation\Application;

class Forge extends Database
{
Expand Down
Empty file removed src/Formatter/Includes.php
Empty file.
2 changes: 1 addition & 1 deletion src/Formatter/SqlFormat.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace PhpSlides\Src\Formatter;
namespace PhpSlides\Core\Formatter;

/**
* Abstract class for formatting SQL column definitions.
Expand Down
16 changes: 8 additions & 8 deletions src/Formatter/ViewFormatter.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php declare(strict_types=1);

namespace PhpSlides\Src\Formatter;
namespace PhpSlides\Core\Formatter;

use PhpSlides\Src\Formatter\Views\FormatPslTags;
use PhpSlides\Src\Formatter\Views\FormatIncludes;
use PhpSlides\Src\Formatter\Views\FormatHotReload;
use PhpSlides\Src\Formatter\Views\HandleProperties;
use PhpSlides\Src\Formatter\Views\FormatImportQuotes;
use PhpSlides\Src\Formatter\Views\FormatBracketInterpolation;
use PhpSlides\Core\Formatter\Views\FormatPslTags;
use PhpSlides\Core\Formatter\Views\FormatIncludes;
use PhpSlides\Core\Formatter\Views\FormatHotReload;
use PhpSlides\Core\Formatter\Views\HandleProperties;
use PhpSlides\Core\Formatter\Views\FormatImportQuotes;
use PhpSlides\Core\Formatter\Views\FormatBracketInterpolation;

/**
* Handles the formatting of view files for PhpSlides.
Expand All @@ -16,7 +16,7 @@
* It applies multiple transformations such as handling includes, hot reloads, import quotes,
* bracket interpolation, PSL tags, and properties for dynamic rendering.
*
* @package PhpSlides\Src\Formatter
* @package PhpSlides\Core\Formatter
* @author Dave Conco <info@dconco.dev>
* @copyright 2024 Dave Conco
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Formatter/Views/FormatBracketInterpolation.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace PhpSlides\Src\Formatter\Views;
namespace PhpSlides\Core\Formatter\Views;

/**
* Trait for handling bracket interpolation in view contents.
Expand Down
4 changes: 2 additions & 2 deletions src/Formatter/Views/FormatHotReload.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php declare(strict_types=1);

namespace PhpSlides\Src\Formatter\Views;
namespace PhpSlides\Core\Formatter\Views;

use PhpSlides\Src\Foundation\Application;
use PhpSlides\Core\Foundation\Application;

/**
* Trait to add Hot Reload functionality in PhpSlides view files.
Expand Down
2 changes: 1 addition & 1 deletion src/Formatter/Views/FormatImportQuotes.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace PhpSlides\Src\Formatter\Views;
namespace PhpSlides\Core\Formatter\Views;

/**
* Trait to format import quotes in PhpSlides view files.
Expand Down
2 changes: 1 addition & 1 deletion src/Formatter/Views/FormatIncludes.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace PhpSlides\Src\Formatter\Views;
namespace PhpSlides\Core\Formatter\Views;

/**
* Trait to format includes elements in PhpSlides view files.
Expand Down
27 changes: 13 additions & 14 deletions src/Formatter/Views/FormatPslTags.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace PhpSlides\Src\Formatter\Views;
namespace PhpSlides\Core\Formatter\Views;

/**
* Trait to replace PhpSlides default tags in view files.
Expand All @@ -17,7 +17,7 @@ trait FormatPslTags
* This constructor is a placeholder for any necessary initialization for
* the class using this trait. It currently does not perform any operations.
*/
public function __construct ()
public function __construct()
{
// code...
}
Expand All @@ -30,24 +30,23 @@ public function __construct ()
* PHP tags to remove unnecessary semicolons and ensures the code is correctly
* formatted for execution.
*/
protected function psl_tags ()
protected function psl_tags()
{
// Regular expression to match any PHP opening and closing tags
$formattedContents = preg_replace_callback(
'/<' . '\?' . '\s+([\s\S]*?)\s*\?' . '>/s',
function ($matches)
{
// Trim the content inside the PHP tags, removing trailing semicolons
$val = trim($matches[1]);
$val = str_ends_with(')', $val) ? $val . ';' : $val;
'/<' . '\?' . '\s+([\s\S]*?)\s*\?' . '>/s',
function ($matches) {
// Trim the content inside the PHP tags, removing trailing semicolons
$val = trim($matches[1]);
$val = str_ends_with(')', $val) ? $val . ';' : $val;

// Reformat the PHP content and return it
return '<' . '?php ' . $val . ' ?' . '>';
},
$this->contents,
// Reformat the PHP content and return it
return '<' . '?php ' . $val . ' ?' . '>';
},
$this->contents,
);

// Update the contents with the formatted PHP code blocks
$this->contents = $formattedContents;
}
}
}
Loading
Loading