Skip to content

Latest commit

 

History

History
293 lines (228 loc) · 4.43 KB

05-PhpStorm.md

File metadata and controls

293 lines (228 loc) · 4.43 KB

PhpStorm

Code Style

  • Download file CodeStyle.xml
  • Open PhpStorm
  • Select File > Settings > Editor > Code Style
  • Click Manage...
  • Click Import...
  • Select "Intellij IDEA code style XML"
  • Select the file you've just download

Inspections

  • Download file inspections.xml
  • Open PhpStorm
  • Select File > Settings > Editor > Inspections
  • Click Manage...
  • Click Import...
  • Select the file you've just download

Plugins

Sadly, we can't share them directly.
I put here what I use but you may not require all of them.
Plugins with a * are not bundled.
Plugins with unchecked checkbox are bundle and desactivated.

  • * .ignore
  • Apache config (.htaccess) support
  • ASP
  • * BashSupport
  • Behat Support
  • Blade Support
  • * Codeivate
  • CoffeeScript
  • Command Line Tool Support
  • Copyright
  • CSS Support
  • CVS Integration
  • Database Tools and SQL
  • Drupal Support
  • File Watchers
  • Gherkin
  • Git Integration
  • GitHub
  • GNU GetText files support (*.po)
  • Google App Engine Support for PHP
  • HAML
  • hg4idea
  • Ini4Idea
  • HMTL Tools
  • IntelliLang
  • JavaScript Debugger
  • JavaScript Intention Power Pack
  • JavaScript Support
  • Joomla! Support
  • LESS Support
  • * Lines Sorter
  • * Markdown Navigator
  • * nginx Support
  • Perfoce Integration
  • Performance Testing
  • Phing Support
  • PHP
  • * PHP Annotations
  • *PHP composer.json support
  • * PHP Inspections (EA Extended)
  • PHP Remote Interpreter
  • * PhpMetrics
  • * PHPUnit code coverage
  • QuirksMode
  • Refactor-X
  • Remote Hosts Access
  • REST Client
  • ReStructuredText Support
  • SASS support
  • Settings Repository
  • SSH Remote Run
  • Subversion Integration
  • * Symfony Plugin (don't forget to enable it in each projects !!)
  • Task Management
  • Terminal
  • TextMate bundles support
  • Time Tracking
  • Twig Support
  • UML Support
  • Vagrant
  • W3C Validators
  • Wordpress Support
  • XPathView + XSLT Support
  • XSLT-Debugger
  • YAML
  • * YAML/Ansible support

File and Code Templates

Sadly, we can't share it with a file.

Files > PHP Class

<?php
#parse("PHP File Header.php")
#if (${NAMESPACE})

namespace ${NAMESPACE};
#end

final class ${NAME}
{

}

Files > PHP Interface

<?php
#parse("PHP File Header.php")
#if (${NAMESPACE})

namespace ${NAMESPACE};
#end

interface ${NAME}
{

}

Files > PHP Trait

<?php
#parse("PHP File Header.php")
#if (${NAMESPACE})

namespace ${NAMESPACE};
#end

trait ${NAME}
{

}

Files > PHPUnit Test

<?php
#parse("PHP File Header.php")
#if (${NAMESPACE})

namespace ${NAMESPACE};

use PHPUnit_Framework_TestCase;
#end

final class ${NAME} extends PHPUnit_Framework_TestCase
{

}

Includes > PHP Class Doc Comment

/**
 * ${NAME} ${CARET}
 */

Includes > PHP Field Doc Comment

/** ${TYPE_TAG} ${TYPE_HINT} */

Includes > PHP File Header

Empty if non PHP7, otherwise:

declare(strict_types=1);

Includes > PHP Function Doc Comment

/**
${PARAM_DOC}
${THROWS_DOC}
#if (${TYPE_HINT} != "void") * @return ${TYPE_HINT}
#end
*/

Includes > PHP Interface Doc Comment

/**
 * ${NAME} ${CARET}
 */

Code > PHP Constructor

/**
${PARAM_DOC}
*/
public function __construct(${PARAM_LIST})
{
    ${BODY}
}

Code > PHP Fluent Setter Method

/**
 * @param ${TYPE_HINT} $${PARAM_NAME}
 *
 * @return ${CLASS_NAME}
 */
public function set${NAME}($${PARAM_NAME})
{
    $this->${FIELD_NAME} = $${PARAM_NAME};

    return $this;
}

Code > PHP Getter Method

/**
 * @return ${TYPE_HINT}
 */
public ${STATIC} function ${GET_OR_IS}${NAME}()
{
#if (${STATIC} == "static")
    return static::$${FIELD_NAME};
#else
    return $this->${FIELD_NAME};
#end
}

Code > PHP Implemented Method Body

Leave empty.

Code > PHP Overridden Method Body

${RETURN} parent::${NAME}(${PARAM_LIST});

Code > PHP Setter Method

/**
 * @param ${TYPE_HINT} $${PARAM_NAME}
 */
public ${STATIC} function set${NAME}($${PARAM_NAME})
{
#if (${STATIC} == "static")
    static::$${FIELD_NAME} = $${PARAM_NAME};
#else
    $this->${FIELD_NAME} = $${PARAM_NAME};
#end
}