Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
wobqqq committed Apr 5, 2024
0 parents commit be78db3
Show file tree
Hide file tree
Showing 19 changed files with 1,165 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/.idea

/.php-cs-fixer.php
/.php-cs-fixer.cache

/vendor
/composer.lock
66 changes: 66 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php

require __DIR__.'/vendor/autoload.php';

$finder = PhpCsFixer\Finder::create()->in(__DIR__);

return (new PhpCsFixer\Config())
->setFinder($finder)
->setRules([
'@PSR12' => true,
'blank_line_after_opening_tag' => true,
'braces' => [
'allow_single_line_anonymous_class_with_empty_body' => true,
],
'compact_nullable_typehint' => true,
'declare_equal_normalize' => true,
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'new_with_braces' => true,
'no_blank_lines_after_class_opening' => true,
'no_leading_import_slash' => true,
'no_whitespace_in_blank_line' => true,
'ordered_class_elements' => [
'order' => [
'use_trait',
],
],
'ordered_imports' => [
'imports_order' => [
'class',
'function',
'const',
],
'sort_algorithm' => 'alpha',
],
'return_type_declaration' => true,
'short_scalar_cast' => true,
'single_trait_insert_per_statement' => true,
'ternary_operator_spaces' => true,
'visibility_required' => [
'elements' => [
'const',
'method',
'property',
],
],
'array_syntax' => [
'syntax' => 'short',
],
'concat_space' => [
'spacing' => 'one',
],
'fully_qualified_strict_types' => true,
'native_function_invocation' => [
'include' => [],
'strict' => true,
],
'no_unused_imports' => true,
'single_quote' => true,
'space_after_semicolon' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
])
->setRiskyAllowed(true);
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Sergey Zakharevich

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# IDE Helper Generator for October CMS

**Complete PHPDocs, directly from the source**

This package generates helper files that enable your IDE to provide accurate autocompletion.
Generation is done based on the files in your project, so they are always up-to-date.
This package extends the [Laravel IDE Helper package](https://github.com/barryvdh/laravel-ide-helper)

- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

## Installation

Require this package with composer using the following command:

```bash
composer require --dev wobqqq/oc-ide-helper
```

Add the following class to the `providers` array in `config/app.php`:

```php
'providers' => array_merge(include(base_path('modules/system/providers.php')), [
Wobqqq\IdeHelper\IdeHelperServiceProvider::class,
]),
```

Publish the `config/ide-helper.php` configuration file:

```bash
php artisan vendor:publish --provider="Wobqqq\IdeHelper\IdeHelperServiceProvider" --tag=config
```

If you want, you can change the path to the models in the `config/ide-helper.php` config file:

```php
'model_locations' => [
'./plugins/MyPlugins/MyPlugin/models/'
],
```

## Usage

Basic commands:

- PHPDoc generation for Laravel Facades - `php artisan ide-helper:generate`
- PHPDocs for models - `php artisan ide-helper:models`
- PhpStorm Meta file - `php artisan ide-helper:meta`

You can get more information on usage [here](https://github.com/barryvdh/laravel-ide-helper?tab=readme-ov-file#usage).

## License

The Laravel IDE Helper Generator is open-sourced software licensed under
the [MIT license](http://opensource.org/licenses/MIT)
41 changes: 41 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "wobqqq/oc-ide-helper",
"description": "October CMS IDE Helper (extended laravel-ide-helper package)",
"homepage": "https://github.com/wobqqq/oc-ide-helper",
"keywords": [
"OctoberCms",
"PHP",
"IDE"
],
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Sergey Zakharevich",
"email": "[email protected]"
}
],
"require": {
"php": "^7.1 || ^8.0",
"barryvdh/laravel-ide-helper": "^2.5.0"
},
"require-dev": {
"illuminate/database": "^10.38 || ^11",
"october/rain": "^3.6",
"friendsofphp/php-cs-fixer": "^3",
"phpstan/phpstan": "^1.10"
},
"autoload": {
"psr-4": {
"Wobqqq\\IdeHelper\\": "src/"
}
},
"scripts": {
"code.cs-fixer": "php-cs-fixer --diff fix",
"code.phpstan": "vendor/bin/phpstan analyse --memory-limit=512M",
"code.fix_and_analyse": [
"@code.cs-fixer",
"@code.phpstan"
]
}
}
Loading

0 comments on commit be78db3

Please sign in to comment.