Skip to content

Commit

Permalink
Merge pull request #24 from hexidedigital/develop
Browse files Browse the repository at this point in the history
Update package
  • Loading branch information
yaapis authored Dec 1, 2023
2 parents 617f397 + 922c110 commit 6412e42
Show file tree
Hide file tree
Showing 41 changed files with 996 additions and 701 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Themes are stored inside default laravel's resources folder

## Requirements

This version requires [PHP](https://www.php.net/) 7.4-8.1 and supports [Laravel](https://laravel.com/) 8-10.
This version requires [PHP](https://www.php.net/) 8.1 and supports [Laravel](https://laravel.com/) 10.

> Currently, supported only for webpack with `laravel-mix`.
Expand All @@ -14,21 +14,22 @@ This version requires [PHP](https://www.php.net/) 7.4-8.1 and supports [Laravel]
| 2.4 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
| 3.0 | :x: | :x: | :x: | :x: | :white_check_mark: | :x: | :x: | :x: | :x: |
| 4.2 | :x: | :x: | :x: | :x: | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| 5.0 | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :white_check_mark: |

## Installation

To get the latest version, simply require the project using [Composer](https://getcomposer.org/):

```bash
composer require "yaap/theme:^4.0"
composer require "yaap/theme:^5.0"
```

or manually add line to `composer.json`

```json
{
"require": {
"yaap/theme": "^4.0"
"yaap/theme": "^5.0"
}
}
```
Expand Down Expand Up @@ -166,9 +167,9 @@ project-root
| ├── default/
| | ├── assets/
| | ├── lang/
| | ├── layouts/
| | ├── partials/
| | ├── views/
| | | ├── layouts/
| | | ├── partials/
| | | └── hello.blade.php
| | └── config.php
| ├── admin/
Expand All @@ -181,12 +182,11 @@ project-root
## Init theme

```php
Theme::init($name)
\YAAP\Theme\Facades\ThemeLoader::init($name);
```

This will add to views find path:

* themes/{$name}
* themes/{$name}/views

Lang files will be added as well:
Expand All @@ -195,6 +195,8 @@ Lang files will be added as well:

### Making view

> [Laravel: Creating & Rendering Views](https://laravel.com/docs/10.x/views#creating-and-rendering-views)
```php
View::make('hello');
View::make('emails.notify');
Expand All @@ -207,7 +209,6 @@ Use laravel mix for assets.
In header

```html

<link rel="stylesheet" href="{{ mix('/themes/default/css/app.min.css') }}"/>
```

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
}
],
"require": {
"php": ">=7.4",
"laravel/framework": "^8 || ^9 || ^10"
"php": "^8.1",
"laravel/framework": "^10"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.38"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-0": {
"YAAP\\Theme": "src/"
"psr-4": {
"YAAP\\Theme\\": "src/"
}
},
"extra": {
"laravel": {
"aliases": {
"Theme": "YAAP\\Theme\\Facades\\Theme"
"ThemeLoader": "YAAP\\Theme\\Facades\\ThemeLoader"
},
"providers": [
"YAAP\\Theme\\ThemeServiceProvider"
Expand Down
4 changes: 2 additions & 2 deletions src/config/config.php → config/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
'containerDir' => [
'assets' => 'assets',
'lang' => 'lang',
'layout' => 'layouts',
'partial' => 'partials',
'layout' => 'views/layouts',
'partial' => 'views/partials',
'view' => 'views',
],
];
143 changes: 117 additions & 26 deletions php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,35 @@
'blank_line_after_opening_tag' => true,
'blank_line_between_import_groups' => true,
'braces' => true,
'cast_spaces' => true,
'class_attributes_separation' => ['elements'=>['method'=>'one']],
'cast_spaces' => [
'space' => 'none',
],
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'class_definition' => true,
'class_reference_name_casing' => true,
'clean_namespace' => true,
'combine_nested_dirname' => true,
'compact_nullable_typehint' => true,
'concat_space' => ['spacing'=>'one'],
'concat_space' => ['spacing' => 'one'],
'constant_case' => true,
'declare_equal_normalize' => true,
'declare_strict_types' => false,
'dir_constant' => true,
'echo_tag_syntax' => true,
'elseif' => true,
'empty_loop_body' => ['style'=>'braces'],
'empty_loop_body' => ['style' => 'braces'],
'empty_loop_condition' => true,
'encoding' => true,
'ereg_to_preg' => true,
'error_suppression' => true,
'fopen_flag_order' => true,
'fopen_flags' => ['b_mode'=>false],
'fopen_flags' => ['b_mode' => false],
'full_opening_tag' => true,
'fully_qualified_strict_types' => true,
'function_declaration' => true,
'function_to_constant' => true,
'function_typehint_space' => true,
'general_phpdoc_tag_rename' => ['replacements'=>['inheritDocs'=>'inheritDoc']],
'general_phpdoc_tag_rename' => ['replacements' => ['inheritDocs' => 'inheritDoc']],
'heredoc_indentation' => true,
'implode_call' => true,
'include' => true,
Expand All @@ -71,12 +73,8 @@
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_argument_space' => ['after_heredoc'=>true],
'method_argument_space' => ['after_heredoc' => true],
'modernize_types_casting' => true,
'native_constant_invocation' => true,
'native_function_casing' => true,
'native_function_invocation' => ['include'=>['@compiler_optimized'], 'scope'=>'namespaced', 'strict'=>true],
'native_function_type_declaration_casing' => true,
'new_with_braces' => true,
'no_alias_functions' => true,
'no_alias_language_construct_call' => true,
Expand All @@ -89,7 +87,21 @@
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => ['tokens'=>['attribute', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'switch', 'throw', 'use']],
'no_extra_blank_lines' => [
'tokens' => [
'attribute',
'case',
'continue',
'curly_brace_block',
'default',
'extra',
'parenthesis_brace_block',
'square_brace_block',
'switch',
'throw',
'use',
],
],
'no_homoglyph_names' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
Expand All @@ -102,27 +114,42 @@
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
'no_spaces_inside_parenthesis' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed'=>true, 'allow_unused_params'=>true],
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'allow_unused_params' => true],
'no_trailing_comma_in_singleline' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_trailing_whitespace_in_string' => true,
'no_unneeded_control_parentheses' => ['statements'=>['break', 'clone', 'continue', 'echo_print', 'others', 'return', 'switch_case', 'yield', 'yield_from']],
'no_unneeded_curly_braces' => ['namespaces'=>true],
'no_unneeded_control_parentheses' => [
'statements' => [
'break',
'clone',
'continue',
'echo_print',
'others',
'return',
'switch_case',
'yield',
'yield_from',
],
],
'no_unneeded_curly_braces' => ['namespaces' => true],
'no_unneeded_final_method' => true,
'no_unneeded_import_alias' => true,
'no_unreachable_default_argument_value' => true,
'no_unset_cast' => true,
'no_unused_imports' => true,
'no_useless_nullsafe_operator' => true,
'no_useless_sprintf' => true,
'no_whitespace_before_comma_in_array' => ['after_heredoc'=>true],
'no_whitespace_before_comma_in_array' => ['after_heredoc' => true],
'no_whitespace_in_blank_line' => true,
'non_printable_character' => true,
'normalize_index_brace' => true,
'object_operator_without_whitespace' => true,
'ordered_class_elements' => ['order'=>['use_trait']],
'ordered_imports' => true,
'ordered_class_elements' => ['order' => ['use_trait']],
'ordered_imports' => [
'imports_order' => ['class', 'const', 'function'],
'sort_algorithm' => 'alpha',
],
'ordered_traits' => true,
'php_unit_construct' => true,
'php_unit_fqcn_annotation' => true,
Expand All @@ -144,17 +171,17 @@
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => true,
'phpdoc_tag_type' => ['tags'=>['inheritDoc'=>'inline']],
'phpdoc_tag_type' => ['tags' => ['inheritDoc' => 'inline']],
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types' => true,
'phpdoc_types_order' => ['null_adjustment'=>'always_last', 'sort_algorithm'=>'none'],
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'phpdoc_var_without_name' => true,
'pow_to_exponentiation' => true,
'protected_to_private' => true,
'psr_autoloading' => true,
'random_api_migration' => ['replacements'=>['mt_rand'=>'random_int', 'rand'=>'random_int']],
'random_api_migration' => ['replacements' => ['mt_rand' => 'random_int', 'rand' => 'random_int']],
'return_type_declaration' => true,
'self_accessor' => true,
'semicolon_after_instruction' => true,
Expand All @@ -163,16 +190,80 @@
'simple_to_complex_string_variable' => true,
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'single_class_element_per_statement' => ['elements'=>['property']],
'single_class_element_per_statement' => ['elements' => ['property']],
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'single_line_comment_spacing' => true,
'single_line_comment_style' => ['comment_types'=>['hash']],
'single_line_comment_style' => ['comment_types' => ['hash']],
'single_line_throw' => true,
'single_quote' => true,
'single_space_after_construct' => ['constructs'=>['abstract', 'as', 'attribute', 'break', 'case', 'catch', 'class', 'clone', 'comment', 'const', 'const_import', 'continue', 'do', 'echo', 'else', 'elseif', 'enum', 'extends', 'final', 'finally', 'for', 'foreach', 'function', 'function_import', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'match', 'named_argument', 'namespace', 'new', 'open_tag_with_echo', 'php_doc', 'php_open', 'print', 'private', 'protected', 'public', 'readonly', 'require', 'require_once', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'type_colon', 'use', 'use_lambda', 'use_trait', 'var', 'while', 'yield', 'yield_from']],
'single_space_after_construct' => [
'constructs' => [
'abstract',
'as',
'attribute',
'break',
'case',
'catch',
'class',
'clone',
'comment',
'const',
'const_import',
'continue',
'do',
'echo',
'else',
'elseif',
'enum',
'extends',
'final',
'finally',
'for',
'foreach',
'function',
'function_import',
'global',
'goto',
'if',
'implements',
'include',
'include_once',
'instanceof',
'insteadof',
'interface',
'match',
'named_argument',
'namespace',
'new',
'open_tag_with_echo',
'php_doc',
'php_open',
'print',
'private',
'protected',
'public',
'readonly',
'require',
'require_once',
'return',
'static',
'switch',
'throw',
'trait',
'try',
'type_colon',
'use',
'use_lambda',
'use_trait',
'var',
'while',
'yield',
'yield_from',
],
],
'single_trait_insert_per_statement' => true,
'space_after_semicolon' => ['remove_in_empty_for_expressions'=>true],
'space_after_semicolon' => ['remove_in_empty_for_expressions' => true],
'standardize_increment' => true,
'standardize_not_equals' => true,
'string_length_to_empty' => true,
Expand All @@ -183,7 +274,7 @@
'ternary_operator_spaces' => true,
'ternary_to_elvis_operator' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline' => ['after_heredoc'=>true],
'trailing_comma_in_multiline' => ['after_heredoc' => true],
'trim_array_spaces' => true,
'types_spaces' => true,
'unary_operator_spaces' => true,
Expand Down
Loading

0 comments on commit 6412e42

Please sign in to comment.