sublimetext / phpbeautifier Goto Github PK
View Code? Open in Web Editor NEWPear Php_beautifier plugin for Sublime Text 2
Pear Php_beautifier plugin for Sublime Text 2
Still uses spaces if I set to use indent indent = "-t1"
Wishlist:
There should be a way to add support for WordPress coding standards: https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#brace-style
---------------------------
Sublime Text 2
---------------------------
Error trying to parse file: Trailing comma before closing bracket in C:\Users\Amit.Shah\AppData\Roaming\Sublime Text 2\Packages\PHP Codebeautifier\Main.sublime-menu:8:13
---------------------------
OK
---------------------------
Resolved by removing , from the end on line 7
"command": "php_cbf"
The same errors are present in couple of other setting files.
PHP Strict Standards: Non-static method Console_Getopt::readPHPArgv() should not be called statically in /usr/bin/php_beautifier on line 70
PHP Strict Standards: Non-static method Console_Getopt::getopt() should not be called statically in /usr/bin/php_beautifier on line 84
PHP Strict Standards: Non-static method Console_Getopt::doGetopt() should not be called statically in /usr/share/php/Console/Getopt.php on line 92
PHP Strict Standards: Non-static method PEAR::isError() should not be called statically in /usr/share/php/Console/Getopt.php on line 109
PHP Strict Standards: Non-static method Console_Getopt::_parseShortOption() should not be called statically in /usr/share/php/Console/Getopt.php on line 166
PHP Strict Standards: Non-static method PEAR::isError() should not be called statically in /usr/share/php/Console/Getopt.php on line 167
PHP Strict Standards: Non-static method Console_Getopt::_parseShortOption() should not be called statically in /usr/share/php/Console/Getopt.php on line 166
PHP Strict Standards: Non-static method Console_Getopt::_isShortOpt() should not be called statically in /usr/share/php/Console/Getopt.php on line 220
PHP Strict Standards: Non-static method Console_Getopt::_isLongOpt() should not be called statically in /usr/share/php/Console/Getopt.php on line 221
PHP Strict Standards: Non-static method PEAR::isError() should not be called statically in /usr/share/php/Console/Getopt.php on line 167
PHP Strict Standards: Non-static method Console_Getopt::_parseShortOption() should not be called statically in /usr/share/php/Console/Getopt.php on line 166
PHP Strict Standards: Non-static method Console_Getopt::_isShortOpt() should not be called statically in /usr/share/php/Console/Getopt.php on line 220
PHP Strict Standards: Non-static method Console_Getopt::_isLongOpt() should not be called statically in /usr/share/php/Console/Getopt.php on line 221
PHP Strict Standards: Non-static method PEAR::isError() should not be called statically in /usr/share/php/Console/Getopt.php on line 167
PHP Strict Standards: Non-static method Console_Getopt::_parseShortOption() should not be called statically in /usr/share/php/Console/Getopt.php on line 166
PHP Strict Standards: Non-static method Console_Getopt::_isShortOpt() should not be called statically in /usr/share/php/Console/Getopt.php on line 220
PHP Strict Standards: Non-static method Console_Getopt::_isLongOpt() should not be called statically in /usr/share/php/Console/Getopt.php on line 221
PHP Strict Standards: Non-static method PEAR::isError() should not be called statically in /usr/share/php/Console/Getopt.php on line 167
PHP Strict Standards: Non-static method PEAR::isError() should not be called statically in /usr/bin/php_beautifier on line 85
PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/PEAR/Config.php on line 650
PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/PEAR/Config.php on line 697
PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/PEAR/Config.php on line 757
PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/PEAR/Config.php on line 786
PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/PEAR/Config.php on line 914
PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/PEAR/Config.php on line 1577
PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/PEAR/Config.php on line 1607
PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/PEAR/Config.php on line 2038
PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/PEAR/Config.php on line 2091
PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/PEAR/Registry.php on line 322
PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/PEAR/Registry.php on line 1450
PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/PEAR/Registry.php on line 1458
PHP Strict Standards: Non-static method System::tmpdir() should not be called statically, assuming $this from incompatible context in /usr/share/php/PEAR/Config.php on line 158
PHP Strict Standards: Non-static method System::tmpdir() should not be called statically, assuming $this from incompatible context in /usr/share/php/PEAR/Config.php on line 167
PHP Strict Standards: Non-static method System::tmpdir() should not be called statically, assuming $this from incompatible context in /usr/share/php/PEAR/Config.php on line 176
PHP Strict Standards: Non-static method System::which() should not be called statically, assuming $this from incompatible context in /usr/share/php/PEAR/Config.php on line 228
Hi,
I just tried this plugin and couldn't get it to go..
Sublime Version 2.0.1,
Build 2217
File "./sublime_plugin.py", line 362, in run_
File "./php_beautifier.py", line 8, in run
TypeError: 'NoneType' object is unsubscriptable
I'm getting the following error: urllib2.URLError:
Traceback (most recent call last):
File "./sublime_plugin.py", line 362, in run_
return self.run(edit)
File "./php_beautifier.py", line 20, in run
AttributeError: 'PhpBeautifierCommand' object has no attribute 'status'
Running in Ubuntu 12.10.4, following installation as suggested
There seems to be an issue with the filters line. If I try to add or remove stuff, it doesnt work on the plugin anymore?
IE: remove the ArrayNested() from the php_beautifier.py file. Run the format on a file, still formats the file the same way, as if ArrayNested() was still a filter.
Any help?
OSX 10.7
PHP 5.3.6
php_beautifier-0.1.15
Sublime Text 2 Build 2165
PhpBeautifier v2012.01.20.03.15.20
PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/lib/php/pear/PEAR/Config.php on line 650
PHP Stack trace:
PHP 1. {main}() /usr/bin/php_beautifier:0
PHP 2. PHP_Beautifier_Batch->addFilter() /usr/bin/php_beautifier:207
PHP 3. PHP_Beautifier_Decorator->__call() /usr/bin/php_beautifier:207
PHP 4. call_user_func_array() /usr/lib/php/pear/PHP/Beautifier/Decorator.php:47
PHP 5. PHP_Beautifier->addFilter() /usr/lib/php/pear/PHP/Beautifier/Decorator.php:47
PHP 6. PHP_Beautifier->addFilterFile() /usr/lib/php/pear/PHP/Beautifier.php:448
PHP 7. include_once() /usr/lib/php/pear/PHP/Beautifier.php:511
...
Could you be so kind and explain installation step by step for Windows user?
This plugin connects to an external webserver and probably saves your code. BE WARNED.
The file is in UTF-8, Unix.
When execute ctrl+alt+f the console shows:
Traceback (most recent call last):
File "./sublime_plugin.py", line 351, in run_
File "./php_beautifier.py", line 16, in run
File ".\subprocess.py", line 701, in communicate
File ".\subprocess.py", line 1210, in _communicate
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 126: ordinal not in range(128)
If file's content has no accents in all works great.
An idea?
I followed the installation instructions and made sure php_beautifier is in my path (it's at /usr/local/bin). I'm running Mac OSX 10.7. The result when I run the format command is
sh: php_beautifier: command not found
I tried editing the python file and specifying the full path to the php_beautifier executable, and that does get rid of the error message, but the source code just goes blank instead.
Just installed it in Ubuntu 12.04. Doesn't do anything at all!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.