Run PHP CodeSniffer code beautifier and fixer from PhpStorm

In this tutorial i’m going to show you how you can run the PHP Code Beautifier and Fixer, or phpcf for short, from inside PhpStorm.

I am going to assume you already have Composer, PHP CodeSniffer installed and downloaded the WordPress Coding Standards rules/sniffs.

Having that all set, we need to tell PhpStorm where the CodeSniffer is installed. Go to Settings -> Tools -> External Tools. There we will create the configuration needed.

Click on the + icon. Fill the form with the following values:



  • Name: the name you want to call it. This will be used to invoke the script through PhpStorm.
  • Description: A short description of what the script does.
  • Program: the path to phpcbf.
  • Parameters: a list of parameters, will explain those later.
  • Working directory: the variable $ProjectFileDir$ is used here.

Personally i created 3 sets of configurations. One to fix a single file, other to fix all php files in the current directory non-recursively, and another one to fix all php files in the current folder recursively. So let me show you the other 2 configs:

current folder

current folder

all folders

all folders

You can find a list of all parameters simply running phpcbf -h or you can go to PHP CodeSniffer documentation page. Here i’ll list the ones used in the examples above:

  • –standard: The name or path of the coding standard to use.
  • –extensions: A comma separated list of file extensions to fix (only valid if fixing a directory).
  • -l: Local directory only, no recursion

And the variables:

  • $FileDir$/$FileName$: parses the current file only.
  • $FileDir$: parses the whole directory.

Here is the phpcbf in action:



After everything is setup, you can even assign keyboard shortcuts to run those scripts. Go to Settings -> Keymap:



Search for the ‘Name’ you inserted when created the link to the external tool phpcbf, click on the green pencil icon, and input the keyboard shortcut you want:

keyboard shortcut

keyboard shortcut

I hope this tutorial help you be more productive and make sure the code meet the WordPress Standards. Here’s some useful links:


Posted in PhpStorm, WordPress

Do you work with WordPress? What’s that?

That’s a question i hear a lot these days. And i’ll borrow Mario Peshev nicely put explanation:

What is WordPress?

WordPress started as a blogging platform more than 10 years ago, and the active community grew it to be a platform that powers about 24% of the World Web. Nowadays WordPress is being used as a CMS, and even as an application platform. In a few months the WordPress Restful API will probably get in the WordPress Core, which would make it incredibly easy to run all sorts of applications – even mobile apps and ones not written in PHP – interacting with WordPress as a separate platform.

There are plenty of use cases for WordPress, which is what makes it one of the most powerful web platforms that has ever been built.

What Can You Do With WordPress?

There are lots of WordPress driven websites serving different needs. Some examples:

  • blog
  • magazine
  • small business website
  • eCommerce store
  • membership site
  • Q&A site
  • forum
  • LMS
  • CRM
  • Real estate portal
  • Marketplace

In addition to building a website itself, it’s a great way to start any venture.

That being said, if you want to learn more about WordPress, go to their official site, follow Mario Peshev blog or twitter, search tutorials, watch videos, buy books, go to a wordcamp…the list goes one.

But if you don’t have the time to learn or what you want is make your own business grow, and need a fabulous work done in Web Publising with WordPress, you can contact 10up, one of the biggest WordPress centric agencies in the world.

Posted in WordPress

Microsoft Launches Visual Studio Code, A Free Cross-Platform Code Editor For OS X, Linux And Windows

Featured Image -- 216

Originally posted on TechCrunch:

At its Build developer conference, Microsoft today announced the launch of Visual Studio Code, a lightweight cross-platform code editor for writing modern web and cloud applications that will run on OS X, Linux and Windows. The application is still officially in preview, but you can now download it here.

This marks the first time that Microsoft offers developers a true cross-platform code editor. The full Visual Studio is still Windows-only, but today’s announcement shows the company’s commitment to supporting other platforms.


“A lot of people use Windows as their development environment, but we are also seeing a lot of people on Linux and Mac,” S. ‘Soma’ Somasegar, Microsoft’s corporate VP of its developer division, told me earlier this week. “Instead of making them go to Windows, we want to meet them where they are.” Developers on these platforms are also often perfectly happy with using a…

View original 301 more words

Posted in JavaScript

A bit of Linux for a change

Well today post isn’t about programming. It’s about a problem i faced, and as i searched online, some other folks too. I’m here to talk about Linux and webcams!
Wait, what? Yeah that’s right, it may look like a silly topic, but that i hope will help some brave Linux users out there.

I use Linux, specially Ubuntu for quite sometime now. I think the first started using Ubuntu 7.04, up until Ubuntu 10.04, the last one to use Gnome 2. Then i switched back again with 12.04.
But i don’t wanna start a flame war, so let’s dive directly into the topic.

I never had problems with webcams on Linux. They just work out-of-the-box.
The thing is, there are no native utilities in the operational system to change webcam settings.

That’s where this handy program fits in: guvcview
Speaking of Ubuntu 14.04 and Linux Mint 17.1, the one i currently use, it comes pre-installed with the system. If not, it’s a matter of a simple command to install it on Debian based distros:

sudo apt-get install guvcview

But not everyone knows about it. It’s a simple tool to calibrate the webcam, test it, take screenshots and capture video. Here’s a few screenshots of it:

Image Controls

Image Controls

Video Controls

Video Controls

Audio Controls

Audio Controls

To launch the program, you can run the command:


Or you can use the programs menu to search for it like this:

Cinnamon menu

Cinnamon menu

So i hope this will help other people. Oh and i never said what was the problem i was facing.
When i turned the webcam on, it was bright and ok, but soon after it would fade the brightness, to a point i could barely see my face. It should be on automatic brightness setting by the driver default.

And with this nice little utility, i could setup just the way i needed.
Also it allows you to save several settings profiles, and it sticks between reboots.

See you all next Friday!

Just wanted to mention that this week i bought a Logitech C270 Webcam and it works flawless on Linux Mint 17.1. So it should also work great with Ubuntu 14.04.

Tagged with: , , , , ,
Posted in Linux

Making a commitment

Well this year i’m committing myself to make a blog post every week. Why’s that?

Well for me there are several reasons:

  • I can improve my written English skills.
  • I can organize my thoughts better when i write them down.
  • When you teach something, you are also learning.
  • I love programming! And also love JavaScript, which is the language i’m focusing my efforts now.
    So i decided to take my blog and focus it too on JavaScript.

    Oh man, another JavaScript blog? Yeah another one.
    So what’s so different about yours that we haven’t seen already? I don’t know, you tell me.

    Maybe you’ll think i don’t add anything new, you find it boring, don’t like the way i write or my opinions.
    But even if it may end up being all of those above, i do believe i can improve and achieve my goal: to help others.

    And what if for some reason, a particular week i don’t have anything to talk about JavaScript?
    Well i’ll just write about something else, probably something related to Code, Programming…

    And i’m also here asking for your help! Please leave comments below, correct me when needed, tell me what you think i should do to improve!

    Thank you.

    Tagged with: , , ,
    Posted in JavaScript

    How blogging can help you in your career

    Last week i wrote about John Sonmez last book. And here i am  again talking about his work.

    Am i getting paid to do this? No.

    So why are you doing it? Because he helps others! He helped me!
    And just like him, i want to help you. I won’t ask you to buy his book, although i do recommend it.

    What i’m here today for is to talk about his free email course on How to Create a Blog That Boosts Your Career.

    He’ll send you a couple of emails every week with a set of goals in each one, which means you’ll have some “homework” to do. But don’t worry he won’t spam your inbox.

    So he goes through everything, from actually creating your blog, choosing a theme, choosing the name of it, what you should write about… The list goes on.
    Then he explains that things won’t become a reality in a couple of weeks. It takes time to build your name/brand/reputation.

    And how exactly it happens? By helping others! You can help people on online forums, discussion boards, StackOverflow, Github, by writing good content, you choose!

    So what are you waiting for? Go check his course and leave a comment below if you want to hear more about it.

    Tagged with: , , , , , , ,
    Posted in Career

    Soft Skills: The software developer’s life manual by John Sonmez

    Soft Skills: The software developer's life manual

    Soft Skills: The software developer’s life manual by John Sonmez isn’t only a book about software development, but also it illustrates many aspects of modern life.

    It goes into several topics like work, career, interview tips, employment, freelancing, finances, personal attitude, soft skills, and how to correctly market yourself.
    Many people think this is a bad thing, but believe me when i say John does a great job explaining the right way to do it.

    This last thing may seem strange to a lot of developers out there. But believe me, it’s really important to set aside from the crowd, and make yourself noticeable among all others.

    You don’t go out spamming people with emails or on social networks. You do it by creating a good reputation, either by helping others or creating good content.

    The book is divided into several small chapters, so if you want to read only the pieces that you judge are more important to you right now, you can do it. Or you will want to read the book cover to cover. Either way, you won’t be disappointed.

    You can get a copy of the book from Amazon or Manning website.

    Soft Skills: The software developer's life manual

    Soft Skills: The software developer’s life manual

    Tagged with: , , , , , ,
    Posted in Ebook

    Thiago Ponte

    Web Engineer

    Follow me on Twitter
    Blog Stats
    • 1,965 hits

    Enter your email address to follow my blog and receive notifications of new posts by email.

    Join 984 other followers VIP

    Enterprise WordPress Hosting, Support, and Services

    Making the Complex Simple

    Software Development from John Sonmez's Perspective

    Fé e Ação

    Pois a fé sem obras está morta.

    When I Have Time by Sara Rosso

    Tech Tips, Biz Info and How-Tos to Bridge the Gap between Meek and Geek

    Job Tips For Geeks

    career advice for programmery people...

    Sarfraz Ahmed's Blog

    PHP, MySQL, jQuery, JavaScript, Ajax, CSS, HTML and more

    Moving Target

    Technology, Productivity & Lessons learned starting a startup.


    MJ's Technical Blog

    Brian By Experience

    A bit of everything. Robots, Software Development, Libertarianism, Christianity, Anti-war


    Get every new post delivered to your Inbox.

    Join 984 other followers

    %d bloggers like this: