Skip to content

Commit 19284e9

Browse files
committed
cs update
1 parent 990b822 commit 19284e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+131
-18
lines changed

.php-cs-fixer.dist.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// PHP 8.2 ve üzeri modern syntax desteği
2929
//'modernize_strpos' => true, // strpos() yerine str_contains() kullanımı
3030
'nullable_type_declaration_for_default_null_value' => true, // Varsayılan değeri null olan tiplerde nullable yap
31-
//'declare_strict_types' => true, // Tüm dosyalar için "declare(strict_types=1);" ekle
31+
'declare_strict_types' => true, // Tüm dosyalar için "declare(strict_types=1);" ekle
3232
'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']], // Sınıf elemanları arasında boşluk bırak
3333

3434
// PHP 8 özelliklerini etkin kullan
@@ -46,7 +46,7 @@
4646
'phpdoc_separation' => true, // PHPDoc bölümler arasında boşluk bırak
4747

4848
// Modern dönüşümler
49-
//'modernize_types_casting' => true, // Eski tip dönüşümleri modernleştir (örneğin, `(int)` yerine `(integer)`)
49+
'modernize_types_casting' => true, // Eski tip dönüşümleri modernleştir (örneğin, `(int)` yerine `(integer)`)
5050
'ternary_to_null_coalescing' => true, // Ternary operatör yerine null coalescing operatörü
5151
'short_scalar_cast' => true, // Kısa tip dönüşümlerini kullan
5252

@@ -58,4 +58,10 @@
5858
'single_line_throw' => false, // throw ifadelerini tek satırda değilse ayır
5959
'new_with_braces' => true, // New anahtar kelimesiyle parantez kullanımını zorunlu yap
6060
'no_superfluous_phpdoc_tags' => true, // Gereksiz PHPDoc etiketlerini kaldır
61+
62+
'no_blank_lines_after_phpdoc' => true,
63+
'global_namespace_import' => ['import_classes' => true], //global namespaceleri use yapar
64+
'explicit_string_variable' => true, //"Hello $name" yerine "Hello {$name}" şeklinde yazımı zorunlu kılar.
65+
'no_unreachable_default_argument_value' => true //null olan fakat nullable olmayan argument tiplerini fixler
66+
6167
]);

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
"scripts": {
7070
"analyze-composer": "@php vendor/bin/composer-dependency-analyser",
7171
"analyze": "@php vendor/bin/phpstan analyse src/",
72-
"format": "@php vendor/bin/php-cs-fixer fix src/",
73-
"format-dry-run": "@php vendor/bin/php-cs-fixer fix src/ --dry-run",
72+
"format": "@php vendor/bin/php-cs-fixer fix src/ --allow-risky=yes",
73+
"format-dry-run": "@php vendor/bin/php-cs-fixer fix src/ --dry-run --allow-risky=yes",
7474
"test": "@php vendor/bin/pest"
7575
},
7676
"prefer-stable": true,

phpstan.dist.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ parameters:
22
level: 5
33
paths:
44
- src/
5+
- tests/
56
tmpDir: build/phpstan
67
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'
8+
treatPhpDocTypesAsCertain: false
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Euu\StructuredMapper\Exception;
46

5-
interface ExceptionInterface extends \Throwable
7+
use Throwable;
8+
9+
interface ExceptionInterface extends Throwable
610
{
711
}

src/Exception/InvalidArgumentException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Euu\StructuredMapper\Exception;
46

57
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface

src/Exception/LogicException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Euu\StructuredMapper\Exception;
46

57
class LogicException extends \LogicException implements ExceptionInterface

src/Exception/NotEncodableValueException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Euu\StructuredMapper\Exception;
46

57
use UnexpectedValueException;

src/Exception/RuntimeException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Euu\StructuredMapper\Exception;
46

57
class RuntimeException extends \RuntimeException implements ExceptionInterface

src/Helper/Functions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Euu\StructuredMapper\Helper;

src/Mapper/Base/Exception/MapperNotFoundException.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Euu\StructuredMapper\Mapper\Base\Exception;
46

57
use Euu\StructuredMapper\Exception\ExceptionInterface;
68
use Euu\StructuredMapper\Exception\RuntimeException;
9+
use Throwable;
710

811
class MapperNotFoundException extends RuntimeException implements ExceptionInterface
912
{
10-
public function __construct(string $mapperName, ?\Throwable $previous = null)
13+
public function __construct(string $mapperName, ?Throwable $previous = null)
1114
{
1215
$message = "Mapper '{$mapperName}' cant found in registered mappers.";
1316
parent::__construct($message, 0, $previous);

0 commit comments

Comments
 (0)