diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index b9d8f97..5dc5e7a 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,60 +1,60 @@ exclude('dependencies') - ->exclude('panel/node_modules') - ->in(__DIR__); + ->exclude('dependencies') + ->exclude('panel/node_modules') + ->in(__DIR__); $config = new PhpCsFixer\Config(); return $config - ->setRules([ - '@PSR12' => true, - 'align_multiline_comment' => ['comment_type' => 'phpdocs_like'], - 'array_indentation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'cast_spaces' => ['space' => 'none'], - // 'class_keyword_remove' => true, // replaces static::class with 'static' (won't work) - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'combine_nested_dirname' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => ['space' => 'single'], - 'dir_constant' => true, - 'function_typehint_space' => true, - 'include' => true, - 'logical_operators' => true, - 'lowercase_cast' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'magic_method_casing' => true, - 'method_chaining_indentation' => true, - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - 'native_function_casing' => true, - 'native_function_type_declaration_casing' => true, - 'new_with_braces' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => ['use' => 'echo'], - 'no_unneeded_control_parentheses' => true, - 'no_unused_imports' => true, - 'no_useless_return' => true, - 'ordered_imports' => ['sort_algorithm' => 'alpha'], - // 'phpdoc_add_missing_param_annotation' => ['only_untyped' => false], // adds params in the wrong order - 'phpdoc_align' => ['align' => 'left'], - 'phpdoc_indent' => true, - 'phpdoc_scalar' => true, - 'phpdoc_trim' => true, - 'short_scalar_cast' => true, - 'single_line_comment_style' => true, - 'single_quote' => true, - 'ternary_to_null_coalescing' => true, - 'whitespace_after_comma_in_array' => true - ]) - ->setRiskyAllowed(true) + ->setRules([ + '@PSR12' => true, + 'align_multiline_comment' => ['comment_type' => 'phpdocs_like'], + 'array_indentation' => true, + 'array_syntax' => ['syntax' => 'short'], + 'cast_spaces' => ['space' => 'none'], + // 'class_keyword_remove' => true, // replaces static::class with 'static' (won't work) + 'combine_consecutive_issets' => true, + 'combine_consecutive_unsets' => true, + 'combine_nested_dirname' => true, + 'concat_space' => ['spacing' => 'one'], + 'declare_equal_normalize' => ['space' => 'single'], + 'dir_constant' => true, + 'function_typehint_space' => true, + 'include' => true, + 'logical_operators' => true, + 'lowercase_cast' => true, + 'lowercase_static_reference' => true, + 'magic_constant_casing' => true, + 'magic_method_casing' => true, + 'method_chaining_indentation' => true, + 'modernize_types_casting' => true, + 'multiline_comment_opening_closing' => true, + 'native_function_casing' => true, + 'native_function_type_declaration_casing' => true, + 'new_with_braces' => true, + 'no_blank_lines_after_class_opening' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_empty_comment' => true, + 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, + 'no_leading_namespace_whitespace' => true, + 'no_mixed_echo_print' => ['use' => 'echo'], + 'no_unneeded_control_parentheses' => true, + 'no_unused_imports' => true, + 'no_useless_return' => true, + 'ordered_imports' => ['sort_algorithm' => 'alpha'], + // 'phpdoc_add_missing_param_annotation' => ['only_untyped' => false], // adds params in the wrong order + 'phpdoc_align' => ['align' => 'left'], + 'phpdoc_indent' => true, + 'phpdoc_scalar' => true, + 'phpdoc_trim' => true, + 'short_scalar_cast' => true, + 'single_line_comment_style' => true, + 'single_quote' => true, + 'ternary_to_null_coalescing' => true, + 'whitespace_after_comma_in_array' => true + ]) + ->setRiskyAllowed(true) ->setIndent("\t") - ->setFinder($finder); + ->setFinder($finder); diff --git a/composer.json b/composer.json index 83dc47a..4966226 100755 --- a/composer.json +++ b/composer.json @@ -2,6 +2,7 @@ "name": "getkirby/kql", "description": "Kirby Query Language", "license": "MIT", + "version": "1.2.0", "keywords": [ "kirby", "cms", diff --git a/src/Kql/Interceptors/Cms/Model.php b/src/Kql/Interceptors/Cms/Model.php index 20c0726..7e23ca4 100644 --- a/src/Kql/Interceptors/Cms/Model.php +++ b/src/Kql/Interceptors/Cms/Model.php @@ -72,12 +72,10 @@ protected function allowedMethodsForModels() 'mediaUrl', 'modified', 'permissions', - 'panelIcon', - 'panelId', - 'panelPath', - 'panelUrl', + 'panel', + 'permalink', 'previewUrl', - 'url' + 'url', ]; } @@ -107,4 +105,9 @@ protected function allowedMethodsForParents() 'site', ]; } + + public function uuid(): string + { + return $this->object->uuid()->toString(); + } } diff --git a/src/Kql/Interceptors/Panel/Model.php b/src/Kql/Interceptors/Panel/Model.php new file mode 100755 index 0000000..6c0bbda --- /dev/null +++ b/src/Kql/Interceptors/Panel/Model.php @@ -0,0 +1,30 @@ + $this->dragText(), + 'image' => $this->image(), + 'path' => $this->path(), + 'url' => $this->url(), + ]; + } +}