Skip to content

Commit

Permalink
Merge pull request #39 from getkirby/develop
Browse files Browse the repository at this point in the history
1.2.0
  • Loading branch information
bastianallgeier authored Oct 6, 2022
2 parents 66abd20 + ace1365 commit c424898
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 58 deletions.
106 changes: 53 additions & 53 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
<?php

$finder = PhpCsFixer\Finder::create()
->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);
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "getkirby/kql",
"description": "Kirby Query Language",
"license": "MIT",
"version": "1.2.0",
"keywords": [
"kirby",
"cms",
Expand Down
13 changes: 8 additions & 5 deletions src/Kql/Interceptors/Cms/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ protected function allowedMethodsForModels()
'mediaUrl',
'modified',
'permissions',
'panelIcon',
'panelId',
'panelPath',
'panelUrl',
'panel',
'permalink',
'previewUrl',
'url'
'url',
];
}

Expand Down Expand Up @@ -107,4 +105,9 @@ protected function allowedMethodsForParents()
'site',
];
}

public function uuid(): string
{
return $this->object->uuid()->toString();
}
}
30 changes: 30 additions & 0 deletions src/Kql/Interceptors/Panel/Model.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Kirby\Kql\Interceptors\Panel;

use Kirby\Kql\Interceptors\Interceptor;

class Model extends Interceptor
{
public const CLASS_ALIAS = 'panel';

public function allowedMethods(): array
{
return [
'dragText',
'image',
'path',
'url',
];
}

public function toArray(): array
{
return [
'dragText' => $this->dragText(),
'image' => $this->image(),
'path' => $this->path(),
'url' => $this->url(),
];
}
}

0 comments on commit c424898

Please sign in to comment.