Skip to content

Commit ca2b741

Browse files
committed
init commit
0 parents  commit ca2b741

16 files changed

+446
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/
2+
out/

LICENSE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Copyright (c) 2016, Jiří Pudil
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+
10+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Nette factory interface generator
2+
3+
This plugin allows you to quickly generate factory interface for your components and other classes.
4+
5+
## Installation and requirements
6+
7+
This plugin is written for PhpStorm 10 and above and is compiled for Java 8. You can find it in the Jetbrains plugin repository. Install it from Preferences → Plugins → Browse repositories... and search for it.
8+
9+
10+
## Usage
11+
12+
With cursor anywhere in a PHP class, press <kbd>Alt</kbd> + <kbd>Enter</kbd> to open the intentions selection. Choose "Generate service factory interface".
13+
14+
![Intention menu](doc/intentions.png)
15+
16+
A dialog will pop up allowing you to change the name of the factory interface and pick which constructor parameters should be enumerated in the factory's `create` method.
17+
18+
![Generate factory interface dialog](doc/generate_dialog.png)
19+
20+
A new PHP file will then be created in the same directory, based on your `PHP File` file template. It will contain the factory interface, residing in the same namespace as the original class.
21+
22+
![Generated factory interface](doc/factory_interface.png)

doc/factory_interface.png

59.3 KB
Loading

doc/generate_dialog.png

78.7 KB
Loading

doc/intentions.png

73.8 KB
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="PLUGIN_MODULE" version="4">
3+
<component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/resources/META-INF/plugin.xml" />
4+
<component name="NewModuleRootManager" inherit-compiler-output="true">
5+
<exclude-output />
6+
<content url="file://$MODULE_DIR$">
7+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
8+
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
9+
</content>
10+
<orderEntry type="inheritedJdk" />
11+
<orderEntry type="sourceFolder" forTests="false" />
12+
<orderEntry type="library" scope="PROVIDED" name="php-openapi" level="project" />
13+
</component>
14+
</module>

resources/META-INF/plugin.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<idea-plugin version="2">
2+
<id>cz.jiripudil.intellij.nette.factoryGenerator</id>
3+
<name>Nette factory interface generator</name>
4+
<version>1.0.0</version>
5+
<vendor email="[email protected]" url="https://jiripudil.cz">Jiří Pudil</vendor>
6+
7+
<description><![CDATA[
8+
<a href="https://github.com/jiripudil/intellij-nette-factory-generator">Github</a>
9+
<p>This plugin allows you to quickly generate factory interface for your components and other classes.</p>
10+
]]></description>
11+
12+
<change-notes><![CDATA[
13+
<h2>1.0.0</h2>
14+
<ul>
15+
<li>Initial release.</li>
16+
</ul>
17+
]]></change-notes>
18+
19+
<idea-version since-build="143.0"/>
20+
21+
<depends>com.intellij.modules.lang</depends>
22+
<depends>com.jetbrains.php</depends>
23+
24+
<extensions defaultExtensionNs="com.intellij">
25+
<intentionAction>
26+
<className>cz.jiripudil.intellij.nette.factoryGenerator.intention.GenerateFactoryInterfaceIntention</className>
27+
<category>Nette</category>
28+
<descriptionDirectoryName>GenerateFactoryInterfaceIntention</descriptionDirectoryName>
29+
</intentionAction>
30+
</extensions>
31+
32+
<actions/>
33+
34+
</idea-plugin>

resources/intentionDescriptions/GenerateFactoryInterfaceIntention/after.GenerateFactoryInterfaceIntention.template

Whitespace-only changes.

resources/intentionDescriptions/GenerateFactoryInterfaceIntention/before.GenerateFactoryInterfaceIntention.template

Whitespace-only changes.

0 commit comments

Comments
 (0)