Hello.
When I browse symfony code, I can see many type names written capitalized
(examples are randomly taken from Symfony components):
/**
* Answers whether this token's type equals to $type.
*
* @param string $type The type to test against this token's one.
*
* @return *Boolean*
*/
public function isType($type)
{
return $this->type == $type;
}
/**
* Returns a bundle and optionally its descendants by its name.
*
* @param string $name Bundle name
* @param Boolean $first Whether to return the first bundle only or
together with its descendants
*
* @return BundleInterface|*Array* A BundleInterface instance or an
array of BundleInterface instances if $first is false
*
* @throws \InvalidArgumentException when the bundle is not enabled
*
* @api
*/
function getBundle($name, $first = true);
As you can see, here in docblocks Boolean and Array are written as
capitalized. PHP is case-sensitive language so you can name your class
Boolean or Array and it will be a completely different type. For example,
the following code snippet is perfectly valid:
<?php
class Boolean {
public function hello() {
echo "I work!";
}
}
$a = new Boolean();
$a->hello();
So, well, I would like to ask, if that is correct to use capitalized type
names of built-in types like it is currently used in Symfony? It confuses
PHPStorm for example, and I created a
ticket<http://youtrack.jetbrains.net/issue/WI-7420?projectKey=WI>there. But now
I think, that this is not PHPStorm's problem. What do you
think?
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en