Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrades :D [Laravel 11, Vite, Security] #1498

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2

[*.{js,vue,scss,json}]
[*.{js,vue,scss,json,mjs}]
indent_size = 2

[*.blade.php]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
types: [completed]

env:
default-php-version: '8.0'
default-php-version: '8.3'
coverage-with: 'sqlite'


Expand All @@ -39,14 +39,14 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.0']
php-version: ['8.3']
connection: [sqlite, mysql, pgsql]
testsuite: [Unit]
coverage: [true] # run test with coverage, if 'coverage-with' match with the connection
include:
- connection: sqlite
testsuite: Integration
php-version: '8.0'
php-version: '8.3'
coverage: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.0']
php-version: ['8.3']
browser: [chrome]
containers: [1, 2, 3, 4, 5, 6, 7, 8]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
workflow_dispatch:

env:
php-version: '8.0'
php-version: '8.3'
node-version: 16

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- cron: '0 0 * * *'

env:
php-version: '8.0'
php-version: '8.3'
node-version: 16


Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
workflow_dispatch:

env:
php-version: '8.0'
php-version: '8.3'
node-version: 16


Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
types: [completed]

env:
php-version: '8.0'
php-version: '8.3'


jobs:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader

- name: Fix PHP code to follow standards
run: vendor/bin/php-cs-fixer fix
run: vendor/bin/pint

psalm:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/public/js
/public/css
/public/storage
/public/build
/public/mix-manifest.json
/results
/storage/*.key
Expand All @@ -12,6 +13,7 @@
.env
.env.cypress.local
.phpunit.result.cache
.phpunit.cache
.php_cs.cache
.php-cs-fixer.cache
Homestead.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Models\Company\Employee;
use App\Jobs\CalculateTimeOffBalance;
use App\Models\Company\Employee;
use Illuminate\Console\Command;

class CalculateTimeOffBalanceForAllEmployees extends Command
{
Expand Down
7 changes: 4 additions & 3 deletions app/Console/Commands/Demo/ResetDemo.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace App\Console\Commands\Demo;

use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Console\ConfirmableTrait;

class ResetDemo extends Command
{
Expand Down Expand Up @@ -35,6 +35,7 @@ public function handle(): void
{
if (! config('officelife.demo_mode')) {
$this->line('This command is only available in demo mode.');

return;
}

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/GenerateNewECoffeeSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Console\Commands;

use App\Jobs\CreateNewECoffeeSession;
use App\Models\Company\Company;
use Illuminate\Console\Command;
use App\Jobs\CreateNewECoffeeSession;

class GenerateNewECoffeeSession extends Command
{
Expand Down
15 changes: 5 additions & 10 deletions app/Console/Commands/Helpers/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ class Command
{
/**
* Switch to a fake executor for testing purpose.
*
* @return CommandCallerContract
*/
public static function fake() : CommandCallerContract
public static function fake(): CommandCallerContract
{
static::setBackend($fake = app(CommandCallerFake::class));

Expand All @@ -31,10 +29,8 @@ public static function fake() : CommandCallerContract

/**
* Get the current backend command.
*
* @return CommandCallerContract
*/
private static function getBackend() : CommandCallerContract
private static function getBackend(): CommandCallerContract
{
if (! static::$commandCaller) {
static::$commandCaller = app(CommandCaller::class); // @codeCoverageIgnore
Expand All @@ -45,10 +41,8 @@ private static function getBackend() : CommandCallerContract

/**
* Set the current backend command.
*
* @param CommandCallerContract $executor
*/
public static function setBackend(CommandCallerContract $executor) : void
public static function setBackend(CommandCallerContract $executor): void
{
static::$commandCaller = $executor;
}
Expand All @@ -58,8 +52,9 @@ public static function setBackend(CommandCallerContract $executor) : void
*
* @param string $method
* @param array $args
* @throws \RuntimeException
* @return mixed
*
* @throws \RuntimeException
*/
public static function __callStatic($method, $args)
{
Expand Down
16 changes: 8 additions & 8 deletions app/Console/Commands/Helpers/CommandCaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

namespace App\Console\Commands\Helpers;

use Illuminate\Console\Command;
use Illuminate\Console\Application;
use Illuminate\Console\Command;
use Symfony\Component\Console\Output\OutputInterface;

class CommandCaller implements CommandCallerContract
{
/**
* Print a message on the console, then execute a command.
*
* @param Command $command Laravel command context
* @param string $message Message to output
* @param string $commandline Command to execute
* @param Command $command Laravel command context
* @param string $message Message to output
* @param string $commandline Command to execute
*
* @codeCoverageIgnore
*/
Expand All @@ -31,10 +31,10 @@ public function exec(Command $command, string $message, string $commandline): vo
/**
* Print a message on the console, then execute an artisan command.
*
* @param Command $command Laravel command context
* @param string $message Message to output
* @param string $commandline Artisan command name to execute
* @param array $arguments Optional arguments to pass to the artisan command
* @param Command $command Laravel command context
* @param string $message Message to output
* @param string $commandline Artisan command name to execute
* @param array $arguments Optional arguments to pass to the artisan command
*
* @codeCoverageIgnore
*/
Expand Down
14 changes: 7 additions & 7 deletions app/Console/Commands/Helpers/CommandCallerContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ interface CommandCallerContract
/**
* Print a message on the console, then execute a command.
*
* @param Command $command Laravel command context
* @param string $message Message to output
* @param string $commandline Command to execute
* @param Command $command Laravel command context
* @param string $message Message to output
* @param string $commandline Command to execute
*/
public function exec(Command $command, string $message, string $commandline): void;

/**
* Print a message on the console, then execute an artisan command.
*
* @param Command $command Laravel command context
* @param string $message Message to output
* @param string $commandline Artisan command name to execute
* @param array $arguments Optional arguments to pass to the artisan command
* @param Command $command Laravel command context
* @param string $message Message to output
* @param string $commandline Artisan command name to execute
* @param array $arguments Optional arguments to pass to the artisan command
*/
public function artisan(Command $command, string $message, string $commandline, array $arguments = []): void;
}
4 changes: 2 additions & 2 deletions app/Console/Commands/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Schema;
use Illuminate\Console\ConfirmableTrait;
use Illuminate\Support\Facades\Schema;

class Setup extends Command
{
Expand Down Expand Up @@ -42,7 +42,7 @@ public function handle(): void
$this->artisan('✓ Clear config cache', 'config:clear');
$this->artisan('✓ Resetting route cache', 'route:cache');
$this->artisan('✓ Resetting view cache', 'view:clear');
// @codeCoverageIgnoreEnd
// @codeCoverageIgnoreEnd
} else {
$this->artisan('✓ Clear config cache', 'config:clear');
$this->artisan('✓ Clear route cache', 'route:clear');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Jobs\StartRateYourManagerProcess;
use Illuminate\Console\Command;

class StartRateYourManagerProcessFromCli extends Command
{
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/StopRateYourManagerProcessFromCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Jobs\StopRateYourManagerProcess;
use Illuminate\Console\Command;

class StopRateYourManagerProcessFromCli extends Command
{
Expand Down
Loading
Loading