Skip to content
Snippets Groups Projects
Commit 9883508e authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

Refacto

parent b6ab2e05
No related branches found
No related tags found
No related merge requests found
Pipeline #623 passed
......@@ -2,5 +2,6 @@
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="LaravelPintValidationInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PhpStanGlobal" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
</profile>
</component>
\ No newline at end of file
......@@ -138,6 +138,9 @@
<path value="$PROJECT_DIR$/vendor/voku/portable-ascii" />
<path value="$PROJECT_DIR$/vendor/spatie/emoji" />
<path value="$PROJECT_DIR$/vendor/mkocansey/bladewind" />
<path value="$PROJECT_DIR$/vendor/phpstan/phpstan" />
<path value="$PROJECT_DIR$/vendor/larastan/larastan" />
<path value="$PROJECT_DIR$/vendor/phpmyadmin/sql-parser" />
</include_path>
</component>
<component name="PhpInterpreters">
......@@ -219,12 +222,19 @@
<component name="PhpProjectSharedConfiguration" php_language_level="8.2">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
<component name="PhpStan">
<PhpStan_settings>
<PhpStanConfiguration tool_path="$PROJECT_DIR$/vendor/bin/phpstan" />
</PhpStan_settings>
</component>
<component name="PhpStanOptionsConfiguration">
<option name="level" value="5" />
<option name="transferred" value="true" />
</component>
<component name="PhpUnit">
<phpunit_settings>
<phpunit_by_interpreter interpreter_id="41eb493c-2ba1-4c74-b9ea-41d9bb4c70c9" custom_loader_path="vendor/autoload.php" phpunit_phar_path="" />
<PhpUnitSettings configuration_file_path="$PROJECT_DIR$/phpunit.xml" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" use_configuration_file="true" />
</phpunit_settings>
</component>
<component name="PsalmOptionsConfiguration">
......
......@@ -2,6 +2,7 @@
namespace App\Actions\Fortify;
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Validation\Rules\Password;
trait PasswordValidationRules
......@@ -9,7 +10,7 @@ trait PasswordValidationRules
/**
* Get the validation rules used to validate passwords.
*
* @return array<int, \Illuminate\Contracts\Validation\Rule|array<mixed>|string>
* @return array<int, Rule|array|string>
*/
protected function passwordRules(): array
{
......
......@@ -95,7 +95,7 @@ public function store(Request $request): RedirectResponse
])->with('success', 'Catégorie créée avec succès.');
}
public function update(Request $request, int $id)
public function update(Request $request, int $id): RedirectResponse
{
$request->validate([
'lang' => 'required|string|in:fr,en',
......
......@@ -3,13 +3,14 @@
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Database\Factories\UserFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
/** @use HasFactory<UserFactory> */
use HasFactory, Notifiable;
/**
......
......@@ -5,6 +5,7 @@
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Cache;
use Illuminate\View\Component;
use RuntimeException;
class FontAwesome extends Component
{
......@@ -26,16 +27,16 @@ public function __construct(string $icon, string $type = 'regular')
*/
public function render(): View
{
$cacheKey = "fontawesome.{$this->icon}.{$this->type}";
$cacheKey = "fontawesome.$this->icon.$this->type";
$svgContent = Cache::rememberForever($cacheKey, function () {
$iconData = config("fontawesome.{$this->icon}");
$iconData = config("fontawesome.$this->icon");
if (! $iconData) {
$iconData = config('fontawesome.question');
if (!$iconData) {
throw new \RuntimeException("Icon not found: {$this->icon}, and 'question' icon is also missing.");
throw new RuntimeException("Icon not found: $this->icon, and 'question' icon is also missing.");
}
}
......
......@@ -10,10 +10,12 @@
"laravel/fortify": "^1.24",
"laravel/framework": "^11.9",
"laravel/tinker": "^2.9",
"spatie/emoji": "^4.1"
"spatie/emoji": "^4.1",
"ext-pdo": "*"
},
"require-dev": {
"fakerphp/faker": "^1.23",
"larastan/larastan": "3.0",
"laravel/pail": "^1.1",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "bad6bfa706a0c6ab861e459c8e4edfbf",
"content-hash": "33e0fb3d1425c583b7492ba2bc9f6df8",
"packages": [
{
"name": "bacon/bacon-qr-code",
......@@ -6304,6 +6304,99 @@
},
"time": "2020-07-09T08:09:16+00:00"
},
{
"name": "larastan/larastan",
"version": "v3.0.0",
"source": {
"type": "git",
"url": "https://github.com/larastan/larastan.git",
"reference": "88f46e3f2cd9d2a14dba13ef293b822a75832e62"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/larastan/larastan/zipball/88f46e3f2cd9d2a14dba13ef293b822a75832e62",
"reference": "88f46e3f2cd9d2a14dba13ef293b822a75832e62",
"shasum": ""
},
"require": {
"ext-json": "*",
"illuminate/console": "^11.15.0",
"illuminate/container": "^11.15.0",
"illuminate/contracts": "^11.15.0",
"illuminate/database": "^11.15.0",
"illuminate/http": "^11.15.0",
"illuminate/pipeline": "^11.15.0",
"illuminate/support": "^11.15.0",
"php": "^8.2",
"phpmyadmin/sql-parser": "^5.9.0",
"phpstan/phpstan": "^2.0.0"
},
"require-dev": {
"doctrine/coding-standard": "^12.0",
"laravel/framework": "^11.15.0",
"mockery/mockery": "^1.6",
"nikic/php-parser": "^5.3",
"orchestra/canvas": "^v9.1.3",
"orchestra/testbench-core": "^9.5.2",
"phpstan/phpstan-deprecation-rules": "^2.0.0",
"phpunit/phpunit": "^10.5.16"
},
"suggest": {
"orchestra/testbench": "Using Larastan for analysing a package needs Testbench"
},
"type": "phpstan-extension",
"extra": {
"phpstan": {
"includes": [
"extension.neon"
]
},
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"Larastan\\Larastan\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Can Vural",
"email": "can9119@gmail.com"
},
{
"name": "Nuno Maduro",
"email": "enunomaduro@gmail.com"
}
],
"description": "Larastan - Discover bugs in your code without running it. A phpstan/phpstan wrapper for Laravel",
"keywords": [
"PHPStan",
"code analyse",
"code analysis",
"larastan",
"laravel",
"package",
"php",
"static analysis"
],
"support": {
"issues": "https://github.com/larastan/larastan/issues",
"source": "https://github.com/larastan/larastan/tree/v3.0.0"
},
"funding": [
{
"url": "https://github.com/canvural",
"type": "github"
}
],
"time": "2024-11-15T09:38:34+00:00"
},
{
"name": "laravel/pail",
"version": "v1.2.1",
......@@ -6869,6 +6962,151 @@
},
"time": "2022-02-21T01:04:05+00:00"
},
{
"name": "phpmyadmin/sql-parser",
"version": "5.10.1",
"source": {
"type": "git",
"url": "https://github.com/phpmyadmin/sql-parser.git",
"reference": "b14fd66496a22d8dd7f7e2791edd9e8674422f17"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/b14fd66496a22d8dd7f7e2791edd9e8674422f17",
"reference": "b14fd66496a22d8dd7f7e2791edd9e8674422f17",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0",
"symfony/polyfill-mbstring": "^1.3",
"symfony/polyfill-php80": "^1.16"
},
"conflict": {
"phpmyadmin/motranslator": "<3.0"
},
"require-dev": {
"phpbench/phpbench": "^1.1",
"phpmyadmin/coding-standard": "^3.0",
"phpmyadmin/motranslator": "^4.0 || ^5.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.9.12",
"phpstan/phpstan-phpunit": "^1.3.3",
"phpunit/phpunit": "^8.5 || ^9.6",
"psalm/plugin-phpunit": "^0.16.1",
"vimeo/psalm": "^4.11",
"zumba/json-serializer": "~3.0.2"
},
"suggest": {
"ext-mbstring": "For best performance",
"phpmyadmin/motranslator": "Translate messages to your favorite locale"
},
"bin": [
"bin/highlight-query",
"bin/lint-query",
"bin/sql-parser",
"bin/tokenize-query"
],
"type": "library",
"autoload": {
"psr-4": {
"PhpMyAdmin\\SqlParser\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "The phpMyAdmin Team",
"email": "developers@phpmyadmin.net",
"homepage": "https://www.phpmyadmin.net/team/"
}
],
"description": "A validating SQL lexer and parser with a focus on MySQL dialect.",
"homepage": "https://github.com/phpmyadmin/sql-parser",
"keywords": [
"analysis",
"lexer",
"parser",
"query linter",
"sql",
"sql lexer",
"sql linter",
"sql parser",
"sql syntax highlighter",
"sql tokenizer"
],
"support": {
"issues": "https://github.com/phpmyadmin/sql-parser/issues",
"source": "https://github.com/phpmyadmin/sql-parser"
},
"funding": [
{
"url": "https://www.phpmyadmin.net/donate/",
"type": "other"
}
],
"time": "2024-11-10T04:10:31+00:00"
},
{
"name": "phpstan/phpstan",
"version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "46b4d3529b12178112d9008337beda0cc2a1a6b4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/46b4d3529b12178112d9008337beda0cc2a1a6b4",
"reference": "46b4d3529b12178112d9008337beda0cc2a1a6b4",
"shasum": ""
},
"require": {
"php": "^7.4|^8.0"
},
"conflict": {
"phpstan/phpstan-shim": "*"
},
"bin": [
"phpstan",
"phpstan.phar"
],
"type": "library",
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
"keywords": [
"dev",
"static analysis"
],
"support": {
"docs": "https://phpstan.org/user-guide/getting-started",
"forum": "https://github.com/phpstan/phpstan/discussions",
"issues": "https://github.com/phpstan/phpstan/issues",
"security": "https://github.com/phpstan/phpstan/security/policy",
"source": "https://github.com/phpstan/phpstan-src"
},
"funding": [
{
"url": "https://github.com/ondrejmirtes",
"type": "github"
},
{
"url": "https://github.com/phpstan",
"type": "github"
}
],
"time": "2024-11-28T22:19:37+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "11.0.7",
......
......@@ -2,12 +2,13 @@
namespace Database\Factories;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
* @extends Factory<User>
*/
class UserFactory extends Factory
{
......
includes:
- vendor/larastan/larastan/extension.neon
- vendor/nesbot/carbon/extension.neon
parameters:
paths:
- app/
# Level 10 is the highest level
level: 5
# ignoreErrors:
# - '#PHPDoc tag @var#'
#
# excludePaths:
# - ./*/*/FileToBeExcluded.php
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment