NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
PHP 5.3 namespaces: Support for importing and aliasing


Joined: 21 Nov 2009
Posts: 20
Reply with quote
According to me it is not possible to use namespaces in PhpED, because importing and aliasing don't work.

Code:
<?php
namespace Alpha
{
   class Foo
   {
      public function test()
      {
         echo __CLASS__ . "<br>\n";
      }
   }
}

namespace Beta
{
   use Alpha\Foo; // importing
   use Alpha\Foo as Another; // aliasing

   $foo = new Foo; // code completion fails
   $foo->test(); // code completion fails

   $another = new Another; // code completion fails
   $another->test(); // code completion fails
}


Last edited by Jan Tvrdík on Fri Jun 04, 2010 10:30 am; edited 1 time in total
View user's profileFind all posts by Jan TvrdíkSend private message


Joined: 03 Jul 2009
Posts: 5
Reply with quote
I reported this, they said: "it will be implemented in a near future", it was 6 months ago…

(similar request http://forum.nusphere.com/autocompletion-in-php-5-3-and-namespaces-t6507.html)
View user's profileFind all posts by elemSend private message


Joined: 15 Aug 2006
Posts: 21
Reply with quote
+1
View user's profileFind all posts by dgxSend private messageVisit poster's website


Joined: 14 Aug 2009
Posts: 35
Reply with quote
Any news on this?

Quite a big issue now as key php ed features are effectively broken by namespacing, and I cant get away without using it.
View user's profileFind all posts by cr0wn3rSend private message


Joined: 19 Apr 2009
Posts: 9
Location: Guelph, ON Canada
Reply with quote
+1
View user's profileFind all posts by JCookSend private message


Joined: 15 Aug 2006
Posts: 21
Reply with quote
It is really annoying. PHPEd still has NOT namespace support. This month expired my subscription and I am looking for new IDE Sad
View user's profileFind all posts by dgxSend private messageVisit poster's website


Joined: 21 Jan 2010
Posts: 5
Reply with quote
+1
Desperately need support for this. Would be nice if we could get an update from the devs on this.
View user's profileFind all posts by leotardedheroSend private message


Joined: 03 Jul 2009
Posts: 5
Reply with quote
leotardedhero wrote:
+1
Desperately need support for this. Would be nice if we could get an update from the devs on this.

use http://shop.nusphere.com/customer/support.php
View user's profileFind all posts by elemSend private message


Joined: 21 Jan 2010
Posts: 5
Reply with quote
bump
View user's profileFind all posts by leotardedheroSend private message


Joined: 07 Nov 2007
Posts: 44
Reply with quote
Hello,
Sorry for the delay in our reply.
We'd like to let you know that our development is actively looking into it.
Also we'd like to make sure that there would be no confusion for people who would read this thread later. PhpEd DOES support namespaces and namespace completion, actually we were the first ones to do that. In this thread we're discussing only a small subset (still, an important one, everybody's point is well taken) of the namespace completion feature. Specifically it's the usage of "Use".
Again, thanks everybody for comments and discussion, we'll definitely implement this feature, but we can't provide a firm deadline as of now, sorry about that.
Best regards,
Nusphere Customer Care
View user's profileFind all posts by gitmansSend private message


Joined: 21 Nov 2009
Posts: 20
Reply with quote
All problems shown in the first post have been fixed in the build 5981, but there are still many situations when the code completion fails, for example class extending or calling static method.

Code:

<?php
namespace Alpha
{
   class Foo
   {
      public function test()
      {
         echo __CLASS__ . "<br>\n";
      }

      public static function staticMethod()
      {
         echo __CLASS__ . "<br>\n";       
      }
   }
}

namespace Beta
{
   use Alpha\Foo; // importing
   use Alpha\Foo as Another; // aliasing

   $a = new Foo; // works since 5981
   $a->test(); // works since 5981

   $b = new Another; // works since 5981
   $b->test(); // works since 5981

   // calling static method
   Foo::staticMethod(); // code completion fails
   Another::staticMethod(); // code completion fails

   // extending class
   class A extends Foo
   {
      public function foo()
      {
         $this->test(); // code completion fails
      }
   }

   class B extends Another
   {
      public function foo()
      {
         $this->test(); // code completion fails
      }
   }
}
View user's profileFind all posts by Jan TvrdíkSend private message


Joined: 07 Nov 2007
Posts: 44
Reply with quote
Thank you, we'll let engineering know and they'll look into it.
Best regards,
Nusphere Customer Care
View user's profileFind all posts by gitmansSend private message
PHP 5.3 namespaces: Support for importing and aliasing
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 2  

  
  
 Reply to topic