Skip to content

Commit 65247fd

Browse files
author
Leoncio, Leo
committed
Craft 5, PHP8.1
1 parent 2e5ac87 commit 65247fd

File tree

7 files changed

+62
-54
lines changed

7 files changed

+62
-54
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## 2.0.0 - 2024.03.26
6+
Craft 5, PHP 8.2
7+
58
## 1.0.2 - 2023.03.23
69
Cleanup, PHP 8.2
710

LICENSE.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

composer.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
"fields",
88
"mask",
99
"formatting",
10-
"validation",
11-
"cp"
10+
"validation"
1211
],
13-
"version": "1.0.2",
12+
"version": "2.0.0",
1413
"type": "craft-plugin",
15-
"license": "MIT",
14+
"license": "proprietary",
1615
"authors": [
1716
{
1817
"name": "Leo",
@@ -22,13 +21,14 @@
2221
"minimum-stability": "dev",
2322
"prefer-stable": true,
2423
"require": {
25-
"php": "^8.0.2",
26-
"craftcms/cms": "^4.0"
24+
"php": "^8.2",
25+
"craftcms/cms": "^5.0"
2726
},
2827
"require-dev": {
2928
"craftcms/ecs": "dev-main",
3029
"craftcms/phpstan": "dev-main",
31-
"craftcms/rector": "dev-main"
30+
"craftcms/rector": "dev-main",
31+
"laravel/pint": "^1.14.0"
3232
},
3333
"autoload": {
3434
"psr-4": {
@@ -42,7 +42,7 @@
4242
},
4343
"config": {
4444
"platform": {
45-
"php": "8.0.2"
45+
"php": "8.2"
4646
},
4747
"allow-plugins": {
4848
"yiisoft/yii2-composer": true,
@@ -53,6 +53,7 @@
5353
"check-cs": "vendor/bin/ecs check src --ansi",
5454
"fix-cs": "vendor/bin/ecs check src --ansi --fix",
5555
"phpstan": "vendor/bin/phpstan analyse src",
56-
"rector": "vendor/bin/rector process src --config vendor/craftcms/rector/sets/craft-cms-40.php"
56+
"rector": "vendor/bin/rector process src --config vendor/craftcms/rector/sets/craft-cms-50.php",
57+
"pint": "vendor/bin/pint -v src"
5758
}
5859
}

pint.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"preset": "psr12",
3+
"rules": {
4+
"braces": false,
5+
"concat_space": {
6+
"spacing": "one"
7+
},
8+
"new_with_braces": {
9+
"anonymous_class": false,
10+
"named_class": false
11+
},
12+
"phpdoc_separation": false,
13+
"simplified_null_return": true,
14+
"array_syntax": {
15+
"syntax": "short"
16+
},
17+
"binary_operator_spaces": true,
18+
"blank_line_before_statement": false,
19+
"cast_spaces": false,
20+
"class_attributes_separation": false,
21+
"declare_equal_normalize": true,
22+
"function_declaration": false,
23+
"method_argument_space": false,
24+
"multiline_whitespace_before_semicolons": false,
25+
"no_empty_statement": true,
26+
"no_leading_import_slash": true,
27+
"no_leading_namespace_whitespace": true,
28+
"no_multiline_whitespace_around_double_arrow": true,
29+
"no_unused_imports": true,
30+
"no_whitespace_before_comma_in_array": true,
31+
"no_whitespace_in_blank_line": true,
32+
"not_operator_with_successor_space": false,
33+
"ordered_imports": true,
34+
"phpdoc_add_missing_param_annotation": false,
35+
"phpdoc_align": false,
36+
"phpdoc_indent": false,
37+
"phpdoc_order": true,
38+
"phpdoc_scalar": true,
39+
"single_line_after_imports": false,
40+
"single_space_around_construct": false,
41+
"trim_array_spaces": true
42+
}
43+
}

src/Plugin.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,29 @@
44
*
55
* @author Leo Leoncio
66
* @see https://github.com/leowebguy
7-
* @copyright Copyright (c) 2022, leowebguy
8-
* @license MIT
7+
* @copyright Copyright (c) 2024, leowebguy
98
*/
109

1110
namespace leowebguy\maskedfields;
1211

1312
use Craft;
1413
use craft\base\Plugin as BasePlugin;
1514
use craft\events\RegisterComponentTypesEvent;
15+
use craft\services\Fields;
1616
use craft\web\View;
1717
use leowebguy\maskedfields\assets\Assets;
1818
use leowebguy\maskedfields\fields\MaskedField;
1919
use yii\base\Event;
20-
use craft\services\Fields;
2120

2221
class Plugin extends BasePlugin
2322
{
24-
// Properties
25-
// =========================================================================
26-
27-
public static mixed $plugin;
28-
2923
public bool $hasCpSection = false;
3024

3125
public bool $hasCpSettings = false;
3226

33-
// Public Methods
34-
// =========================================================================
35-
3627
public function init()
3728
{
3829
parent::init();
39-
self::$plugin = $this;
4030

4131
if (!$this->isInstalled) {
4232
return;

src/assets/Assets.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
*
55
* @author Leo Leoncio
66
* @see https://github.com/leowebguy
7-
* @copyright Copyright (c) 2022, leowebguy
8-
* @license MIT
7+
* @copyright Copyright (c) 2024, leowebguy
98
*/
109

1110
namespace leowebguy\maskedfields\assets;

src/fields/MaskedField.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
*
55
* @author Leo Leoncio
66
* @see https://github.com/leowebguy
7-
* @copyright Copyright (c) 2022, leowebguy
8-
* @license MIT
7+
* @copyright Copyright (c) 2024, leowebguy
98
*/
109

1110
namespace leowebguy\maskedfields\fields;
@@ -24,9 +23,6 @@
2423
*/
2524
class MaskedField extends PlainText implements PreviewableFieldInterface
2625
{
27-
// Public Methods
28-
// =========================================================================
29-
3026
/**
3127
* @var string
3228
*/
@@ -37,9 +33,6 @@ class MaskedField extends PlainText implements PreviewableFieldInterface
3733
*/
3834
private array $_types;
3935

40-
// Public Methods
41-
// =========================================================================
42-
4336
/**
4437
* @param array $config
4538
*/
@@ -83,11 +76,11 @@ public function rules(): array
8376
}
8477

8578
/**
86-
* @return string|null
8779
* @throws Exception
8880
* @throws LoaderError
8981
* @throws RuntimeError
9082
* @throws SyntaxError
83+
* @return string|null
9184
*/
9285
public function getSettingsHtml(): ?string
9386
{
@@ -102,11 +95,11 @@ public function getSettingsHtml(): ?string
10295
/**
10396
* @param mixed $value
10497
* @param ElementInterface|null $element
105-
* @return string
10698
* @throws LoaderError
10799
* @throws RuntimeError
108100
* @throws SyntaxError
109101
* @throws Exception
102+
* @return string
110103
*/
111104
public function getInputHtml(mixed $value, ?ElementInterface $element = null): string
112105
{

0 commit comments

Comments
 (0)