-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from leonhelmus/phpstorm/feature/liveTemplates
Added live template files/ template files
- Loading branch information
Showing
59 changed files
with
979 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# coding-standard-phpstorm | ||
|
||
These commando's can be used in xml, php and phtml files. | ||
|
||
## M2 XML | ||
All xml templates make use of the includes "M2 XML File Header.xml". | ||
All xml files also have appropriated xsd paths. | ||
|
||
Available templates: | ||
* M2 db schema xml: | ||
* M2 di xml: | ||
* M2 extension attributes xml: | ||
* M2 layout xml: | ||
* M2 module xml: | ||
|
||
## M2 PHP Classes | ||
All php files are PHP 7.1 or higher. These files have strict_types=1 on top of the templates and | ||
make use of includes "M2 PHP File Header.php". | ||
|
||
Make use of `new > file > PHP Class` and select a different template all PHP templates start with M2. | ||
If the one mentioned below is not present go to `file > settings > Editor -> File and Code Templates` and enable the template you're searching for. | ||
This way Namespaces and vendor will be automatically filled in. | ||
|
||
Available templates: | ||
* **M2 class**: Default M2 php class. | ||
* **M2 class - Block**: PHP class that extends Template class. | ||
* **M2 class - Helper**: PHP class that extends AbstractHelper | ||
* **M2 class - Observer**: PHP class that implements ObserverInterface | ||
* **M2 class - ViewModel**: PHP class that implements ArgumentInterface | ||
|
||
## M2 ACL | ||
Available templates: | ||
* **M2 Acl XML**: Create an acl template that already has path to backend menu and backend config (system.xml) | ||
|
||
Available commands: | ||
* **m2aclresource** -> Create a resource tag, available params | ||
* Vendor: vendor name | ||
* namespace: name of module | ||
* resourceId: acl id | ||
* title: acl title | ||
* order: sort order | ||
|
||
## M2 Config | ||
Available templates: | ||
* **M2 Config XML**: Create an config with default structure. | ||
|
||
Available commands: | ||
* None | ||
|
||
## M2 DB Schema | ||
Available templates: | ||
* **M2 Db schema XML**: Create an db schema with default structure. | ||
|
||
Available commands: | ||
* **m2dbtable**: Create an table. | ||
* **m2dbcolumnvarchar**: Create an column as a varchar. | ||
* **m2dbcolumnint**: Create an column as a int. | ||
* **m2dbcolumndecimal**: Create an column decimal. | ||
* **m2dbforeign**: Create an foreign key index. | ||
* **m2dbcolumncreate**: Create an create created_at column. | ||
* **m2dbindex**: Create an index. | ||
* **m2dbcolumnupdate**: Create an updated_at column. | ||
|
||
## M2 DI | ||
Available templates: | ||
* **M2 DI**: Create an DI file. | ||
|
||
Available commands: | ||
* **m2diplugin**: Create an plugin tyoe. | ||
* **m2divirtual**: Create an virtual type | ||
* **m2dipreference**: Create an preference(rewrite) | ||
|
||
## M2 Extension Attribute | ||
Available templates: | ||
* **M2 Extension Attributes XML**: Create an extension attribute file with default structure. | ||
|
||
## M2 Layout | ||
Available templates: | ||
* **M2 Layout XML**: Create an layout XML with default structure | ||
|
||
## M2 Module | ||
Available templates: | ||
* **M2 Module XML**: Create an module XML file that has default structure | ||
|
||
Available commands: | ||
* **m2mod**: Create an module tag | ||
* **m2modsequence**: Create an sequence tag | ||
|
||
## M2 Registration | ||
Available templates: | ||
* **M2 Module XML**: Create an registration file with the method to register a m2 module | ||
|
||
Available commands: | ||
* **m2reg**: Create registration file | ||
|
||
## M2 Sales | ||
Available templates: | ||
* **M2 Sales XML**: Create an sales xml file for registrating new totals. | ||
|
||
Available commands: | ||
* None | ||
|
||
## M2 System / System Include | ||
Available templates: | ||
* **M2 System XML**: Create an system.xml with default structure. | ||
* **M2 System Include XML**: Create an system include that can be included in a system.xml with default structure. | ||
|
||
Available commands: | ||
* **m2syssection**: Create an section tag. | ||
* **m2sysinclude**: Create an include tag. | ||
* **m2sysgroup**: Create an group tag. | ||
* **m2sysfieldcmspage**: Create a dropdown field with all cms pages. | ||
* **m2sysfieldyesno**: Create a dropdown with yes and no. | ||
* **m2sysfieldpagelayout**: Create a dropdown with all page layouts. | ||
* **m2sysfieldenabledisable**: Create a dropdown with enable/disable. | ||
* **m2sysfieldpassword**: Create an obscure password field. | ||
* **m2sysfieldtext**: Create a text field. | ||
* **m2sysfieldtextarea**: Create a textarea field. | ||
* **m2sysfieldpricetype**: Create a dropdown with all price types. | ||
* **m2sysfieldproducttax**: Create a dropdown with all product taxes. | ||
* **m2sysfieldcountry**: Create a dropdown with all countries. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,14 +9,16 @@ | |
"email": "[email protected]" | ||
} | ||
], | ||
"version": "1.7.0", | ||
"require": { | ||
"php": "^5.4.0 || ^7.0", | ||
"php": "^5.4 || ^7.1", | ||
"composer-plugin-api": "^1.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^7.5", | ||
"composer/composer": "^1.3", | ||
"mediact/testing-suite": "@stable", | ||
"kint-php/kint": "@stable", | ||
"mediact/testing-suite": "^1.20", | ||
"mikey179/vfsstream": "^1.6" | ||
}, | ||
"autoload": { | ||
|
@@ -30,10 +32,7 @@ | |
} | ||
}, | ||
"extra": { | ||
"class": "Mediact\\CodingStandard\\PhpStorm\\Plugin", | ||
"grumphp": { | ||
"config-default-path": "vendor/mediact/testing-suite/config/default/grumphp.yml" | ||
} | ||
"class": "Mediact\\CodingStandard\\PhpStorm\\Plugin" | ||
}, | ||
"archive": { | ||
"exclude": [ | ||
|
@@ -43,7 +42,11 @@ | |
"/phpunit.xml", | ||
"/phpmd.xml", | ||
"/phpstan.neon", | ||
"/phpcs.xml" | ||
"/phpcs.xml", | ||
"/grumphp.yml" | ||
] | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
#parse("M2 XML File Header") | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> | ||
<acl> | ||
<resources> | ||
<resource id="Magento_Backend::admin"> | ||
|
||
</resource> | ||
<resource id="Magento_Backend::stores"> | ||
<resource id="Magento_Backend::stores_settings"> | ||
<resource id="Magento_Config::config"> | ||
#[[$END$]]# | ||
</resource> | ||
</resource> | ||
</resource> | ||
</resources> | ||
</acl> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php declare(strict_types=1); | ||
#parse("M2 PHP File Header") | ||
|
||
#if (${NAMESPACE}) | ||
namespace ${NAMESPACE}; | ||
#end | ||
|
||
use Magento\Framework\View\Element\Template; | ||
|
||
class ${NAME} extends Template | ||
{ | ||
#[[$END$]]# | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php declare(strict_types=1); | ||
#parse("M2 PHP File Header") | ||
|
||
#if (${NAMESPACE}) | ||
namespace ${NAMESPACE}; | ||
#end | ||
|
||
use Magento\Framework\App\Helper\AbstractHelper; | ||
|
||
class ${NAME} extends AbstractHelper | ||
{ | ||
#[[$END$]]# | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php declare(strict_types=1); | ||
#parse("M2 PHP File Header") | ||
|
||
#if (${NAMESPACE}) | ||
namespace ${NAMESPACE}; | ||
#end | ||
|
||
use Magento\Framework\Event\ObserverInterface; | ||
|
||
class ${NAME} implements ObserverInterface | ||
{ | ||
#[[$END$]]# | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php declare(strict_types=1); | ||
#parse("M2 PHP File Header") | ||
|
||
#if (${NAMESPACE}) | ||
namespace ${NAMESPACE}; | ||
#end | ||
|
||
use Magento\Framework\View\Element\Block\ArgumentInterface; | ||
|
||
class ${NAME} implements ArgumentInterface | ||
{ | ||
#[[$END$]]# | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php declare(strict_types=1); | ||
#parse("M2 PHP File Header") | ||
|
||
#if (${NAMESPACE}) | ||
namespace ${NAMESPACE}; | ||
#end | ||
|
||
class ${NAME} | ||
{ | ||
#[[$END$]]# | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0"?> | ||
#parse("M2 XML File Header") | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> | ||
<default> | ||
#[[$END$]]# | ||
</default> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0"?> | ||
#parse("M2 XML File Header") | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> | ||
#[[$END$]]# | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0"?> | ||
#parse("M2 XML File Header") | ||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> | ||
#[[$END$]]# | ||
</schema> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0"?> | ||
#parse("M2 XML File Header") | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> | ||
#[[$END$]]# | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0"?> | ||
#parse("M2 XML File Header") | ||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | ||
<body> | ||
#[[$END$]]# | ||
</body> | ||
</page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0"?> | ||
#parse("M2 XML File Header") | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> | ||
m2module#[[$END$]]# | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
#parse("M2 PHP File Header") | ||
|
||
use Magento\Framework\Component\ComponentRegistrar; | ||
|
||
ComponentRegistrar::register( | ||
ComponentRegistrar::MODULE, | ||
'${Vendor}_${Namespace}', | ||
__DIR__ | ||
); | ||
#[[$END$]]# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0"?> | ||
#parse("M2 XML File Header") | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> | ||
<section name="quote"> | ||
<group name="totals"> | ||
#[[$END$]]# | ||
</group> | ||
</section> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0"?> | ||
#parse("M2 XML File Header") | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> | ||
<system> | ||
#[[$END$]]# | ||
</system> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0"?> | ||
#parse("M2 XML File Header") | ||
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd"> | ||
#[[$END$]]# | ||
</include> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.