@@ -54,11 +54,11 @@ protected function setUse(string $path, bool $isTrait = false, bool $isLast = fa
54
54
* @param string $name
55
55
* @param null $extends
56
56
*/
57
- protected function startClass (string $ name , $ extends = NULL ): void
57
+ protected function startClass (string $ name , $ extends = null ): void
58
58
{
59
59
$ this ->sourceCode .= PhpInterface::PHP_CLASS . PhpInterface::SPACE . $ name
60
60
. PhpInterface::SPACE ;
61
- if ($ extends !== NULL ) {
61
+ if ($ extends !== null ) {
62
62
$ this ->sourceCode .=
63
63
PhpInterface::PHP_EXTENDS
64
64
. PhpInterface::SPACE . $ extends . PhpInterface::SPACE ;
@@ -163,7 +163,8 @@ protected function createProperty(
163
163
string $ modifier ,
164
164
$ value = PhpInterface::PHP_TYPES_NULL ,
165
165
bool $ isString = false
166
- ): void {
166
+ ): void
167
+ {
167
168
if ($ value === PhpInterface::PHP_TYPES_NULL ) { // drop null assignments as they are already nullable by default
168
169
$ this ->sourceCode .= PhpInterface::TAB_PSR4 . $ modifier . PhpInterface::SPACE . PhpInterface::DOLLAR_SIGN .
169
170
$ prop . PhpInterface::SEMICOLON . PHP_EOL ;
@@ -362,17 +363,17 @@ public function closeRule(): void
362
363
}
363
364
364
365
/**
365
- * @uses \SoliDry\Blocks\Controllers::setContent
366
- * @uses \SoliDry\Blocks\Config::setContent
366
+ * @param string $basePath
367
+ * @param string $postFix
367
368
* @uses \SoliDry\Blocks\Migrations::setContent
368
369
* @uses \SoliDry\Blocks\Entities::setContent
369
370
* @uses \SoliDry\Blocks\FormRequest::setContent
370
371
* @uses \SoliDry\Blocks\Tests::setContent
371
372
*
372
373
* Creates entities like *Controller, *FormRequest, BaseModel entities etc
373
374
*
374
- * @param string $basePath
375
- * @param string $postFix
375
+ * @uses \SoliDry\Blocks\Controllers::setContent
376
+ * @uses \SoliDry\Blocks\Config::setContent
376
377
*/
377
378
public function createEntity (string $ basePath , string $ postFix = '' ): void
378
379
{
@@ -457,7 +458,7 @@ public function quoteParam(string $param): string
457
458
protected function setBeforeProps (string $ entityFile ): void
458
459
{
459
460
$ this ->resourceCode = file_get_contents ($ entityFile );
460
- $ end = mb_strpos ($ this ->resourceCode , DefaultInterface::PROPS_START , NULL , PhpInterface::ENCODING_UTF8 ) - 3 ;
461
+ $ end = mb_strpos ($ this ->resourceCode , DefaultInterface::PROPS_START , null , PhpInterface::ENCODING_UTF8 ) - 3 ;
461
462
$ this ->sourceCode = mb_substr ($ this ->resourceCode , 0 , $ end , PhpInterface::ENCODING_UTF8 );
462
463
}
463
464
@@ -466,14 +467,14 @@ protected function setBeforeProps(string $entityFile): void
466
467
*
467
468
* @param string $till
468
469
*/
469
- protected function setAfterProps ($ till = NULL ): void
470
+ protected function setAfterProps ($ till = null ): void
470
471
{
471
- $ start = $ this ->setTabs () . mb_strpos ($ this ->resourceCode , DefaultInterface::PROPS_END , NULL ,
472
- PhpInterface::ENCODING_UTF8 ) - 3 ;
473
- if ($ till === NULL ) {
474
- $ this ->sourceCode .= mb_substr ($ this ->resourceCode , $ start , NULL , PhpInterface::ENCODING_UTF8 );
472
+ $ start = $ this ->setTabs () . ( mb_strpos ($ this ->resourceCode , DefaultInterface::PROPS_END , null ,
473
+ PhpInterface::ENCODING_UTF8 ) - 3 ) ;
474
+ if ($ till === null ) {
475
+ $ this ->sourceCode .= mb_substr ($ this ->resourceCode , $ start , null , PhpInterface::ENCODING_UTF8 );
475
476
} else {
476
- $ end = mb_strpos ($ this ->resourceCode , $ till , NULL , PhpInterface::ENCODING_UTF8 ) - 3 ;
477
+ $ end = mb_strpos ($ this ->resourceCode , $ till , null , PhpInterface::ENCODING_UTF8 ) - 3 ;
477
478
$ this ->sourceCode .= mb_substr ($ this ->resourceCode , $ start , $ end - $ start , PhpInterface::ENCODING_UTF8 );
478
479
}
479
480
}
@@ -483,8 +484,8 @@ protected function setAfterProps($till = NULL): void
483
484
*/
484
485
private function setAfterMethods (): void
485
486
{
486
- $ start = mb_strpos ($ this ->resourceCode , DefaultInterface::METHOD_END , NULL , PhpInterface::ENCODING_UTF8 ) - 3 ;
487
- $ this ->sourceCode .= $ this ->setTabs () . mb_substr ($ this ->resourceCode , $ start , NULL ,
487
+ $ start = mb_strpos ($ this ->resourceCode , DefaultInterface::METHOD_END , null , PhpInterface::ENCODING_UTF8 ) - 3 ;
488
+ $ this ->sourceCode .= $ this ->setTabs () . mb_substr ($ this ->resourceCode , $ start , null ,
488
489
PhpInterface::ENCODING_UTF8 );
489
490
}
490
491
0 commit comments