Giter Site home page Giter Site logo

php.tmbundle's Issues

Add support for declare()

One of the new features in PHP 5.3 is a construct called declare(). Support for this needs to be added to the bundle.

Examples from http://php.net/declare

<?php
declare(ticks=1) {
    // entire script here
}

// or you can use this:
declare(ticks=1);

declare(encoding='ISO-8859-1');

Add support for namespaced constants

We need to handle cases like these:

<?php

namespace foo;

const BLAH = 1;

namespace bar;

// \foo\BLAH is currently not highlighted properly
var_dump(\foo\BLAH);

Namespaces aren't recognized in a few situations.

When using static class members:

use My\Namespace as Alias;

\PDO::FETCH_ASSOC;

\My\Namespace\MyClass::StaticProperty;
Alias\MyClass::StaticMethod();

When type hinting:

class Test {
    public function __construct(\My\Namespace\MyClass $myClass) {
        // ..
    }
}

Assuming this is in the same area as type hinting, in catch blocks:

try {
    // ..
} catch (\PDOException $e) {
    // ..
}

Also while technically not an issue, the namespace keyword isn't actually interpreted as a library keyword and rather as if it was a user defined namespace. (http://www.php.net/manual/en/language.namespaces.nsconstants.php)

$keyword = new namespace\MyClass();

"class Foo implements Interface" breaks syntax highlighter

This has been a bug for a while. If you have a class that implements an interface like this:

class Foo implements interface
{
    public function __construct() { /* ... */
}

The formatter will hiccup and not highlight anything until a comma is hit. For example, both of these will cause the formatting to be correct:

class Foo implements Interface //,

Or

class Foo implements Interface
{
    public function __construct() {}
    // This is a clause, and this is too.

In the first example, all highlighting will be correct. In the second, only code after "This is a clause," will be highlighted correctly.

Add support for goto and labels

Need to add support to the bundle for the goto operator and labels.

Examples

From http://php.net/goto

Simple Usage

<?php

goto a;
echo 'Foo';

a:
echo 'Bar';

?>

Breaking Out of a Loop

<?php

for ($i = 0, $j = 50; $i < 100; $i++) {
    while ($j--) {
        if ($j == 17) goto end; 
    }  
}

echo "i = $i";
end:
echo 'j hit 17';

?>

error in PHP bundle - "please cache your project first"

updated some bundles last week and now my PHP bundle is behaving very weirdly.

each time I type a left parenthesis i.e.
(
symbol

it gives me the error "please cache your project first"

and does not type the parenthesis, making it impossible to use. Argh.

I have deleted all bundles added and when I deleted the PHP one, the error went away, but obviously I still need the PHP bundle back! When I tried ti again I got the error.

Is there an alternative PHP bundle I could try or is it something else?

my textmate is up to date and the php I installed through get-bundles and it is default one.

Mac Os 10.5.6 intel mac.

many thanks to anyone who can help me shed light on this matter!

Luke

Using bracket syntax, highlighting fails for global namespace

The bundle currently relies on there being a namespace name after the namespace keyword, but it needs to be able to support the following syntax, which is used for defining items to be placed in the global namespace.

<?php

namespace {
    // This function will go into the global namespace as `\foo()`
    function foo() {
        echo "Bar!";
    }
}

namespace blah {
    // This function will go into the `blah` namespace as `\blah\foo()`
    function foo() {
        echo "Bar!";
    }
}

?>

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.