PHP IDE with Intelligent Editor for Productive Coding

Posted: March 11, 2013 in Php, Random Posts
Tags: , , , , , , ,

Intelligent PHP Editor

PhpStorm provides rich and intelligent code editor for PHP with syntax highlighting, extended code formatting configuration, on-the-fly error checking, and smart code completion.

PHP 5.4 Language Features Support

PHP 5.4 is now fully supported, including traits and all the new syntax improvements: class member access on instantiation, short array syntax, array dereferencing on function call, binary literals, expressions in static calls, etc.:

PHP code completion

Automatic code completion (invoked on typing) finalizes classes, methods, variable names, and PHP keywords, plus commonly used names for fields and variables depending on their type.

Code completion

 

Code completion supports array indexes in PHP code.

Code completion

PHPDoc support

PhpStorm editor respects PHPDoc in your code and provides appropriate code completion suggestions based on @property, @method and @var annotations.

When you edit PHPDoc for your code, variable names and types are auto-completed from the corresponding code blocks.

PHP code refactorings also consider PHPDocs to keep them up to date.

PHPDoc

Smart Duplicated Code Detector

Added for all major supported languages including even CSS and HTML. Go to Code|Locate Duplicates to start your quest against copy/paste coding. You’ll be presented with a list of candidates for refactoring — and with the help of Refactor | Extract Method it’s easy to keep your code DRY.

PHP Code Sniffer

PhpStorm 4.0 allows you to check your code on the fly with PHP Code Sniffer (phpcs), just by opening a PHP file. The check is triggered every time you change something in the file, so it’s extremely easy to fix problems reported by PHP Code Sniffer.

 

Read more in our blog »

PHP refactoring

The Rename refactoring works for files, functions, constants, classes, properties, methods, parameters, and local and global variables.

Also following refactorings are available:

  • Introduce Variable
  • Introduce Constant
  • Introduce Field
  • Inline variable

Make global project changes easily and safely. Local changes are made instantly in-place.

Smarty templates editing

With the PhpStorm IDE, you can use the Smarty template engine and take advantage of these productivity features when working with .tpl files:

  • configurable syntax highlighting for keywords, strings, variables and braces
  • syntax errors highlighting
  • Smarty functions and attributes completion
  • automatic insertion of paired braces, quotes and closing tags
  • commenting of the selected block with a single hotkey
  • custom Smarty delimiters support
Smarty templates editing

 

More on Smarty support in PhpStorm.

Efficient project analysis and navigation

Its thorough source code analysis allows PhpStorm to provide sophisticated code completion even for unannotated code, for example:

  • the function return type is deducted from its body and return statements
  • class property types (and declarations) are extracted from the constructor code
Class fields from constructor
Function type

 

File structure view and class, method and call hierarchy views allow for faster code review and navigation.

More on Hierarchy View in our blog: Hierarchies view support for PHP & Hierarchy View actions

to the top

Smart Environment

PHP UML

PhpStorm helps developers to understand and change their code by providing editable UML class diagrams for PHP code. You can quickly examine your application structure, create and edit classes and their relationships. Look for “Diagrams…” in context menus. Many refactorings can be applied directly from the diagram, via the shortcut menu.

 

Note that a diagram built from a source control change list or history provides a semantic view of changes – added classes, changed hierarchy, and changed properties.

Drupal & Symfony2 Coding Style Support

PhpStorm contains a bundled predefined coding styles for the popular Drupal content management platform and Symfony2 framework. Currently just reformatting your code in PhpStorm removes 99% of errors reported by Drupal coder-review and helps your code meet Drupal coding standards.

Version control systems integration

PhpStorm supports most popular Version Control Systems:

  • Subversion
  • Mercurial
  • Git
  • Perforce
  • CVS
  • TFS

All the tedious tasks (adding, removing, deleting files) are performed automatically. A built-in visual merge tool resolves all conflicts in a quick and intuitive manner. The changes made locally are highlighted as you type in the editor gutter, providing intuitive navigation and a 2-click rollback for individual changes.

IDE changes

 

For Git VCS IDE shows revisions graph.

Git VCS IDE

 

The following features are available no matter which VCS you use:

  • Integrated changelists — group your changes into multiple change lists for better organization
  • Shelved changes — set aside some changes to restore them later
  • Repository changes view — see what has been committed by other team members
  • UML view of changessee UML section
  • Incoming changes view — see the code changes not yet integrated into your local copy
  • Outdated changes notification — get warned that a file you are working with has been changed after your last sync

Local history

PhpStorm tracks any changes made to your source files, protecting you from any accidental losses or modifications, even if made by other applications. At any time, you can inspect the history of either a particular file or directory and rollback to any of its previous versions. You can also set version labels.

Phing Support

PhpStorm automatically completes and checks standard tags, properties, target names, path attribute values in build files:

to the top

PHPUnit, Debugger & Profiler

PHPUnit

Develop PHPUnit tests in PhpStorm and run them instantly from a directory, file or class using the context menu options.

Dedicated Run/Debug configurations allow you to run the appropriate set of tests at a later time.

Tests are executed in a dedicated Test Runner UI, displaying results overview and detailed stats for the whole suite and every particular test.

 

If a test fails, you can instantly jump from the stacktrace to the line of code where the error occurred.

More on using PhpUnit with PhpStorm.

Visual Debugger

PhpStorm provides numerous options for debugging your PHP code, so you can:

  • Inspect context-relevant local variables and user-defined watches, including arrays and complex objects, and edit values on the fly.
  • Setup remote debugging for your server.
  • Evaluate an expression in runtime.
  • Debug a page in multiple sessions simultaneously.
  • Keep a debugging session alive while moving between pages.

You can use our browser bookmarklets, Zend Toolbar or XDebug toolbar to initiate debugging directly from any page in a modern browser such as Firefox, IE, Google Chrome or Safari.

PHP Debugger in PhpStorm
PHP debugging: Set value and watch

Read more about zero-configuration debugging with PhpStorm.

And when (in some cases) you still need to configure debugging manually read this article: How to configure debugging in PhpStorm

Watch our video on how to configure remote debugging:

Profiler integration

You can profile your scripts right from PHPStorm with either xDebug and Zend Debugger. You can see an aggregate report and jump from the execution statistics directly to the function in your PHP code.

to the top

Lightweight IDE

Use the same environment on Windows, Mac OS and Linux

Windows. Batch code inspection for CSS
Mac OS X. smart and customizable editor
Linux. Project-wide usages search and spellchecker

Open code from anywhere and start working in no time

Open an existing folder, check out the code from a VCS, or even specify your FTP to download and auto-sync your files with. You’re up and running in mere moments.

Edit project files locally and deploy back to remote server using automatic synchronization, either on file save or on demand.

Web resource folders are quickly configured via Settings|Directories — note the “Resource Root” marker button. Just mark your JS/CSS/other folders to get proper completion and code analysis.

to the top

JavaScript & HTML/XHTML/CSS

Note: PhpStorm includes all the features of WebStorm related to javascript and html editing.

 

DOM-Based, browser-specific completion

JavaScript, HTML & CSS code completion for tags, keywords, labels, variables, parameters and functions is DOM-based and supports popular browsers’ specifics (IE, Firefox, etc.) Completion is available for both standard and user-defined functions in *.js files, HTML event handlers and everywhere else where appropriate.

Javascript completion
Go to symbol
  • Go to declaration — navigates to where the function, variable or label in question is declared with a simple hotkey or Ctrl+Click⌘Click.
  • Go to symbol — navigates to any symbol in project code using search patterns, including asterisk (*) and/or CamelHump abbreviations.
  • Find/Highlight Usages — locates other places in your entire project where a JavaScript symbol, label or file is used, with quick preview and instant navigation to the actual usages.

ECMAScript Harmony Support

For those who prefer to stay one step ahead, WebStorm presents experimental support of a new ongoing ECMAScript version code-named Harmony. To try out the new features, set ECMAScript Harmony to be the JavaScript language version in the IDE settings.

Note: each JavaScript engine implementation adds some nice features that others don’t have. When you use a language feature that isn’t supported by the currently selected JavaScript version, WebStorm will notify you and suggest a Quick-Fix:

 

 

Read more in our blog »

JavaScript refactoring

Refactoring capabilities provided for JavaScript allow you to easily modify the code structure as well as undo the modifications. Some refactorings available for JavaScript code and *.js files are:

  • Rename
  • Extract Variable/Function
  • Inline Variable/Function
  • Move/Copy
  • Safe Delete
  • Extract embedded script into file

JavaScript debugger

With JetBrains PhpStorm you can debug JavaScript code utilizing the complete range of features:

  • Breakpoints in HTML and JavaScript
  • Customizable breakpoint properties: suspend mode, conditions, pass count and more
  • Frames, variables and watches views in JavaScript debugger UI
  • Runtime evaluation of JavaScript expressions
JavaScript breakpoint

 

More on JavaScript Editor features

to the top

Validation and quick-fixes

PhpStorm detects and suggests auto-fixes for such problems as:

  • missing required attributes
  • invalid attributes or illegal values
  • wrong references to files in links
  • duplicate attributes
  • invalid CSS selector format
  • invalid CSS properties
  • unused CSS class definitions
  • invalid local anchors and more…

More front-end features…

You can find more front-end features on JavaScript Editor and HTML/XHTML/CSS Editor pages

to the top

Enhanced by Zemanta
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s