-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added CustomFieldBehavior to make phpstan happy
- Loading branch information
1 parent
2348440
commit dc8ace9
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* @link http://craftcms.com/ | ||
* @copyright Copyright (c) Pixel & Tonic, Inc. | ||
* @license http://craftcms.com/license | ||
*/ | ||
|
||
namespace craft\behaviors; | ||
|
||
use yii\base\Behavior; | ||
|
||
/** | ||
* This file is never loaded at runtime. It’s only here for PHPStan’n sake. | ||
* | ||
* @internal | ||
*/ | ||
class CustomFieldBehavior extends Behavior | ||
{ | ||
/** | ||
* @var bool Whether the behavior should provide methods based on the field handles. | ||
*/ | ||
public bool $hasMethods = false; | ||
|
||
/** | ||
* @var bool Whether properties on the class should be settable directly. | ||
*/ | ||
public bool $canSetProperties = true; | ||
|
||
/** | ||
* @var string[] List of supported field handles. | ||
*/ | ||
public static $fieldHandles = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
define('CRAFT_BASE_PATH', __DIR__); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
includes: | ||
- vendor/craftcms/phpstan/phpstan.neon | ||
|
||
parameters: | ||
level: 1 | ||
paths: | ||
- src | ||
- src | ||
scanFiles: | ||
- lib/craft/behaviors/CustomFieldBehavior.php | ||
bootstrapFiles: | ||
- lib/craft/bootstrap.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters