joshvarner / php.tmbundle Goto Github PK
View Code? Open in Web Editor NEWThis project forked from textmate/php.tmbundle
TextMate support for PHP
Home Page: http://svn.textmate.org/trunk/Bundles/PHP.tmbundle/
This project forked from textmate/php.tmbundle
TextMate support for PHP
Home Page: http://svn.textmate.org/trunk/Bundles/PHP.tmbundle/
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');
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);
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();
Should be scoped as constant.language.php
(currently constant.other.php
):
__DIR__
__NAMESPACE__
Should be scoped to match E_ERROR
(support.constant.core.php
):
E_DEPRECATED
Full list of constants added in PHP 5.3:
http://www.php.net/manual/en/migration53.global-constants.php
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.
Need to add support to the bundle for the goto
operator and labels.
From http://php.net/goto
<?php
goto a;
echo 'Foo';
a:
echo 'Bar';
?>
<?php
for ($i = 0, $j = 50; $i < 100; $i++) {
while ($j--) {
if ($j == 17) goto end;
}
}
echo "i = $i";
end:
echo 'j hit 17';
?>
Figured I'd report this here as it seems like you're the current maintainer of the PHP tmbundle.
Nothing major but figured I'd report it anyways. The function lcfirst()
(http://www.php.net/manual/en/function.lcfirst.php) isn't recognized as being a library function.
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
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!";
}
}
?>
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.