Giter VIP home page Giter VIP logo

phpf's Introduction

phpF

Project Abandoned

This project has been abandoned due to lack of interest. You may use other forks of this.

Build Status

phpF formats PHP code by making it readable and helps your code to follow coding guidelines.

This is a fork of the project phpfmt.

Requirements

  • PHP 5.6 or newer

Usage

php phpf.phar <arguments>

Arguments

Argument Description
--cache[=FILENAME] cache file. Default: .php.tools.cache
--cakephp Apply CakePHP coding style
--config=FILENAME configuration file. Default: .phpf.ini
--constructor=type analyse classes for attributes and generate constructor - camel, snake, golang
--dry-run Runs the formatter without atually changing files; returns exit code 1 if changes would have been applied
--enable_auto_align disable auto align of ST_EQUAL and T_DOUBLE_ARROW
--exclude=pass1,passN,... disable specific passes
--help-pass show specific information for one pass
--ignore=PATTERN-1,PATTERN-N,... ignore file names whose names contain any PATTERN-N
--indent_with_space=SIZE use spaces instead of tabs for indentation. Default 4
--lint-before lint files before pretty printing (PHP must be declared in %PATH%/$PATH)
--list list possible transformations
--list-simple list possible transformations - greppable
--no-backup no backup file (original.php~)
--passes=pass1,passN,... call specific compiler pass
--profile=NAME use one of profiles present in configuration file
--psr activate PSR1 and PSR2 styles
--psr1 activate PSR1 style
--psr1-naming activate PSR1 style - Section 3 and 4.3 - Class and method names case.
--psr2 activate PSR2 style
--setters_and_getters=type analyse classes for attributes and generate setters and getters - camel, snake, golang
--smart_linebreak_after_curly convert multistatement blocks into multiline blocks
--visibility_order fixes visibiliy order for method in classes - PSR-2 4.2
--yoda yoda-style comparisons
-h, --help this help message
-o=- output the formatted code to standard output
-o=file output the formatted code to "file"
-v verbose

Currently Supported Transformations:

  • AddMissingParentheses Add extra parentheses in new instantiations.
  • AliasToMaster Replace function aliases to their masters - only basic syntax alias.
  • AlignConstVisibilityEquals Vertically align "=" of visibility and const blocks.
  • AlignDoubleArrow Vertically align T_DOUBLE_ARROW (=>).
  • AlignDoubleSlashComments Vertically align "//" comments.
  • AlignEquals Vertically align "=".
  • AlignGroupDoubleArrow Vertically align T_DOUBLE_ARROW (=>) by line groups.
  • AlignPHPCode Align PHP code within HTML block.
  • AlignPHPCode2 Align PHP code within opening and closing php block.
  • AlignTypehint Vertically align function type hints.
  • AllmanStyleBraces Transform all curly braces into Allman-style.
  • AutoPreincrement Automatically convert postincrement to preincrement.
  • AutoSemicolon Add semicolons in statements ends.
  • CakePHPStyle Applies CakePHP Coding Style
  • ClassToSelf "self" is preferred within class, trait or interface.
  • ClassToStatic "static" is preferred within class, trait or interface.
  • ConvertOpenTagWithEcho Convert from "<?=" to "<?php echo ".
  • DocBlockToComment Replace docblocks with regular comments when used in non structural elements.
  • DoubleToSingleQuote Convert from double to single quotes.
  • EchoToPrint Convert from T_ECHO to print.
  • EncapsulateNamespaces Encapsulate namespaces with curly braces
  • GeneratePHPDoc Automatically generates PHPDoc blocks
  • IndentTernaryConditions Applies indentation to ternary conditions.
  • JoinToImplode Replace implode() alias (join() -> implode()).
  • LeftWordWrap Word wrap at 80 columns - left justify.
  • LongArray Convert short to long arrays.
  • MergeElseIf Merge if with else.
  • SplitElseIf Merge if with else.
  • MergeNamespaceWithOpenTag Ensure there is no more than one linebreak before namespace
  • MildAutoPreincrement Automatically convert postincrement to preincrement. (Deprecated pass. Use AutoPreincrement instead).
  • NewLineBeforeReturn Add an empty line before T_RETURN.
  • OrganizeClass Organize class, interface and trait structure.
  • OrderAndRemoveUseClauses Order use block and remove unused imports.
  • OnlyOrderUseClauses Order use block - do not remove unused imports.
  • OrderMethod Organize class, interface and trait structure.
  • OrderMethodAndVisibility Organize class, interface and trait structure.
  • PHPDocTypesToFunctionTypehint Read variable types from PHPDoc blocks and add them in function signatures.
  • PrettyPrintDocBlocks Prettify Doc Blocks
  • PSR2EmptyFunction Merges in the same line of function header the body of empty functions.
  • PSR2MultilineFunctionParams Break function parameters into multiple lines.
  • ReindentAndAlignObjOps Align object operators.
  • ReindentSwitchBlocks Reindent one level deeper the content of switch blocks.
  • RemoveIncludeParentheses Remove parentheses from include declarations.
  • RemoveSemicolonAfterCurly Remove semicolon after closing curly brace.
  • RemoveUseLeadingSlash Remove leading slash in T_USE imports.
  • ReplaceBooleanAndOr Convert from "and"/"or" to "&&"/"||". Danger! This pass leads to behavior change.
  • ReplaceIsNull Replace is_null($a) with null === $a.
  • RestoreComments Revert any formatting of comments content.
  • ReturnNull Simplify empty returns.
  • ShortArray Convert old array into new array. (array() -> [])
  • SmartLnAfterCurlyOpen Add line break when implicit curly block is added.
  • SortUseNameSpace Organize use clauses by length and alphabetic order.
  • SpaceAroundControlStructures Add space around control structures.
  • SpaceAroundExclamationMark Add spaces around exclamation mark.
  • SpaceAroundParentheses Add spaces inside parentheses.
  • SpaceBetweenMethods Put space between methods.
  • StrictBehavior Activate strict option in array_search, base64_decode, in_array, array_keys, mb_detect_encoding. Danger! This pass leads to behavior change.
  • StrictComparison All comparisons are converted to strict. Danger! This pass leads to behavior change.
  • StripExtraCommaInArray Remove trailing commas within array blocks
  • StripNewlineAfterClassOpen Strip empty lines after class opening curly brace.
  • StripNewlineAfterCurlyOpen Strip empty lines after opening curly brace.
  • StripNewlineWithinClassBody Strip empty lines after class opening curly brace.
  • StripSpaces Remove all empty spaces
  • StripSpaceWithinControlStructures Strip empty lines within control structures.
  • TightConcat Ensure string concatenation does not have spaces, except when close to numbers.
  • TrimSpaceBeforeSemicolon Remove empty lines before semi-colon.
  • UpgradeToPreg Upgrade ereg_* calls to preg_*
  • WordWrap Word wrap at 80 columns.
  • WrongConstructorName Update old constructor names into new ones. http://php.net/manual/en/language.oop5.decon.php
  • YodaComparisons Execute Yoda Comparisons.

phpf's People

Contributors

nanch avatar subins2000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

phpf's Issues

Array space missing

I have some pictures by formatting the files:
before
after

Because I need to keep the space to made array readable.
Can do this by change my local setting?

By the way, can I only format selected code area?

Thanks!

HTML inside PHP

Could we have a feature which formats html code inside a php file?
The PHP formatting works fine, but it would be nice if the html in the same file also gets formatted.

Thanks

formatter is moving type hints in classes

Description:
formatter is moving type hints in classes

Failing code:

class Record implements JsonSerializable
{
    public $filename;
    public (float) $number;
    public $recorder;
}

Expected result:

class Record implements JsonSerializable
{
    public $filename;
    public (float) $number;
    public $recorder;
}

Actual result:

class Record implements JsonSerializable {
	public $filename;
	(float) public $number;
	public $recorder;

}

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

I'm using CodeFormatter in sublime text 3, when I try press control+option+F to format the php code, it shows up the following error:

CodeFormatter

Format error:
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 6692
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 6692
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7613
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7613
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7730
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7730
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7770
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7770
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7778
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7778
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7790
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7790
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7795
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7795
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 8530
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 8530
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 9923
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 9923
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 9926
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 9926
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 11153
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 11153
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12425
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12425
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12445
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12445
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12469
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12469
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12987
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12987
PHP Deprecated:  The each() function is deprecated. This message will be suppressed on further calls in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 5386
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in phar:///Users/bruce/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 5386

OS: macOS Mojave 10.14.1 (18B75)
PHP:

PHP 7.3.0 (cli) (built: Jan  3 2019 10:08:00) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.0, Copyright (c) 1999-2018, by Zend Technologies

Sublime: v3.1.1 build 3176

Double arrow problem

This line of code: $data = array('id'=>'', 'name'=>'', 'appointments'=>'');

causes this error when saved in Sublime Text 3 using CodeFormatter plugin:

CodeFormatter

Format error:
PHP Notice:  Undefined offset: 0 in phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php on line 6538
PHP Stack trace:
PHP   1. {main}() /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:0
PHP   2. include() /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:9
PHP   3. BaseCodeFormatter->formatCode() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:13586
PHP   4. AlignDoubleArrow->format() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:2790

Notice: Undefined offset: 0 in phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php on line 6538

Call Stack:
    0.0015     424912   1. {main}() /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:0
    0.0138    3782464   2. include('phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php') /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:9
    0.0144    3813280   3. BaseCodeFormatter->formatCode() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:13586
    0.0394    3825472   4. AlignDoubleArrow->format() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:2790

PHP Notice:  Undefined offset: 0 in phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php on line 6538
PHP Stack trace:
PHP   1. {main}() /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:0
PHP   2. include() /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:9
PHP   3. BaseCodeFormatter->formatCode() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:13586
PHP   4. AlignDoubleArrow->format() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:2790

Notice: Undefined offset: 0 in phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php on line 6538

Call Stack:
    0.0015     424912   1. {main}() /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:0
    0.0138    3782464   2. include('phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php') /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:9
    0.0144    3813280   3. BaseCodeFormatter->formatCode() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:13586
    0.0394    3825472   4. AlignDoubleArrow->format() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:2790

PHP Notice:  Undefined offset: 0 in phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php on line 6538
PHP Stack trace:
PHP   1. {main}() /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:0
PHP   2. include() /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:9
PHP   3. BaseCodeFormatter->formatCode() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:13586
PHP   4. AlignDoubleArrow->format() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:2790

Notice: Undefined offset: 0 in phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php on line 6538

Call Stack:
    0.0015     424912   1. {main}() /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:0
    0.0138    3782464   2. include('phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php') /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:9
    0.0144    3813280   3. BaseCodeFormatter->formatCode() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:13586
    0.0394    3825472   4. AlignDoubleArrow->format() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:2790

PHP Notice:  Undefined offset: 0 in phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php on line 6538
PHP Stack trace:
PHP   1. {main}() /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:0
PHP   2. include() /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:9
PHP   3. BaseCodeFormatter->formatCode() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:13586
PHP   4. AlignDoubleArrow->format() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:2790

Notice: Undefined offset: 0 in phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php on line 6538

Call Stack:
    0.0015     424912   1. {main}() /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:0
    0.0138    3782464   2. include('phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php') /Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar:9
    0.0144    3813280   3. BaseCodeFormatter->formatCode() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:13586
    0.0394    3825472   4. AlignDoubleArrow->format() phar:///Users/alan/Library/Application Support/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/fmt.phar/phpfmt.php:2790

with this config:

{
  "codeformatter_php_options": {
    "syntaxes": "php",
    "php_path": "/usr/local/php5-7.0.15-20170213-103227/bin/php",
    "format_on_save": true,
    "php55_compat": false, // PHP 5.5 compatible mode
    "psr1": true, // Activate PSR1 style
    "psr1_naming": true, // Activate PSR1 style - Section 3 and 4.3 - Class and method names case
    "psr2": true, // Activate PSR2 style
    "indent_with_space": 2,
    "enable_auto_align": true, // Enable auto align of = and =>
    "visibility_order": true, // Fixes visibility order for method in classes - PSR-2 4.2
    "smart_linebreak_after_curly": true, // Convert multistatement blocks into multiline blocks
    // Enable specific transformations. Example: ["ConvertOpenTagWithEcho", "PrettyPrintDocBlocks"]
    // You can list all available transformations from command palette: CodeFormatter: Show PHP Transformations
    "passes": ["DoubleToSingleQuote", "WrongConstructorName"],
    // Disable specific transformations
    "excludes": []
  }
}

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.