Coder Social home page Coder Social logo

netbeans-psr-formatting's Issues

Not working in Ubuntu 14.04

I've followed the steps how you have suggested in Netbeans 8.1 and 8.2 in Ubuntu 14.04 but formatting styles are not applying.

Closure Braces Incorrectly Placed on New Line

This issue persists for both this config, and native Netbeans. Native Netbeans controls do not allow distinction between class method brackets and lone function closures. (So I'm not even sure this is fixable with a config file alone)

Current behavior:

function current_behavior()
{
    // code
}

Desired behavior:

function desired_behavior() {
    // code
}

Documentation on settings

hello!

nice to see that you've opened a git repo for this.
I am trying to figure out which settings you've adopted within you zip.

Perhabs you could elaborate in your readme for this?
This would also enable others to do suggestions for improvements / updates.

thanks!

Add a Netbeans zip in v1.0.1

Hi @bobsta63.

Could you provide a Netbeans zip ready to import in the release v1.0.1 as you did in v1.0.0?

If not, please add some information in the Installation section about the differences in import.

Incorrect formatting

Please, fix this.

Example:

    /**
     * Constructor
     * 
     * @param \Magento\Framework\App\Helper\Context $context
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Customer\Model\Session $customerSession
     */
    public function __construct(
    \Magento\Framework\App\Helper\Context $context, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Customer\Model\Session $customerSession
    )
    {
        $this->_scopeConfig = $scopeConfig;
        $this->customerSession = $customerSession;
        $this->isEnabled = $this->_scopeConfig->getValue(self::XML_CONFIG_ENABLE);
        parent::__construct($context);
    }

โ†“

    /**
     * Constructor
     * 
     * @param \Magento\Framework\App\Helper\Context $context
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Customer\Model\Session $customerSession
     */
    public function __construct(
        \Magento\Framework\App\Helper\Context $context,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Customer\Model\Session $customerSession
    ) {
        $this->_scopeConfig = $scopeConfig;
        $this->customerSession = $customerSession;
        $this->isEnabled = $this->_scopeConfig->getValue(self::XML_CONFIG_ENABLE);
        parent::__construct($context);
    }

PSR:

<?php
namespace Vendor\Package;

class ClassName
{
    public function aVeryLongMethodName(
        ClassTypeHint $arg1,
        &$arg2,
        array $arg3 = []
    ) {
        // method body
    }
}

When the argument list is split across multiple lines, the closing parenthesis and opening brace MUST be placed together on their own line with one space between them.

http://www.php-fig.org/psr/psr-2/#method-arguments

Continuation indenting

I formatted a php file in PHP sotrm, and it looked like this:

image

I then opened it in netbeans with thsi plugin and formatted it and it looked like this:

image

This then has the problem of making the end of my file look like this:

image

Is there any way I can prevent this? I tried reducing the continuation indentation to 0, but it doesnt seem the right thing to do.

Thanks

Small issue

"The latest release" in the readme doesn't point to the latest release. Should be 1.0.1

Namespace declaration on next line after opening tag.

Although technically the current implementation that is configured in release 1.0.0 of this Netbeans extension does not violate the PSR standards (as discussed here: PHP-CS-Fixer/PHP-CS-Fixer#641) it has now been noted by a couple of people that it would be better to add it on a new line following the opening PHP tag <?php

So instead of:

<?php namespace MyNamespace;

It should be changed to:

<?php
namespace MyNamespace;

At present following my investigation there is a bug since Netbeans 8.0 which prevents this from being added, the bug is described here: https://netbeans.org/bugzilla/show_bug.cgi?id=243744

I will keep track on this bug and will implement this enhancement as soon as technically possible (when NetBeans implemented this functionality)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.