<?php

use PhpCsFixer\Finder;
use PhpCsFixer\Config;

$finder = Finder::create()->in(__DIR__)
    ->exclude('lib')
    ->exclude('ext')
    ->exclude('tensor');

return Config::create()->setRules([
    '@PSR2' => true,
    'align_multiline_comment' => true,
    'array_syntax' => ['syntax' => 'short'],
    'backtick_to_shell_exec' => true,
    'binary_operator_spaces' => true,
    'blank_line_after_opening_tag' => true,
    'cast_spaces' => ['space' => 'single'],
    'combine_consecutive_issets' => true,
    'combine_consecutive_unsets' => true,
    'compact_nullable_typehint' => true,
    'concat_space' => ['spacing' => 'one'],
    'fully_qualified_strict_types' => true,
    'function_typehint_space' => true,
    'list_syntax' => ['syntax' => 'short'],
    'lowercase_cast' => true,
    'lowercase_static_reference' => true,
    'no_blank_lines_after_class_opening' => true,
    'no_blank_lines_after_phpdoc' => true,
    'no_empty_statement' => true,
    'no_extra_blank_lines' => true,
    'no_leading_import_slash' => true,
    'no_leading_namespace_whitespace' => true,
    'no_null_property_initialization' => true,
    'no_spaces_around_offset' => true,
    'no_unused_imports' => true,
    'object_operator_without_whitespace' => true,
    'php_unit_fqcn_annotation' => true,
    'php_unit_method_casing' => ['case' => 'camel_case'],
    'php_unit_ordered_covers' => true,
    'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
    'phpdoc_align' => ['align' => 'left'],
    'phpdoc_no_empty_return' => true,
    'phpdoc_no_useless_inheritdoc' => true,
    'phpdoc_order' => true,
    'phpdoc_scalar' => true,
    'phpdoc_single_line_var_spacing' => true,
    'phpdoc_trim' => true,
    'phpdoc_var_without_name' => true,
    'protected_to_private' => true,
    'return_type_declaration' => ['space_before' => 'one'],
    'single_blank_line_before_namespace' => true,
    'single_quote' => true,
    'single_line_comment_style' => true,
])->setFinder($finder);