Skip to content

Commit 0ad5108

Browse files
authored
Merge pull request #18 from citrus-framework/fix_klass
klassの修正
2 parents 723132d + 352d110 commit 0ad5108

File tree

11 files changed

+25
-32
lines changed

11 files changed

+25
-32
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ composer_check:
3131
.PHONY: insights
3232
insights:
3333
@./vendor/bin/phpinsights analyse ./src
34+

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"ext-pdo": "*"
2525
},
2626
"require-dev": {
27-
"php": "^8.1",
28-
"phpunit/phpunit": "^9.5",
27+
"php": "^8.3",
28+
"phpunit/phpunit": "^10.5",
2929
"nunomaduro/phpinsights": "^v2.0"
3030
},
3131
"autoload": {

phpinsights.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
// Style
3838
PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ArbitraryParenthesesSpacingSniff::class,
39+
PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ElseIfDeclarationSniff::class,
3940
],
4041
'config' => [
4142
// Architecture

src/Database/Generate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function property(string $class_prefix, string $table_name): void
160160
->setClassComment($class_name)
161161
->setExtends($extend_name)
162162
->addMethod(
163-
(new KlassMethod(KlassVisibility::TYPE_PUBLIC, 'callPrimaryKeys', false, 'call primary keys'))
163+
(new KlassMethod(KlassVisibility::PUBLIC, 'callPrimaryKeys', false, 'call primary keys'))
164164
->setReturn(new KlassReturn('string[]'))
165165
->setBody(
166166
<<<BODY

src/Sqlmap/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function parse(): void
109109
$this->statement->query = $this->_nodes($nodes);
110110

111111
// キーワードの置換
112-
if (true === Strings::isEmpty($this->parameter->schema))
112+
if (true === Strings::isEmpty($this->parameter->schema ?? ''))
113113
{
114114
$this->parameter->schema = $this->dsn->schema;
115115
}
@@ -589,7 +589,7 @@ private function callNestPropertyValue(string $property)
589589
$result = $this->parameter;
590590
foreach ($properties as $one)
591591
{
592-
$result = $result->$one;
592+
$result = $result->$one ?? null;
593593
}
594594
return $result;
595595
}

tests/Sample/Business/Entity/UserEntity.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ class UserEntity extends UserProperty implements ResultClass
1818
{
1919
use Entity;
2020

21-
22-
2321
/**
2422
* {@inheritDoc}
2523
*/

tests/Sample/Citrus_20190102000000_CreateTableUsers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class Citrus_20190102000000_CreateTableUsers extends Item
1717
{
1818
/** @var string object name */
19-
public $object_name = 'users';
19+
public string $object_name = 'users';
2020

2121

2222

tests/Sample/Integration/Condition/UserCondition.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* generated Citrus Condition file at 2020-07-11 19:02:50
6+
* generated Citrus Condition file at 2024-06-30 04:20:15
77
*/
88

99
namespace Test\Sample\Integration\Condition;
@@ -14,4 +14,5 @@
1414
class UserCondition extends \Test\Sample\Integration\Property\UserProperty
1515
{
1616
use \Citrus\Sqlmap\Condition;
17+
use \Citrus\Variable\PathBinders;
1718
}

tests/Sample/Integration/Dao/UserDao.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* generated Citrus Dao file at 2020-07-11 19:02:50
6+
* generated Citrus Dao file at 2024-06-30 04:20:15
77
*/
88

99
namespace Test\Sample\Integration\Dao;
@@ -13,6 +13,10 @@
1313
*/
1414
class UserDao extends \Citrus\Sqlmap\Crud
1515
{
16+
use \Citrus\Variable\Singleton;
17+
18+
19+
1620
/** @var string SQLMAP path */
17-
protected $sqlmap_path = __DIR__ . '/../Sqlmap/Users.xml';
21+
protected string $sqlmap_path = __DIR__ . '/../Sqlmap/Users.xml';
1822
}

tests/Sample/Integration/Property/UserProperty.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* generated Citrus Property file at 2020-07-11 19:02:50
6+
* generated Citrus Property file at 2024-06-30 04:20:15
77
*/
88

99
namespace Test\Sample\Integration\Property;
@@ -13,11 +13,11 @@
1313
*/
1414
class UserProperty extends \Citrus\Database\Columns
1515
{
16-
/** @var int */
17-
public $user_id;
16+
/** @var int|null */
17+
public int|null $user_id = null;
1818

19-
/** @var string */
20-
public $name;
19+
/** @var string|null */
20+
public string|null $name = null;
2121

2222

2323

0 commit comments

Comments
 (0)