Skip to content

Commit

Permalink
Fix CS v3.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed May 22, 2023
1 parent 9ba705b commit dfa62b1
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 37 deletions.
1 change: 0 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
'use_arrow_functions' => false,

'phpdoc_var_without_name' => false, // remove once https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/6959 is fixed
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], // remove once PHP CS Fixer is upgraded to v3.17
])
->setFinder($finder)
->setCacheFile(sys_get_temp_dir() . '/php-cs-fixer.' . md5(__DIR__) . '.cache');
2 changes: 1 addition & 1 deletion src/Form/Control.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected function renderTemplateToHtml(): string
* $control->onChange(new JsExpression('$(this).parents(\'.form\').form(\'submit\')'));
*
* @param JsExpressionable|JsCallbackSetClosure|array{JsCallbackSetClosure} $expr
* @param array|bool $defaults
* @param array|bool $defaults
*/
public function onChange($expr, $defaults = []): void
{
Expand Down
4 changes: 2 additions & 2 deletions src/Form/Control/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Input extends Form\Control
/**
* Set attribute which is added directly to the <input> tag, not the surrounding <div>.
*
* @param string|int|array<string, string|int> $name
* @param string|int|array<string, string|int> $name
* @param ($name is array ? never : string|int) $value
*
* @return $this
Expand Down Expand Up @@ -148,7 +148,7 @@ protected function prepareRenderLabel($label, $spot)
* Used only from renderView().
*
* @param string|array|Button|UserAction|(AbstractView&ExecutorInterface) $button Button class or object
* @param string $spot Template spot
* @param string $spot Template spot
*
* @return Button
*/
Expand Down
14 changes: 7 additions & 7 deletions src/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ protected function initTable(): Table
* Add new column to grid. If column with this name already exists,
* an. Simply calls Table::addColumn(), so check that method out.
*
* @param string|null $name Data model field name
* @param array|Table\Column $columnDecorator
* @param string|null $name Data model field name
* @param array|Table\Column $columnDecorator
* @param ($name is null ? array{} : array|Field) $field
*
* @return Table\Column
Expand Down Expand Up @@ -462,11 +462,11 @@ public function addFilterColumn($names = null)
/**
* Add a dropdown menu to header column.
*
* @param string $columnName the name of column where to add dropdown
* @param array $items the menu items to add
* @param \Closure(string): (JsExpressionable|View|string|void) $fx the callback function to execute when an item is selected
* @param string $icon the icon
* @param string $menuId the menu ID return by callback
* @param string $columnName the name of column where to add dropdown
* @param array $items the menu items to add
* @param \Closure(string): (JsExpressionable|View|string|void) $fx the callback function to execute when an item is selected
* @param string $icon the icon
* @param string $menuId the menu ID return by callback
*/
public function addDropdown(string $columnName, $items, \Closure $fx, $icon = 'caret square down', $menuId = null): void
{
Expand Down
18 changes: 9 additions & 9 deletions src/HtmlTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ protected function emptyTagTree(TagTree $tagTree): void
*
* If tag contains another tag trees, these tag trees are emptied.
*
* @param string|array<string, string>|Model $tag
* @param string|array<string, string>|Model $tag
* @param ($tag is array|Model ? never : string|null) $value
*/
protected function _setOrAppend($tag, string $value = null, bool $encodeHtml = true, bool $append = false, bool $throwIfNotFound = true): void
Expand Down Expand Up @@ -207,7 +207,7 @@ protected function _setOrAppend($tag, string $value = null, bool $encodeHtml = t
*
* would read and set multiple region values from $_GET array.
*
* @param string|array<string, string>|Model $tag
* @param string|array<string, string>|Model $tag
* @param ($tag is array|Model ? never : string|null) $value
*
* @return $this
Expand All @@ -223,7 +223,7 @@ public function set($tag, string $value = null): self
* Same as set(), but won't generate exception for non-existing
* $tag.
*
* @param string|array<string, string>|Model $tag
* @param string|array<string, string>|Model $tag
* @param ($tag is array|Model ? never : string|null) $value
*
* @return $this
Expand All @@ -239,7 +239,7 @@ public function trySet($tag, string $value = null): self
* Set value of a tag to a HTML content. The value is set without
* encoding, so you must be sure to sanitize.
*
* @param string|array<string, string>|Model $tag
* @param string|array<string, string>|Model $tag
* @param ($tag is array|Model ? never : string|null) $value
*
* @return $this
Expand All @@ -255,7 +255,7 @@ public function dangerouslySetHtml($tag, string $value = null): self
* See dangerouslySetHtml() but won't generate exception for non-existing
* $tag.
*
* @param string|array<string, string>|Model $tag
* @param string|array<string, string>|Model $tag
* @param ($tag is array|Model ? never : string|null) $value
*
* @return $this
Expand All @@ -270,7 +270,7 @@ public function tryDangerouslySetHtml($tag, string $value = null): self
/**
* Add more content inside a tag.
*
* @param string|array<string, string>|Model $tag
* @param string|array<string, string>|Model $tag
* @param ($tag is array|Model ? never : string|null) $value
*
* @return $this
Expand All @@ -286,7 +286,7 @@ public function append($tag, ?string $value): self
* Same as append(), but won't generate exception for non-existing
* $tag.
*
* @param string|array<string, string>|Model $tag
* @param string|array<string, string>|Model $tag
* @param ($tag is array|Model ? never : string|null) $value
*
* @return $this
Expand All @@ -302,7 +302,7 @@ public function tryAppend($tag, ?string $value): self
* Add more content inside a tag. The content is appended without
* encoding, so you must be sure to sanitize.
*
* @param string|array<string, string>|Model $tag
* @param string|array<string, string>|Model $tag
* @param ($tag is array|Model ? never : string|null) $value
*
* @return $this
Expand All @@ -318,7 +318,7 @@ public function dangerouslyAppendHtml($tag, ?string $value): self
* Same as dangerouslyAppendHtml(), but won't generate exception for non-existing
* $tag.
*
* @param string|array<string, string>|Model $tag
* @param string|array<string, string>|Model $tag
* @param ($tag is array|Model ? never : string|null) $value
*
* @return $this
Expand Down
2 changes: 1 addition & 1 deletion src/Js/JsModal.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct($title, $url, array $args = [], string $dataType = '
*
* You can set option individually or supply an array.
*
* @param string|array $options
* @param string|array $options
* @param ($options is array ? never : mixed) $value
*
* @return $this
Expand Down
6 changes: 3 additions & 3 deletions src/JsCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ public function set($fx = null, $args = null)
* A proper way to finish execution of AJAX response. Generates JSON
* which is returned to frontend.
*
* @param string|null $ajaxec
* @param ($success is true ? null : string) $msg General message, typically won't be displayed
* @param bool $success Was request successful or not
* @param string|null $ajaxec
* @param ($success is true ? null : string) $msg General message, typically won't be displayed
* @param bool $success Was request successful or not
*/
public function terminateAjax($ajaxec, $msg = null, bool $success = true): void
{
Expand Down
8 changes: 4 additions & 4 deletions src/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ protected function initChunks(): void
* If you don't want table column to be associated with model field, then
* pass $name parameter as null.
*
* @param string|null $name Data model field name
* @param array|Table\Column $columnDecorator
* @param string|null $name Data model field name
* @param array|Table\Column $columnDecorator
* @param ($name is null ? array{} : array|Field) $field
*
* @return Table\Column
Expand Down Expand Up @@ -304,8 +304,8 @@ public function decoratorFactory(Field $field, $seed = [])
* name and size.
*
* @param \Closure(Jquery, mixed): (JsExpressionable|View|string|void) $fx a callback function with columns widths as parameter
* @param array<int, int> $widths ex: [100, 200, 300, 100]
* @param array $resizerOptions column-resizer module options, see https://www.npmjs.com/package/column-resizer
* @param array<int, int> $widths ex: [100, 200, 300, 100]
* @param array $resizerOptions column-resizer module options, see https://www.npmjs.com/package/column-resizer
*
* @return $this
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Table/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ public function setHeaderPopupIcon($icon): void
* Add a dropdown header menu.
*
* @param \Closure(string, string): (JsExpressionable|View|string|void) $fx
* @param string $icon
* @param string|null $menuId the menu name
* @param string $icon
* @param string|null $menuId the menu name
*/
public function addDropdown(array $items, \Closure $fx, $icon = 'caret square down', $menuId = null): void
{
Expand Down
14 changes: 7 additions & 7 deletions src/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public function removeClass($class)
* Add inline CSS style to element.
* Multiple CSS styles can also be set if passed as array.
*
* @param string|array<string, string> $property
* @param string|array<string, string> $property
* @param ($property is array ? never : string) $value
*
* @return $this
Expand Down Expand Up @@ -445,7 +445,7 @@ public function removeStyle($property)
/**
* Set attribute.
*
* @param string|int|array<string, string|int> $name
* @param string|int|array<string, string|int> $name
* @param ($name is array ? never : string|int) $value
*
* @return $this
Expand Down Expand Up @@ -772,9 +772,9 @@ public function getHtml()
* Will convert calls to jQuery chain into JavaScript string:
* $('#view').find('.current').text('abc'); // the text will be JSON encoded to avoid JS injection
*
* @param bool|string $when Event when chain will be executed
* @param bool|string $when Event when chain will be executed
* @param ($when is false ? null : JsExpressionable|null) $action JavaScript action
* @param string|self|null $selector If you wish to override jQuery($selector)
* @param string|self|null $selector If you wish to override jQuery($selector)
*
* @return ($action is null ? Jquery : null)
*/
Expand Down Expand Up @@ -953,11 +953,11 @@ public function jsReload($args = [], $afterSuccess = null, $apiConfig = []): JsE
* return $js->parent()->hide();
* });
*
* @param string $event JavaScript event
* @param string $event JavaScript event
* @param ($action is object ? string : ($action is null ? string : never)|JsExpressionable|JsCallback|JsCallbackSetClosure|array{JsCallbackSetClosure}|UserAction\ExecutorInterface|Model\UserAction) $selector Optional jQuery-style selector
* @param ($selector is string|null ? JsExpressionable|JsCallback|JsCallbackSetClosure|array{JsCallbackSetClosure}|UserAction\ExecutorInterface|Model\UserAction : array) $action code to execute
* @param ($selector is string|null ? JsExpressionable|JsCallback|JsCallbackSetClosure|array{JsCallbackSetClosure}|UserAction\ExecutorInterface|Model\UserAction : array) $action code to execute
*
* @return ($selector is null|string ? ($action is null ? Jquery : null) : ($action is null|array ? Jquery : null))
* @return ($selector is string|null ? ($action is null ? Jquery : null) : ($action is array|null ? Jquery : null))
*/
public function on(string $event, $selector = null, $action = null, array $defaults = [])
{
Expand Down

0 comments on commit dfa62b1

Please sign in to comment.