Skip to content

Commit 18ea6cc

Browse files
Merge pull request #4 from getkirby/feat/kirby-4
Kirby 4 & 5 support
2 parents 50a2fe6 + 9589d5a commit 18ea6cc

17 files changed

Lines changed: 1769 additions & 525 deletions

.editorconfig

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
# This file is for unifying the coding style for different editors and IDEs
22
# editorconfig.org
33

4+
# PHP PSR-12 Coding Standards
5+
# https://www.php-fig.org/psr/psr-12/
6+
7+
root = true
8+
49
[*]
510
charset = utf-8
6-
indent_style = space
7-
indent_size = 2
811
end_of_line = lf
9-
insert_final_newline = true
12+
indent_style = tab
13+
indent_size = 2
1014
trim_trailing_whitespace = true
1115

1216
[*.php]
1317
indent_size = 4
18+
insert_final_newline = true
1419

15-
[*.md,*.txt]
16-
trim_trailing_whitespace = false
17-
insert_final_newline = false
20+
[*.yml]
21+
indent_style = space
1822

19-
[composer.json]
20-
indent_size = 4
23+
[*.md]
24+
trim_trailing_whitespace = false

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99
/.cache
1010
/.php_cs.cache
1111
/.phpunit.result.cache
12+
/vendor
13+
.php-cs-fixer.cache
14+
.phpunit.cache

.php-cs-fixer.php

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->exclude('dependencies')
5+
->in(__DIR__);
6+
7+
$config = new PhpCsFixer\Config();
8+
return $config
9+
->setRules([
10+
'@PSR12' => true,
11+
'align_multiline_comment' => ['comment_type' => 'all_multiline'],
12+
'array_indentation' => true,
13+
'array_syntax' => ['syntax' => 'short'],
14+
'assign_null_coalescing_to_coalesce_equal' => true,
15+
'cast_spaces' => ['space' => 'none'],
16+
'combine_consecutive_issets' => true,
17+
'combine_consecutive_unsets' => true,
18+
'combine_nested_dirname' => true,
19+
'concat_space' => ['spacing' => 'one'],
20+
'declare_equal_normalize' => ['space' => 'single'],
21+
'dir_constant' => true,
22+
'function_typehint_space' => true,
23+
'include' => true,
24+
'logical_operators' => true,
25+
'magic_constant_casing' => true,
26+
'magic_method_casing' => true,
27+
'method_chaining_indentation' => true,
28+
'modernize_types_casting' => true,
29+
'multiline_comment_opening_closing' => true,
30+
'native_function_casing' => true,
31+
'native_function_type_declaration_casing' => true,
32+
'new_with_braces' => true,
33+
'no_blank_lines_after_phpdoc' => true,
34+
'no_empty_comment' => true,
35+
'no_empty_phpdoc' => true,
36+
'no_empty_statement' => true,
37+
'no_leading_namespace_whitespace' => true,
38+
'no_mixed_echo_print' => ['use' => 'echo'],
39+
'no_short_bool_cast' => true,
40+
'no_superfluous_elseif' => true,
41+
'no_superfluous_phpdoc_tags' => ['allow_unused_params' => true],
42+
'no_unneeded_braces' => true,
43+
'no_unneeded_control_parentheses' => true,
44+
'no_unneeded_import_alias' => true,
45+
'no_unused_imports' => true,
46+
'no_useless_else' => true,
47+
'no_useless_nullsafe_operator' => true,
48+
'no_useless_return' => true,
49+
'no_whitespace_before_comma_in_array' => true,
50+
'nullable_type_declaration' => ['syntax' => 'union'],
51+
'nullable_type_declaration_for_default_null_value' => true,
52+
'object_operator_without_whitespace' => true,
53+
'operator_linebreak' => ['position' => 'end', 'only_booleans' => true],
54+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
55+
'ordered_types' => ['sort_algorithm' => 'none', 'null_adjustment' => 'always_last'],
56+
'phpdoc_align' => ['align' => 'left'],
57+
'phpdoc_indent' => true,
58+
'phpdoc_param_order' => true,
59+
'phpdoc_scalar' => true,
60+
'phpdoc_trim' => true,
61+
'php_unit_fqcn_annotation' => true,
62+
'single_line_comment_style' => true,
63+
'single_quote' => true,
64+
'statement_indentation' => ['stick_comment_to_next_continuous_control_statement' => true],
65+
'ternary_to_null_coalescing' => true,
66+
'trim_array_spaces' => true,
67+
'whitespace_after_comma_in_array' => true
68+
])
69+
->setRiskyAllowed(true)
70+
->setIndent("\t")
71+
->setFinder($finder);

.php_cs

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

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Kirby GEO Plugin
22

3-
This plugin adds basic geo search and conversion functionalities to Kirby
3+
This plugin adds basic geo search and conversion functionalities to Kirby.
4+
5+
### Supports
6+
7+
- Current releases support Kirby 4 and 5
8+
- For Kirby 3 support, please use [v1.0.2](https://github.com/getkirby/geo/releases/tag/1.0.2)
49

510
## Geo Class Option
611

@@ -152,6 +157,7 @@ echo $page->location()->niceDistance($hamburg);
152157
```
153158

154159
## What’s Kirby?
160+
155161
- **[getkirby.com](https://getkirby.com)** – Get to know the CMS.
156162
- **[Try it](https://getkirby.com/try)** – Take a test ride with our online demo. Or download one of our kits to get started.
157163
- **[Documentation](https://getkirby.com/docs/guide)** – Read the official guide, reference and cookbook recipes.

composer.json

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
11
{
2-
"name": "getkirby/geo",
3-
"description": "Kirby Geo",
4-
"keywords": ["kirby", "cms", "geo", "location", "plugin"],
5-
"license": "MIT",
6-
"version": "1.0.2",
7-
"homepage": "https://getkirby.com",
8-
"type": "kirby-plugin",
9-
"authors": [
10-
{
11-
"name": "Bastian Allgeier",
12-
"email": "bastian@getkirby.com"
13-
}
14-
],
15-
"require": {
16-
"php": ">=7.4.0",
17-
"getkirby/composer-installer": "^1.2"
18-
},
19-
"require-dev": {
20-
"getkirby/cms": "^3.3"
21-
},
22-
"config": {
23-
"optimize-autoloader": true
24-
},
25-
"scripts": {
26-
"analyze": "phpstan analyse",
27-
"fix": "php-cs-fixer fix --config .php_cs"
28-
}
2+
"name": "getkirby/geo",
3+
"description": "Kirby Geo",
4+
"keywords": [
5+
"kirby",
6+
"cms",
7+
"geo",
8+
"location",
9+
"plugin"
10+
],
11+
"license": "MIT",
12+
"version": "2.0.0",
13+
"homepage": "https://getkirby.com",
14+
"type": "kirby-plugin",
15+
"authors": [
16+
{
17+
"name": "Bastian Allgeier",
18+
"email": "bastian@getkirby.com"
19+
}
20+
],
21+
"require": {
22+
"php": ">=8.1.0",
23+
"getkirby/composer-installer": "^1.2.1"
24+
},
25+
"require-dev": {
26+
"getkirby/cms": "^4.0"
27+
},
28+
"config": {
29+
"optimize-autoloader": true,
30+
"allow-plugins": {
31+
"getkirby/composer-installer": true
32+
}
33+
},
34+
"extra": {
35+
"kirby-cms-path": false
36+
},
37+
"scripts": {
38+
"analyze": "phpstan analyse",
39+
"fix": "php-cs-fixer fix",
40+
"test": "phpunit"
41+
}
2942
}

0 commit comments

Comments
 (0)