Skip to content

Double arrow problem #4

Description

@alpo22

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": []
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions