Le 24/04/2013 08:15, Martin Keckeis a écrit :
Hello together,
if you got a namespace with more than one functions, why not just create a
container class and make the methods static?
I know it's not exactly the same, but how many times you need this
So you can write:
namespace Abc\Def;
clas
On Wed, Apr 24, 2013 at 10:54 AM, Florian Anderiasch
wrote:
> Additionally, it's either semantically wrong to group unrelated
> functions in "static tool classes", it's even a well-known antipattern.
It also doesn't address a point made by Igor before:
"It's distracting to have my vendor name
On 04/24/2013 08:15 AM, Martin Keckeis wrote:
> class Something{
> public static function blubb();
>
> public static function blubb2();
> }
>
>
> use Abc\Def\Something;
>
> Something::blubb();
> Something::blubb2();
Yes of course you can do that as an ugly workaround - but I wouldn't
c
Hello together,
if you got a namespace with more than one functions, why not just create a
container class and make the methods static?
I know it's not exactly the same, but how many times you need this
So you can write:
namespace Abc\Def;
class Something{
public static function blubb();
+1
The current behavior is really annoying.
2013/4/22 Florian Anderiasch
> On 04/22/2013 12:55 AM, Robert Stoll wrote:
> > I agree with Igor. The readability could be improved and I do not see the
> > problem of hiding built-in php functions (however, I would not recommend
> > it).
> > I would
On 04/22/2013 12:55 AM, Robert Stoll wrote:
> I agree with Igor. The readability could be improved and I do not see the
> problem of hiding built-in php functions (however, I would not recommend
> it).
> I would say, if someone hides the normal php built-in function then he or
> she is doing that o
] Importing namespaced functions
Let me give you two specific cases where I think importing a function
significantly improves the readability of code.
A) Tiny libraries
I recently released a "library" that really just consists of two functions.
Those functions are named compose() and pipeline(
Let me give you two specific cases where I think importing a function
significantly improves the readability of code.
A) Tiny libraries
I recently released a "library" that really just consists of two functions.
Those functions are named compose() and pipeline(), and the library is named
"igorw/c
> What's wrong with referencing one part of it? It can be as short as two
> characters, and an an added bonus you won't suddenly have your strlen
> overridden by somebody without you knowing it. Functions live in global
> space, and there's a real lot of them, that's why importing them wasn't
> con
You can import a namespace and use an alias. For instance
use com\example\cms as c;
c\foo();
-Ursprüngliche Nachricht-
Von: Christoph Rosse [mailto:cro...@2bepublished.at]
Gesendet: Freitag, 19. April 2013 14:48
An: internals@lists.php.net
Betreff: Re: [PHP-DEV] Importing namespaced
On 19.04.2013 08:19, Stas Malyshev wrote:
Hi!
One of the shortcomings of namespaced functions in PHP is that it is
not possible to import them as you can do with classes and
namespaces. For code that is not in the same namespace as the
function, you must always reference at least one part of th
Hi!
> One of the shortcomings of namespaced functions in PHP is that it is
> not possible to import them as you can do with classes and
> namespaces. For code that is not in the same namespace as the
> function, you must always reference at least one part of the
> namespace in order to call it.
W
Hello internals,
One of the shortcomings of namespaced functions in PHP is that it is not
possible to import them as you can do with classes and namespaces. For code
that is not in the same namespace as the function, you must always reference at
least one part of the namespace in order to call
13 matches
Mail list logo